v8/test/unittests
Camillo Bruni f688fe086f Reland "[counters] Fix reentrant timers for V8.Execute"
This is a reland of fffcbaea55

Additional fixes:
- Relax IsStarted DCHECKs in ElapsedTimer for paused_elapsed
- Add LogEventStatus enum in the API for better testing
- Rename Logger::StartEnd enum values to kXXX
- Add additional NestedTimedHistogramScope tests

Original change's description:
> [counters] Fix reentrant timers for V8.Execute
>
> This CL fixes a long standing issue where reentering TimedHistograms
> scopes would cause spurious measurements. Only the non-nested scopes
> yielded correct results.
>
> Due to the changed numbers, the V8.Execute histogram is renamed to
> V8.ExecuteMicroSeconds. Note that this histogram is also guarded
> behind the --slow-histograms flag due to the additional overhead.
>
> Unlike before, it does no longer include time for external callbacks
> and only measures self time. The following example illustrates the
> new behaviour:
>
> 1. Enter V8:           |--+.......+--| self-time: 4 units (reported)
> 2. Exit V8 (callback):    |-+...+-|    self-time: 2 units (ignored)
> 3. Re-enter V8:             |---|      self-time: 3 units (reported)
>
> This would result in 2 histogram entries with 4 time units for the first
> V8 slice and 3 units for the nested part. Note that the callback time
> itself is ignored.
>
> This CL attempts to clean up how TimedHistograms work:
> - Histogram: the base class
> - TimedHistograms: used for time-related histograms that are not nested
> - NestedTimeHistograms: Extends TimedHistograms and is used for nested
>   histograms
>
> This CL changes Histograms to not measure time themselves. Measurements
> happen in the *HistogramScopes:
> - BaseTimedHistogramScope: Base functionality
> - TimedHistogramScope: For non-nested measurements
> - NestedTimedHistogramScope: For nested measurements
> - PauseNestedTimedHistogramScope: Ignore time during a given scope.
>   This is used to pause timers during callbacks.
>
> Additional changes:
> - ExternalCallbackScope now contains a PauseNestedTimedHistogramScope
>   and always sets VMState<EXTERNAL>
>
> Bug: v8:11946
> Change-Id: I45e4b7ff77b5948b605dd50539044cb26222fa21
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3001345
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#76111}

Bug: v8:11946
Change-Id: Ic2eef7456fbc245febcf780b23418f6ab0bebdb7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3080566
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76180}
2021-08-09 18:41:50 +00:00
..
api [api] Add API for off-thread code cache deserialization 2021-08-09 08:55:41 +00:00
asmjs [Respect] Prefer inclusive terms 2020-06-22 18:11:23 +00:00
assembler Add RISC-V backend 2021-02-09 17:06:36 +00:00
base Reland "[counters] Fix reentrant timers for V8.Execute" 2021-08-09 18:41:50 +00:00
codegen Reland "[codegen] Add static interface descriptors" 2021-04-16 15:43:05 +00:00
compiler [compiler] Change all JS operators to hold TinyRefs instead of handles 2021-08-05 12:32:38 +00:00
compiler-dispatcher [cleanup] Rename CompilerDispatcher 2021-08-06 13:36:39 +00:00
date Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
debug Do not walk prototype chain of restricted object when displaying it in 2021-07-23 08:37:16 +00:00
diagnostics Move unittest files 2019-05-27 08:52:23 +00:00
execution CallDepthScope should track the current microtask scope 2021-04-30 14:08:49 +00:00
heap cppgc: Fix flaky crash due to used bytes counters mismatch 2021-07-29 10:11:42 +00:00
interpreter Fix most instances of -Wunreachable-code-aggressive. 2021-07-01 03:03:25 +00:00
libplatform [Jobs API]: Cleanup migration of missing Jobs pieces. 2020-09-02 20:51:29 +00:00
logging [test] Skip RuntimeCallStatsTest.GarbageCollection for gc stress tests 2021-05-31 12:10:56 +00:00
numbers [fastcall] Support JSArray as arguments 2021-06-23 14:01:40 +00:00
objects [regexp] Remove --harmony-regexp-match-indices 2021-07-22 02:28:42 +00:00
parser [cleanup] Remove DISALLOW_COPY_AND_ASSIGN in test/{common,unittests} 2020-11-06 06:07:54 +00:00
profiler [cpu-profiler] Implement basic refcounting of CodeEntry strings 2020-12-22 02:39:09 +00:00
regexp [web snapshot] Support RegExp 2021-05-14 10:27:57 +00:00
regress [heap] Remove Factory::NewUninitializedFixedArray 2021-04-26 13:52:38 +00:00
runtime Do not walk prototype chain of restricted object when displaying it in 2021-07-23 08:37:16 +00:00
strings [base] Move utils/vector.h to base/vector.h 2021-06-18 13:33:13 +00:00
tasks [test] Skip parallel compile tasks tests under off-thread 2020-11-16 15:50:20 +00:00
torque [torque] Invert the default for @generateCppClass 2021-07-21 15:21:00 +00:00
utils [base] Move utils/vector.h to base/vector.h 2021-06-18 13:33:13 +00:00
wasm [wasm] Fix initialization of block merge types 2021-08-04 10:45:20 +00:00
zone [zone] Final cleanup of zone allocations 2020-07-16 17:47:46 +00:00
BUILD.gn [api] Add API for off-thread code cache deserialization 2021-08-09 08:55:41 +00:00
DEPS Move unit tests to test/unittests. 2014-10-01 08:34:25 +00:00
run-all-unittests.cc cppgc: Avoid initializing cppgc platform through V8 2021-02-09 08:26:11 +00:00
test-helpers.cc [runtime] Rename Builtins::Name to Builtin 1/2 2021-06-07 20:05:44 +00:00
test-helpers.h [cleanup] Remove DISALLOW_COPY_AND_ASSIGN in test/{common,unittests} 2020-11-06 06:07:54 +00:00
test-utils.cc [cleanup][test] Remove redundant NOLINT annotations 2021-04-30 11:46:14 +00:00
test-utils.h [cleanup][test] Remove redundant NOLINT annotations 2021-04-30 11:46:14 +00:00
testcfg.py [unittests] initialize the loop variable 2020-06-05 12:24:10 +00:00
unittests.status PPC: skip some cppgc tests as PPC page size is too large 2021-07-12 20:24:14 +00:00