• Sigurd Schneider's avatar
    [testing] Prevent heuristics from triggering optimization in tests · 6d9b7988
    Sigurd Schneider authored
    This CL adds a mechanism that prevents the RuntimeProfiler from
    triggering optimization of a function after
    %PrepareFunctionForOptimization has been called. This is useful to
    prevent flakiness in tests, as sometimes a function that already
    got deoptimized would receive a new code object from a concurrent
    compile that was triggered by a heuristic just in the right moment
    for the assertUnoptimized test to fail. For example, the following
    was happening:
    
    PrepareFunctionForOptimization
    [marking `testAdd` for optimized recompilation, reason: small function]
    [concurrently compiling method `testAdd` using TurboFan]
    [manually marking `testAdd` for non-concurrent optimization]
    [synchonously compiling method `testAdd` using TurboFan]
    [synchonously optimizing `testAdd` produced code object 0xAAAA - took 1.638 ms]
    Runtime_GetOptimizationStatus OPTIMIZED `testAdd` (code object 0xAAAA)
    DeoptimizeFunction `testAdd` with Code Object 0xAAAA
    [concurrently optimizing `testAdd` produced code object 0xBBBB - took 3.377 ms]
    Runtime_GetOptimizationStatus OPTIMIZED `testAdd` (code object 0xBBBB)
    
    Bug: v8:9563
    Change-Id: Ia4c846aba95281589317d43b82383e70fe0a35f5
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1763546Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63343}
    6d9b7988
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
OWNERS Loading commit data...
arguments-inl.h Loading commit data...
arguments.cc Loading commit data...
arguments.h Loading commit data...
execution.cc Loading commit data...
execution.h Loading commit data...
frame-constants.h Loading commit data...
frames-inl.h Loading commit data...
frames.cc Loading commit data...
frames.h Loading commit data...
futex-emulation.cc Loading commit data...
futex-emulation.h Loading commit data...
interrupts-scope.cc Loading commit data...
interrupts-scope.h Loading commit data...
isolate-data.h Loading commit data...
isolate-inl.h Loading commit data...
isolate-utils-inl.h Loading commit data...
isolate-utils.h Loading commit data...
isolate.cc Loading commit data...
isolate.h Loading commit data...
messages.cc Loading commit data...
messages.h Loading commit data...
microtask-queue.cc Loading commit data...
microtask-queue.h Loading commit data...
runtime-profiler.cc Loading commit data...
runtime-profiler.h Loading commit data...
simulator-base.cc Loading commit data...
simulator-base.h Loading commit data...
simulator.h Loading commit data...
stack-guard.cc Loading commit data...
stack-guard.h Loading commit data...
thread-id.cc Loading commit data...
thread-id.h Loading commit data...
thread-local-top.cc Loading commit data...
thread-local-top.h Loading commit data...
v8threads.cc Loading commit data...
v8threads.h Loading commit data...
vm-state-inl.h Loading commit data...
vm-state.h Loading commit data...