variants.py 2.52 KB
Newer Older
1 2 3 4 5 6
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Use this to run several variants of the tests.
ALL_VARIANT_FLAGS = {
7
  "assert_types": [["--assert-types"]],
8
  "code_serializer": [["--cache=code"]],
9
  "default": [[]],
10
  "future": [["--future"]],
11
  "gc_stats": [["--gc-stats=1"]],
12 13
  # Alias of exhaustive variants, but triggering new test framework features.
  "infra_staging": [[]],
14
  "interpreted_regexp": [["--regexp-interpret-all"]],
15
  "jitless": [["--jitless"]],
16
  "minor_mc": [["--minor-mc"]],
17
  "nci": [["--turbo-nci"]],
18
  "no_lfa": [["--no-lazy-feedback-allocation"]],
19 20 21
  # No optimization means disable all optimizations. OptimizeFunctionOnNextCall
  # would not force optimization too. It turns into a Nop. Please see
  # https://chromium-review.googlesource.com/c/452620/ for more discussion.
22 23 24 25
  # For WebAssembly, we test "Liftoff-only" in the nooptimization variant and
  # "TurboFan-only" in the stress variant. The WebAssembly configuration is
  # independent of JS optimizations, so we can combine those configs.
  "nooptimization": [["--no-opt", "--liftoff", "--no-wasm-tier-up"]],
26
  "slow_path": [["--force-slow-path"]],
27 28
  "stress": [["--stress-opt", "--always-opt", "--no-liftoff",
              "--stress-lazy-source-positions"]],
29 30
  "stress_js_bg_compile_wasm_code_gc": [["--stress-background-compile",
                                         "--stress-wasm-code-gc"]],
31
  "stress_incremental_marking": [["--stress-incremental-marking"]],
32
  "stress_snapshot": [["--stress-snapshot"]],
33 34
  # Trigger stress sampling allocation profiler with sample interval = 2^14
  "stress_sampling": [["--stress-sampling-allocation-profiler=16384"]],
35
  "trusted": [["--no-untrusted-code-mitigations"]],
36
  "no_wasm_traps": [["--no-wasm-trap-handler"]],
37
  "turboprop": [["--turboprop"]],
38 39
  "instruction_scheduling": [["--turbo-instruction-scheduling"]],
  "stress_instruction_scheduling": [["--turbo-stress-instruction-scheduling"]],
40
  "top_level_await": [["--harmony-top-level-await"]],
41 42
}

43 44
SLOW_VARIANTS = set([
  'stress',
45
  'stress_snapshot',
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
  'nooptimization',
])

FAST_VARIANTS = set([
  'default'
])


def _variant_order_key(v):
  if v in SLOW_VARIANTS:
    return 0
  if v in FAST_VARIANTS:
    return 100
  return 50

ALL_VARIANTS = sorted(ALL_VARIANT_FLAGS.keys(),
                      key=_variant_order_key)

# Check {SLOW,FAST}_VARIANTS entries
for variants in [SLOW_VARIANTS, FAST_VARIANTS]:
  for v in variants:
    assert v in ALL_VARIANT_FLAGS