• 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
..
OWNERS Loading commit data...
runtime-array.cc Loading commit data...
runtime-atomics.cc Loading commit data...
runtime-bigint.cc Loading commit data...
runtime-classes.cc Loading commit data...
runtime-collections.cc Loading commit data...
runtime-compiler.cc Loading commit data...
runtime-date.cc Loading commit data...
runtime-debug.cc Loading commit data...
runtime-forin.cc Loading commit data...
runtime-function.cc Loading commit data...
runtime-futex.cc Loading commit data...
runtime-generator.cc Loading commit data...
runtime-internal.cc Loading commit data...
runtime-interpreter.cc Loading commit data...
runtime-intl.cc Loading commit data...
runtime-literals.cc Loading commit data...
runtime-module.cc Loading commit data...
runtime-numbers.cc Loading commit data...
runtime-object.cc Loading commit data...
runtime-operators.cc Loading commit data...
runtime-promise.cc Loading commit data...
runtime-proxy.cc Loading commit data...
runtime-regexp.cc Loading commit data...
runtime-scopes.cc Loading commit data...
runtime-strings.cc Loading commit data...
runtime-symbol.cc Loading commit data...
runtime-test.cc Loading commit data...
runtime-typedarray.cc Loading commit data...
runtime-utils.h Loading commit data...
runtime-wasm.cc Loading commit data...
runtime.cc Loading commit data...
runtime.h Loading commit data...