1# Copyright 2016 the V8 project authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# Use this to run several variants of the tests. 6ALL_VARIANT_FLAGS = { 7 "assert_types": [["--assert-types"]], 8 "code_serializer": [["--cache=code"]], 9 "default": [[]], 10 "future": [["--future"]], 11 "gc_stats": [["--gc-stats=1"]], 12 # Alias of exhaustive variants, but triggering new test framework features. 13 "infra_staging": [[]], 14 "interpreted_regexp": [["--regexp-interpret-all"]], 15 "experimental_regexp": [["--default-to-experimental-regexp-engine"]], 16 "jitless": [["--jitless"]], 17 "sparkplug": [["--sparkplug"]], 18 # TODO(v8:v8:7700): Support concurrent compilation and remove flag. 19 "maglev": [["--maglev", "--no-concurrent-recompilation"]], 20 "concurrent_sparkplug": [["--concurrent-sparkplug", "--sparkplug"]], 21 "always_sparkplug": [["--always-sparkplug", "--sparkplug"]], 22 "minor_mc": [["--minor-mc"]], 23 "no_lfa": [["--no-lazy-feedback-allocation"]], 24 # No optimization means disable all optimizations. OptimizeFunctionOnNextCall 25 # would not force optimization too. It turns into a Nop. Please see 26 # https://chromium-review.googlesource.com/c/452620/ for more discussion. 27 # For WebAssembly, we test "Liftoff-only" in the nooptimization variant and 28 # "TurboFan-only" in the stress variant. The WebAssembly configuration is 29 # independent of JS optimizations, so we can combine those configs. 30 "nooptimization": [["--no-opt", "--liftoff", "--no-wasm-tier-up"]], 31 "slow_path": [["--force-slow-path"]], 32 "stress": [["--stress-opt", "--no-liftoff", "--stress-lazy-source-positions", 33 "--no-wasm-generic-wrapper"]], 34 "stress_concurrent_allocation": [["--stress-concurrent-allocation"]], 35 "stress_concurrent_inlining": [["--stress-concurrent-inlining"]], 36 "stress_js_bg_compile_wasm_code_gc": [["--stress-background-compile", 37 "--stress-wasm-code-gc"]], 38 "stress_incremental_marking": [["--stress-incremental-marking"]], 39 "stress_snapshot": [["--stress-snapshot"]], 40 # Trigger stress sampling allocation profiler with sample interval = 2^14 41 "stress_sampling": [["--stress-sampling-allocation-profiler=16384"]], 42 "no_wasm_traps": [["--no-wasm-trap-handler"]], 43 "instruction_scheduling": [["--turbo-instruction-scheduling"]], 44 "stress_instruction_scheduling": [["--turbo-stress-instruction-scheduling"]], 45 "wasm_write_protect_code": [["--wasm-write-protect-code-memory"]], 46 # Google3 variants. 47 "google3_icu": [[]], 48 "google3_noicu": [[]], 49} 50 51# Flags that lead to a contradiction with the flags provided by the respective 52# variant. This depends on the flags specified in ALL_VARIANT_FLAGS and on the 53# implications defined in flag-definitions.h. 54INCOMPATIBLE_FLAGS_PER_VARIANT = { 55 "jitless": [ 56 "--opt", "--always-opt", "--liftoff", "--track-field-types", 57 "--validate-asm", "--sparkplug", "--concurrent-sparkplug", "--maglev", 58 "--always-sparkplug", "--regexp-tier-up", "--no-regexp-interpret-all", 59 "--maglev" 60 ], 61 "nooptimization": ["--always-opt"], 62 "slow_path": ["--no-force-slow-path"], 63 "stress_concurrent_allocation": ["--single-threaded-gc", "--predictable"], 64 "stress_concurrent_inlining": [ 65 "--single-threaded", "--predictable", "--lazy-feedback-allocation", 66 "--assert-types", "--no-concurrent-recompilation" 67 ], 68 # The fast API tests initialize an embedder object that never needs to be 69 # serialized to the snapshot, so we don't have a 70 # SerializeInternalFieldsCallback for it, so they are incompatible with 71 # stress_snapshot. 72 "stress_snapshot": ["--expose-fast-api"], 73 "stress": [ 74 "--always-opt", "--no-always-opt", "--max-inlined-bytecode-size=*", 75 "--max-inlined-bytecode-size-cumulative=*", "--stress-inline", 76 "--liftoff-only", "--wasm-speculative-inlining", 77 "--wasm-dynamic-tiering" 78 ], 79 "sparkplug": ["--jitless"], 80 "concurrent_sparkplug": ["--jitless"], 81 # TODO(v8:v8:7700): Support concurrent compilation and remove incompatible flags. 82 "maglev": [ 83 "--jitless", "--concurrent-recompilation", 84 "--stress-concurrent-inlining" 85 ], 86 "always_sparkplug": ["--jitless"], 87 "code_serializer": [ 88 "--cache=after-execute", "--cache=full-code-cache", "--cache=none" 89 ], 90 "experimental_regexp": ["--no-enable-experimental-regexp-engine"], 91 # There is a negative implication: --perf-prof disables 92 # --wasm-write-protect-code-memory. 93 "wasm_write_protect_code": ["--perf-prof"], 94 "assert_types": [ 95 "--concurrent-recompilation", "--stress_concurrent_inlining", 96 "--no-assert-types" 97 ], 98} 99 100# Flags that lead to a contradiction under certain build variables. 101# This corresponds to the build variables usable in status files as generated 102# in _get_statusfile_variables in base_runner.py. 103# The conflicts might be directly contradictory flags or be caused by the 104# implications defined in flag-definitions.h. 105INCOMPATIBLE_FLAGS_PER_BUILD_VARIABLE = { 106 "lite_mode": ["--no-lazy-feedback-allocation", "--max-semi-space-size=*", 107 "--stress-concurrent-inlining"] 108 + INCOMPATIBLE_FLAGS_PER_VARIANT["jitless"], 109 "predictable": ["--parallel-compile-tasks-for-eager-toplevel", 110 "--parallel-compile-tasks-for-lazy", 111 "--concurrent-recompilation", 112 "--stress-concurrent-allocation", 113 "--stress-concurrent-inlining"], 114 "dict_property_const_tracking": [ 115 "--stress-concurrent-inlining"], 116} 117 118# Flags that lead to a contradiction when a certain extra-flag is present. 119# Such extra-flags are defined for example in infra/testing/builders.pyl or in 120# standard_runner.py. 121# The conflicts might be directly contradictory flags or be caused by the 122# implications defined in flag-definitions.h. 123INCOMPATIBLE_FLAGS_PER_EXTRA_FLAG = { 124 "--concurrent-recompilation": ["--predictable", "--assert-types"], 125 "--parallel-compile-tasks-for-eager-toplevel": ["--predictable"], 126 "--parallel-compile-tasks-for-lazy": ["--predictable"], 127 "--gc-interval=*": ["--gc-interval=*"], 128 "--optimize-for-size": ["--max-semi-space-size=*"], 129 "--stress_concurrent_allocation": 130 INCOMPATIBLE_FLAGS_PER_VARIANT["stress_concurrent_allocation"], 131 "--stress-concurrent-inlining": 132 INCOMPATIBLE_FLAGS_PER_VARIANT["stress_concurrent_inlining"], 133} 134 135SLOW_VARIANTS = set([ 136 'stress', 137 'stress_snapshot', 138 'nooptimization', 139]) 140 141FAST_VARIANTS = set([ 142 'default' 143]) 144 145 146def _variant_order_key(v): 147 if v in SLOW_VARIANTS: 148 return 0 149 if v in FAST_VARIANTS: 150 return 100 151 return 50 152 153ALL_VARIANTS = sorted(ALL_VARIANT_FLAGS.keys(), 154 key=_variant_order_key) 155 156# Check {SLOW,FAST}_VARIANTS entries 157for variants in [SLOW_VARIANTS, FAST_VARIANTS]: 158 for v in variants: 159 assert v in ALL_VARIANT_FLAGS 160