# Copyright 2024 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import annotations from typing import Final # Extracted by: # - Run `d8 --print-flag-value` # - Strip "--no-" prefixes # - Sort list KNOWN_JS_FLAGS: Final[frozenset[str]] = frozenset({ "--abort-on-bad-builtin-profile-data", "--abort-on-contradictory-flags", "--abort-on-far-code-range", "--abort-on-uncaught-exception", "--adjust-os-scheduling-parameters", "--allocation-buffer-parking", "--allocation-site-pretenuring", "--allocation-site-tracking", "--allow-natives-for-differential-fuzzing", "--allow-natives-syntax", "--allow-overwriting-for-next-flag", "--allow-unsafe-function-constructor", "--always-osr", "--always-osr-from-maglev", "--always-sparkplug", "--always-turbofan", "--always-use-string-forwarding-table", "--analyze-environment-liveness", "--arm-arch", "--asm-wasm-lazy-compilation", "--assert-types", "--async-stack-traces", "--baseline-batch-compilation", "--baseline-batch-compilation-threshold", "--battery-saver-mode", "--better-code-range-allocation", "--builtin-subclassing", "--builtins-in-stack-traces", "--bytecode-old-age", "--bytecode-old-time", "--cache-prototype-transitions", "--check-handle-count", "--clear-exceptions-on-js-entry", "--clear-free-memory", "--code-comments", "--code-stats", "--compact", "--compact-code-space", "--compact-code-space-with-stack", "--compact-on-every-full-gc", "--compact-with-stack", "--compilation-cache", "--compile-hints-magic", "--concurrent-array-buffer-sweeping", "--concurrent-cache-deserialization", "--concurrent-maglev-high-priority-threads", "--concurrent-maglev-max-threads", "--concurrent-marking", "--concurrent-marking-high-priority-threads", "--concurrent-marking-max-worker-num", "--concurrent-minor-ms-marking", "--concurrent-osr", "--concurrent-recompilation", "--concurrent-recompilation-delay", "--concurrent-recompilation-queue-length", "--concurrent-sparkplug", "--concurrent-sparkplug-high-priority-threads", "--concurrent-sparkplug-max-threads", "--concurrent-sweeping", "--concurrent-turbofan-max-threads", "--conservative-stack-scanning", "--correctness-fuzzer-suppressions", "--cppgc-young-generation", "--cppheap-concurrent-marking", "--cppheap-incremental-marking", "--cpu-profiler-sampling-interval", "--csa-trap-on-node", "--debug-code", "--default-to-experimental-regexp-engine", "--deopt-every-n-times", "--deopt-to-baseline", "--detailed-error-stack-trace", "--detailed-line-info", "--detect-ineffective-gcs-near-heap-limit", "--dict-property-const-tracking", "--direct-handle", "--direct-local", "--disable-abortjs", "--disable-old-api-accessors", "--disable-write-barriers", "--disallow-code-generation-from-strings", "--dump-allocations-digest-at-alloc", "--dump-builtins-hashes-to-file", "--dump-wasm-module", "--dump-wasm-module-path", "--efficiency-mode-delay-turbofan", "--efficiency-mode-disable-turbofan", "--efficiency-mode-for-tiering-heuristics", "--efficiency-mode", "--embedded-src", "--embedded-variant", "--embedder-instance-types", "--enable-32dregs", "--enable-allocation-folding", "--enable-armv7", "--enable-armv8", "--enable-avx", "--enable-avx2", "--enable-bmi1", "--enable-bmi2", "--enable-etw-stack-walking", "--enable-experimental-regexp-engine", "--enable-experimental-regexp-engine-on-excessive-backtracks", "--enable-fma3", "--enable-lazy-source-positions", "--enable-lzcnt", "--enable-neon", "--enable-popcnt", "--enable-regexp-unaligned-accesses", "--enable-sahf", "--enable-sealed-frozen-elements-kind", "--enable-sharedarraybuffer-per-context", "--enable-slow-asserts", "--enable-source-at-csa-bind", "--enable-sse3", "--enable-sse4-1", "--enable-sse4-2", "--enable-ssse3", "--enable-sudiv", "--enable-testing-opcode-in-wasm", "--enable-third-party-heap", "--enable-unconditional-write-barriers", "--enable-vfp3", "--enable-wasm-arm64-generic-wrapper", "--ephemeron-fixpoint-iterations", "--exit-on-contradictory-flags", "--experimental", "--experimental-flush-embedded-blob-icache", "--experimental-stack-trace-frames", "--experimental-value-unavailable", "--experimental-wasm-assume-ref-cast-succeeds", "--experimental-wasm-branch-hinting", "--experimental-wasm-compilation-hints", "--experimental-wasm-exnref", "--experimental-wasm-gc", "--experimental-wasm-imported-strings", "--experimental-wasm-inlining", "--experimental-wasm-instruction-tracing", "--experimental-wasm-js-inlining", "--experimental-wasm-memory64", "--experimental-wasm-multi-memory", "--experimental-wasm-pgo-from-file", "--experimental-wasm-pgo-to-file", "--experimental-wasm-ref-cast-nop", "--experimental-wasm-skip-bounds-checks", "--experimental-wasm-skip-null-checks", "--experimental-wasm-stack-switching", "--experimental-wasm-stringref", "--experimental-wasm-type-reflection", "--experimental-wasm-typed-funcref", "--expose-async-hooks", "--expose-cputracemark-as", "--expose-externalize-string", "--expose-gc", "--expose-gc-as", "--expose-ignition-statistics", "--expose-inspector-scripts", "--expose-statistics", "--expose-trigger-failure", "--expose-wasm", "--external-reference-stats", "--fast-map-update", "--fast-properties-soft-limit", "--feedback-normalization", "--fixed-array-bounds-checks", "--flush-baseline-code", "--flush-bytecode", "--flush-code-based-on-tab-visibility", "--flush-code-based-on-time", "--force-emit-interrupt-budget-checks", "--force-long-branches", "--force-marking-deque-overflows", "--force-slow-path", "--freeze-flags-after-init", "--future", "--fuzzer-gc-analysis", "--fuzzer-random-seed", "--fuzzing", "--gc-experiment-less-compaction", "--gc-fake-mmap", "--gc-global", "--gc-interval", "--gc-memory-reducer-start-delay-ms", "--gc-stats", "--gc-verbose", "--gdbjit", "--gdbjit-dump", "--gdbjit-dump-filter", "--gdbjit-full", "--hard-abort", "--harmony", "--harmony-array-from-async", "--harmony-array-grouping", "--harmony-import-assertions", "--harmony-import-attributes", "--harmony-intl-best-fit-matcher", "--harmony-intl-duration-format", "--harmony-intl-locale-info-func", "--harmony-iterator-helpers", "--harmony-json-parse-with-source", "--harmony-rab-gsab", "--harmony-rab-gsab-transfer", "--harmony-regexp-unicode-sets", "--harmony-remove-intl-locale-info-getters", "--harmony-set-methods", "--harmony-shadow-realm", "--harmony-shipping", "--harmony-struct", "--harmony-temporal", "--harmony-weak-refs-with-cleanup-some", "--hash-seed", "--heap-growing-percent", "--heap-profiler-show-hidden-objects", "--heap-profiler-trace-objects", "--heap-profiler-use-embedder-graph", "--heap-snapshot-on-oom", "--heap-snapshot-string-limit", "--heap-snapshot-verify", "--histogram-interval", "--hole-fuzzing", "--huge-max-old-generation-size", "--icu-timezone-data", "--ignition-elide-noneffectful-bytecodes", "--ignition-elide-redundant-tdz-checks", "--ignition-filter-expression-positions", "--ignition-reo", "--ignition-share-named-property-feedback", "--incremental-marking", "--incremental-marking-bailout-when-ahead-of-schedule", "--incremental-marking-hard-trigger", "--incremental-marking-soft-trigger", "--incremental-marking-task", "--incremental-marking-task-delay-ms", "--initial-heap-size", "--initial-old-space-size", "--initial-shared-heap-size", "--inline-new", "--intel-jcc-erratum-mitigation", "--internalize-on-the-fly", "--interpreted-frames-native-stack", "--invocation-count-for-early-optimization", "--invocation-count-for-feedback-allocation", "--invocation-count-for-maglev", "--invocation-count-for-maglev-osr", "--invocation-count-for-osr", "--invocation-count-for-turbofan", "--jit-fuzzing", "--jitless", "--js-explicit-resource-management", "--js-promise-withresolvers", "--js-regexp-modifiers", "--js-shipping", "--js-staging", "--lazy", "--lazy-compile-dispatcher", "--lazy-compile-dispatcher-max-threads", "--lazy-eval", "--lazy-feedback-allocation", "--lazy-new-space-shrinking", "--lazy-streaming", "--liftoff", "--liftoff-only", "--lite-mode", "--ll-prof", "--local-off-stack-check", "--log", "--log-all", "--log-code", "--log-code-disassemble", "--log-colour", "--log-deopt", "--log-feedback-vector", "--log-function-events", "--log-ic", "--log-internal-timer-events", "--log-maps", "--log-maps-details", "--log-or-trace-osr", "--log-source-code", "--log-source-position", "--log-timer-events", "--logfile", "--logfile-per-isolate", "--maglev", "--maglev-assert", "--maglev-assert-stack-size", "--maglev-break-on-entry", "--maglev-build-code-on-background", "--maglev-cse", "--maglev-deopt-data-on-background", "--maglev-destroy-on-background", "--maglev-filter", "--maglev-function-context-specialization", "--maglev-future", "--maglev-hoist-osr-value-phi-untagging", "--maglev-inline-api-calls", "--maglev-inlining", "--maglev-loop-peeling", "--maglev-loop-peeling-max-size", "--maglev-loop-peeling-only-trivial", "--maglev-osr", "--maglev-overwrite-budget", "--maglev-overwrite-osr-budget", "--maglev-print-feedback", "--maglev-reuse-stack-slots", "--maglev-speculative-hoist-phi-untagging", "--maglev-stats", "--maglev-stats-nvp", "--maglev-untagged-phis", "--manual-evacuation-candidates-selection", "--map-counters", "--max-fast-properties", "--max-heap-size", "--max-inlined-bytecode-size", "--max-inlined-bytecode-size-absolute", "--max-inlined-bytecode-size-cumulative", "--max-inlined-bytecode-size-small", "--max-lazy", "--max-maglev-hard-inline-depth", "--max-maglev-inline-depth", "--max-maglev-inlined-bytecode-size-cumulative", "--max-maglev-inlined-bytecode-size-small", "--max-maglev-inlined-bytecode-size", "--max-old-space-size", "--max-opt", "--max-optimized-bytecode-size", "--max-semi-space-size", "--max-serializer-nesting", "--max-shared-heap-size", "--max-stack-trace-source-length", "--max-valid-polymorphic-map-count", "--max-wasm-functions", "--mcpu", "--mega-dom-ic", "--memory-balancer", "--memory-balancer-c-value", "--memory-protection-keys", "--memory-reducer", "--memory-reducer-for-small-heaps", "--memory-reducer-gc-count", "--memory-reducer-single-gc", "--merge-background-deserialized-script-with-compilation-cache", "--min-inlining-frequency", "--min-maglev-inlining-frequency", "--min-semi-space-size", "--minimum-invocations-after-ic-update", "--minimum-invocations-before-optimization", "--minor-gc-task", "--minor-gc-task-trigger", "--minor-ms", "--minor-ms-concurrent-marking-trigger", "--minor-ms-max-new-space-capacity-mb", "--minor-ms-max-page-age", "--minor-ms-min-lab-size-kb", "--minor-ms-min-new-space-capacity-for-concurrent-marking-mb", "--minor-ms-page-promotion-max-lab-threshold", "--minor-ms-page-promotion-threshold", "--minor-ms-shortcut-strings", "--minor-ms-trace-fragmentation", "--mock-arraybuffer-allocator", "--mock-arraybuffer-allocator-limit", "--move-object-start", "--native-code-counters", "--omit-default-ctors", "--opt", "--optimize-for-size", "--optimize-gc-for-battery", "--optimize-on-next-call-optimizes-to-maglev", "--osr-from-maglev", "--osr-to-tierup", "--page-promotion", "--page-promotion-threshold", "--parallel-compaction", "--parallel-compile-tasks-for-eager-toplevel", "--parallel-compile-tasks-for-lazy", "--parallel-marking", "--parallel-pointer-update", "--parallel-scavenge", "--parallel-weak-ref-clearing", "--parse-only", "--partial-constant-pool", "--perf-basic-prof", "--perf-basic-prof-only-functions", "--perf-basic-prof-path", "--perf-prof", "--perf-prof-annotate-wasm", "--perf-prof-delete-file", "--perf-prof-path", "--perf-prof-unwinding-info", "--polymorphic-inlining", "--predictable", "--predictable-gc-schedule", "--prepare-always-turbofan", "--print-all-code", "--print-all-exceptions", "--print-ast", "--print-break-location", "--print-builtin-code", "--print-builtin-code-filter", "--print-builtin-size", "--print-bytecode", "--print-bytecode-filter", "--print-code", "--print-code-verbose", "--print-deopt-stress", "--print-flag-values", "--print-global-handles", "--print-handles", "--print-maglev-code", "--print-maglev-deopt-verbose", "--print-maglev-graph", "--print-maglev-graphs", "--print-opt-code", "--print-opt-code-filter", "--print-opt-source", "--print-regexp-bytecode", "--print-regexp-code", "--print-scopes", "--print-wasm-code", "--print-wasm-code-function-index", "--print-wasm-stub-code", "--prof", "--prof-browser-mode", "--prof-cpp", "--prof-sampling-interval", "--profile-deserialization", "--profile-guided-optimization", "--profile-guided-optimization-for-empty-feedback-vector", "--profile-heap-snapshot", "--random-gc-interval", "--random-seed", "--randomize-all-allocations", "--rcs", "--rcs-cpu-time", "--reclaim-unmodified-wrappers", "--redirect-code-traces", "--redirect-code-traces-to", "--regexp-backtracks-before-fallback", "--regexp-interpret-all", "--regexp-optimization", "--regexp-peephole-optimization", "--regexp-possessive-quantifier", "--regexp-tier-up", "--regexp-tier-up-ticks", "--rehash-snapshot", "--reorder-builtins", "--reserve-inline-budget-scale-factor", "--retain-maps-for-n-gc", "--runtime-call-stats", "--sampling-heap-profiler-suppress-randomness", "--scavenge-separate-stack-scanning", "--scavenger-max-new-space-capacity-mb", "--script-streaming", "--semi-space-growth-factor", "--separate-gc-phases", "--serialization-statistics", "--shared-string-table", "--short-builtin-calls", "--shortcut-strings-with-stack", "--sim-abort-on-bad-auth", "--sim-arm64-optional-features", "--single-generation", "--single-threaded", "--single-threaded-gc", "--single-threaded-gc-in-background", "--slow-histograms", "--soft-abort", "--sparkplug", "--sparkplug-filter", "--sparkplug-needs-short-builtins", "--stack-size", "--stack-trace-limit", "--stack-trace-on-illegal", "--startup-blob", "--startup-src", "--stress-background-compile", "--stress-compaction", "--stress-compaction-random", "--stress-concurrent-allocation", "--stress-concurrent-inlining", "--stress-concurrent-inlining-attach-code", "--stress-flush-code", "--stress-gc-during-compilation", "--stress-incremental-marking", "--stress-inline", "--stress-lazy-compilation", "--stress-lazy-source-positions", "--stress-maglev", "--stress-marking", "--stress-per-context-marking-worklist", "--stress-runs", "--stress-sampling-allocation-profiler", "--stress-scavenge", "--stress-snapshot", "--stress-turbo-late-spilling", "--stress-validate-asm", "--stress-wasm-code-gc", "--strict-termination-checks", "--string-slices", "--super-ic", "--suppress-asm-messages", "--switch-table-min-cases", "--switch-table-spread-threshold", "--target-arch", "--target-is-simulator", "--target-os", "--test-small-max-function-context-stub-size", "--testing-bool-flag", "--testing-d8-test-runner", "--testing-float-flag", "--testing-int-flag", "--testing-maybe-bool-flag", "--testing-prng-seed", "--testing-string-flag", "--text-is-readable", "--trace", "--trace-all-uses", "--trace-allocation-stack-interval", "--trace-asm-parser", "--trace-asm-scanner", "--trace-asm-time", "--trace-backing-store", "--trace-baseline", "--trace-baseline-batch-compilation", "--trace-block-coverage", "--trace-code-range-allocation", "--trace-compilation-dependencies", "--trace-compiler-dispatcher", "--trace-concurrent-marking", "--trace-concurrent-recompilation", "--trace-contexts", "--trace-creation-allocation-sites", "--trace-deopt", "--trace-deopt-verbose", "--trace-detached-contexts", "--trace-duplicate-threshold-kb", "--trace-elements-transitions", "--trace-environment-liveness", "--trace-evacuation", "--trace-evacuation-candidates", "--trace-experimental-regexp-engine", "--trace-file-names", "--trace-flush-code", "--trace-for-in-enumerate", "--trace-fragmentation", "--trace-fragmentation-verbose", "--trace-gc", "--trace-gc-freelists", "--trace-gc-freelists-verbose", "--trace-gc-heap-layout", "--trace-gc-heap-layout-ignore-minor-gc", "--trace-gc-ignore-scavenger", "--trace-gc-nvp", "--trace-gc-object-stats", "--trace-gc-verbose", "--trace-generalization", "--trace-heap-broker", "--trace-heap-broker-memory", "--trace-heap-broker-verbose", "--trace-idle-notification", "--trace-idle-notification-verbose", "--trace-ignition-codegen", "--trace-ignition-dispatches-output-file", "--trace-incremental-marking", "--trace-isolates", "--trace-lazy", "--trace-liftoff", "--trace-maglev-graph-building", "--trace-maglev-inlining", "--trace-maglev-inlining-verbose", "--trace-maglev-phi-untagging", "--trace-maglev-regalloc", "--trace-memory-balancer", "--trace-memory-reducer", "--trace-migration", "--trace-minor-ms-parallel-marking", "--trace-module-status", "--trace-mutator-utilization", "--trace-normalization", "--trace-opt", "--trace-opt-stats", "--trace-opt-verbose", "--trace-osr", "--trace-page-promotions", "--trace-parallel-scavenge", "--trace-pending-allocations", "--trace-pretenuring", "--trace-pretenuring-statistics", "--trace-protector-invalidation", "--trace-prototype-users", "--trace-rail", "--trace-read-only-promotion", "--trace-read-only-promotion-verbose", "--trace-regexp-assembler", "--trace-regexp-bytecodes", "--trace-regexp-graph", "--trace-regexp-parser", "--trace-regexp-peephole-optimization", "--trace-regexp-tier-up", "--trace-representation", "--trace-serializer", "--trace-side-effect-free-debug-evaluate", "--trace-store-elimination", "--trace-stress-marking", "--trace-stress-scavenge", "--trace-temporal", "--trace-track-allocation-sites", "--trace-turbo", "--trace-turbo-alloc", "--trace-turbo-ceq", "--trace-turbo-cfg-file", "--trace-turbo-escape", "--trace-turbo-file-prefix", "--trace-turbo-filter", "--trace-turbo-graph", "--trace-turbo-inlining", "--trace-turbo-jt", "--trace-turbo-load-elimination", "--trace-turbo-loop", "--trace-turbo-path", "--trace-turbo-reduction", "--trace-turbo-scheduled", "--trace-turbo-scheduler", "--trace-turbo-stack-accesses", "--trace-turbo-trimming", "--trace-turbo-types", "--trace-unmapper", "--trace-verify-csa", "--trace-wasm", "--trace-wasm-code-gc", "--trace-wasm-compilation-times", "--trace-wasm-compiler", "--trace-wasm-decoder", "--trace-wasm-inlining", "--trace-wasm-instances", "--trace-wasm-lazy-compilation", "--trace-wasm-loop-peeling", "--trace-wasm-memory", "--trace-wasm-native-heap", "--trace-wasm-offheap-memory", "--trace-wasm-serialization", "--trace-wasm-stack-switching", "--trace-wasm-streaming", "--trace-wasm-typer", "--trace-zone-stats", "--trace-zone-type-stats", "--track-detached-contexts", "--track-field-types", "--track-gc-object-stats", "--track-retaining-path", "--transition-strings-during-gc-with-stack", "--trap-on-abort", "--turbo-allocation-folding", "--turbo-cf-optimization", "--turbo-collect-feedback-in-generic-lowering", "--turbo-compress-frame-translations", "--turbo-escape", "--turbo-fast-api-calls", "--turbo-filter", "--turbo-inline-array-builtins", "--turbo-inline-js-wasm-calls", "--turbo-inlining", "--turbo-instruction-scheduling", "--turbo-jt", "--turbo-load-elimination", "--turbo-log-builtins-count-input", "--turbo-loop-peeling", "--turbo-loop-rotation", "--turbo-loop-variable", "--turbo-move-optimization", "--turbo-optimize-apply", "--turbo-optimize-math-minmax", "--turbo-profiling", "--turbo-profiling-input", "--turbo-profiling-output", "--turbo-profiling-verbose", "--turbo-rab-gsab", "--turbo-rewrite-far-jumps", "--turbo-splitting", "--turbo-stats", "--turbo-stats-nvp", "--turbo-stats-wasm", "--turbo-store-elimination", "--turbo-stress-instruction-scheduling", "--turbo-string-builder", "--turbo-typer-hardening", "--turbo-verify", "--turbo-verify-allocation", "--turbo-verify-machine-graph", "--turbo-wasm-address-reassociation", "--turbofan", "--turboshaft", "--turboshaft-assert-types", "--turboshaft-csa", "--turboshaft-enable-debug-features", "--turboshaft-from-maglev", "--turboshaft-frontend", "--turboshaft-future", "--turboshaft-instruction-selection", "--turboshaft-load-elimination", "--turboshaft-loop-peeling", "--turboshaft-loop-unrolling", "--turboshaft-machine-lowering-opt", "--turboshaft-opt-bisect-break", "--turboshaft-opt-bisect-limit", "--turboshaft-trace-emitted", "--turboshaft-trace-reduction", "--turboshaft-trace-typing", "--turboshaft-typed-optimizations", "--turboshaft-verify-reductions", "--turboshaft-wasm", "--turboshaft-wasm-instruction-selection-experimental", "--turboshaft-wasm-instruction-selection-staged", "--turboshaft-wasm-load-elimination", "--unbox-double-arrays", "--use-external-strings", "--use-ic", "--use-idle-notification", "--use-libm-trig-functions", "--use-marking-progress-bar", "--use-osr", "--use-strict", "--v8-os-page-size", "--validate-asm", "--verify-csa", "--verify-heap", "--verify-heap-skip-remembered-set", "--verify-predictable", "--verify-simplified-lowering", "--verify-snapshot-checksum", "--vtune-prof-annotate-wasm", "--warn-about-builtin-profile-data", "--wasm-async-compilation", "--wasm-bounds-checks", "--wasm-caching-hard-threshold", "--wasm-caching-threshold", "--wasm-caching-timeout-ms", "--wasm-code-gc", "--wasm-debug-mask-for-testing", "--wasm-disassembly-max-mb", "--wasm-dynamic-tiering", "--wasm-enforce-bounds-checks", "--wasm-fuzzer-gen-test", "--wasm-generic-wrapper", "--wasm-inlining-budget", "--wasm-inlining-factor", "--wasm-inlining-max-size", "--wasm-inlining-min-budget", "--wasm-js-js-generic-wrapper", "--wasm-lazy-compilation", "--wasm-lazy-validation", "--wasm-loop-peeling", "--wasm-loop-peeling-max-size", "--wasm-loop-unrolling", "--wasm-math-intrinsics", "--wasm-max-code-space-size-mb", "--wasm-max-committed-code-mb", "--wasm-max-initial-code-space-reservation", "--wasm-max-mem-pages", "--wasm-max-module-size", "--wasm-max-table-size", "--wasm-memory64-trap-handling", "--wasm-native-module-cache-enabled", "--wasm-num-compilation-tasks", "--wasm-opt", "--wasm-simd-ssse3-codegen", "--wasm-stack-checks", "--wasm-stack-switching-stack-size", "--wasm-staging", "--wasm-test-streaming", "--wasm-tier-mask-for-testing", "--wasm-tier-up", "--wasm-tier-up-filter", "--wasm-tiering-budget", "--wasm-to-js-generic-wrapper", "--wasm-trace-native", "--wasm-turboshaft-mask-for-testing", "--wasm-wrapper-tiering-budget", "--win64-unwinding-info", "--zone-stats-tolerance", })