• 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
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
test262 Loading commit data...
torque Loading commit data...
unittests Loading commit data...
wasm-api-tests Loading commit data...
wasm-js Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
OWNERS Loading commit data...