v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
flag-definitions.h
Go to the documentation of this file.
1// Copyright 2012 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// This file defines all of the flags. It is separated into different section,
6// for Debug, Release, Logging and Profiling, etc. To add a new flag, find the
7// correct section, and use one of the DEFINE_ macros, without a trailing ';'.
8//
9// This include does not have a guard, because it is a template-style include,
10// which can be included multiple times in different modes. It expects to have
11// a mode defined before it's included. The modes are FLAG_MODE_... below:
12//
13// PRESUBMIT_INTENTIONALLY_MISSING_INCLUDE_GUARD
14
15#define DEFINE_IMPLICATION(whenflag, thenflag) \
16 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, true)
17
18// A weak implication will be overwritten by a normal implication or by an
19// explicit flag.
20#define DEFINE_WEAK_IMPLICATION(whenflag, thenflag) \
21 DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, true)
22
23#define DEFINE_WEAK_NEG_IMPLICATION(whenflag, thenflag) \
24 DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, false)
25
26#define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \
27 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false)
28
29#define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \
30 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false)
31
32// With FLAG_MODE_DECLARE we declare the fields in the {FlagValues} struct.
33// Read-only flags are static constants instead of fields.
34#if defined(FLAG_MODE_DECLARE)
35#define FLAG_FULL(ftype, ctype, nam, def, cmt) FlagValue<ctype> nam{def};
36#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
37 static constexpr FlagValue<ctype> nam{def};
38
39// We need to define all of our default values so that the Flag structure can
40// access them by pointer. These are just used internally inside of one .cc,
41// for MODE_META, so there is no impact on the flags interface.
42#elif defined(FLAG_MODE_DEFINE_DEFAULTS)
43#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
44 static constexpr ctype FLAGDEFAULT_##nam{def};
45#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
46 static constexpr ctype FLAGDEFAULT_##nam{def};
47
48// We want to write entries into our meta data table, for internal parsing and
49// printing / etc in the flag parser code.
50#elif defined(FLAG_MODE_META)
51#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
52 {Flag::TYPE_##ftype, #nam, &v8_flags.nam, &FLAGDEFAULT_##nam, cmt, false},
53// Readonly flags don't pass the value pointer since the struct expects a
54// mutable value. That's okay since the value always equals the default.
55#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
56 {Flag::TYPE_##ftype, #nam, nullptr, &FLAGDEFAULT_##nam, cmt, false},
57#define FLAG_ALIAS(ftype, ctype, alias, nam) \
58 {Flag::TYPE_##ftype, #alias, &v8_flags.nam, &FLAGDEFAULT_##nam, \
59 "alias for --" #nam, false}, // NOLINT(whitespace/indent)
60
61// We produce the code to set flags when it is implied by another flag.
62#elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
63#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \
64 changed |= TriggerImplication(v8_flags.whenflag, #whenflag, \
65 &v8_flags.thenflag, #thenflag, value, false);
66
67// A weak implication will be overwritten by a normal implication or by an
68// explicit flag.
69#define DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, value) \
70 changed |= TriggerImplication(v8_flags.whenflag, #whenflag, \
71 &v8_flags.thenflag, #thenflag, value, true);
72
73#define DEFINE_GENERIC_IMPLICATION(whenflag, statement) \
74 if (v8_flags.whenflag) statement;
75
76#define DEFINE_REQUIREMENT(statement) CHECK(statement);
77
78#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \
79 changed |= TriggerImplication(!v8_flags.whenflag, "!" #whenflag, \
80 &v8_flags.thenflag, #thenflag, value, false);
81
82#define DEFINE_NEG_VALUE_VALUE_IMPLICATION(whenflag, whenvalue, thenflag, \
83 thenvalue) \
84 changed |= \
85 TriggerImplication(v8_flags.whenflag != whenvalue, #whenflag, \
86 &v8_flags.thenflag, #thenflag, thenvalue, false);
87
88#define DEFINE_MIN_VALUE_IMPLICATION(flag, min_value) \
89 changed |= TriggerImplication(v8_flags.flag < min_value, #flag, \
90 &v8_flags.flag, #flag, min_value, false);
91
92#define DEFINE_DISABLE_FLAG_IMPLICATION(whenflag, thenflag) \
93 if (v8_flags.whenflag && v8_flags.thenflag) { \
94 PrintF(stderr, "Warning: disabling flag --" #thenflag \
95 " due to conflicting flags\n"); \
96 } \
97 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false)
98
99// We apply a generic macro to the flags.
100#elif defined(FLAG_MODE_APPLY)
101
102#define FLAG_FULL FLAG_MODE_APPLY
103
104#else
105#error No mode supplied when including flags.defs
106#endif
107
108// Dummy defines for modes where it is not relevant.
109#ifndef FLAG_FULL
110#define FLAG_FULL(ftype, ctype, nam, def, cmt)
111#endif
112
113#ifndef FLAG_READONLY
114#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
115#endif
116
117#ifndef FLAG_ALIAS
118#define FLAG_ALIAS(ftype, ctype, alias, nam)
119#endif
120
121#ifndef DEFINE_VALUE_IMPLICATION
122#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value)
123#endif
124
125#ifndef DEFINE_WEAK_VALUE_IMPLICATION
126#define DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, value)
127#endif
128
129#ifndef DEFINE_GENERIC_IMPLICATION
130#define DEFINE_GENERIC_IMPLICATION(whenflag, statement)
131#endif
132
133#ifndef DEFINE_NEG_VALUE_IMPLICATION
134#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value)
135#endif
136#ifndef DEFINE_NEG_VALUE_VALUE_IMPLICATION
137#define DEFINE_NEG_VALUE_VALUE_IMPLICATION(whenflag, whenvalue, thenflag, \
138 thenvalue)
139#endif
140
141#ifndef DEFINE_MIN_VALUE_IMPLICATION
142#define DEFINE_MIN_VALUE_IMPLICATION(flag, min_value)
143#endif
144
145#ifndef DEFINE_DISABLE_FLAG_IMPLICATION
146#define DEFINE_DISABLE_FLAG_IMPLICATION(whenflag, thenflag)
147#endif
148
149#ifndef DEFINE_REQUIREMENT
150#define DEFINE_REQUIREMENT(statement)
151#endif
152
153#ifndef DEBUG_BOOL
154#error DEBUG_BOOL must be defined at this point.
155#endif // DEBUG_BOOL
156
157#if V8_ENABLE_SPARKPLUG
158#define ENABLE_SPARKPLUG_BY_DEFAULT true
159#else
160#define ENABLE_SPARKPLUG_BY_DEFAULT false
161#endif
162
163// Supported ARM configurations are:
164// "armv6": ARMv6 + VFPv2
165// "armv7": ARMv7 + VFPv3-D32 + NEON
166// "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV
167// "armv8": ARMv8 (including all of the above)
168#if !defined(ARM_TEST_NO_FEATURE_PROBE) || \
169 (defined(CAN_USE_ARMV8_INSTRUCTIONS) && \
170 defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \
171 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS))
172#define ARM_ARCH_DEFAULT "armv8"
173#elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \
174 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)
175#define ARM_ARCH_DEFAULT "armv7+sudiv"
176#elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_NEON) && \
177 defined(CAN_USE_VFP3_INSTRUCTIONS)
178#define ARM_ARCH_DEFAULT "armv7"
179#else
180#define ARM_ARCH_DEFAULT "armv6"
181#endif
182
183#ifdef V8_OS_WIN
184#define ENABLE_LOG_COLOUR false
185#else
186#define ENABLE_LOG_COLOUR true
187#endif
188
189#define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
190#define DEFINE_BOOL_READONLY(nam, def, cmt) \
191 FLAG_READONLY(BOOL, bool, nam, def, cmt)
192#define DEFINE_MAYBE_BOOL(nam, cmt) \
193 FLAG(MAYBE_BOOL, std::optional<bool>, nam, std::nullopt, cmt)
194#define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
195#define DEFINE_UINT(nam, def, cmt) FLAG(UINT, unsigned int, nam, def, cmt)
196#define DEFINE_UINT_READONLY(nam, def, cmt) \
197 FLAG_READONLY(UINT, unsigned int, nam, def, cmt)
198#define DEFINE_UINT64(nam, def, cmt) FLAG(UINT64, uint64_t, nam, def, cmt)
199#define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
200#define DEFINE_SIZE_T(nam, def, cmt) FLAG(SIZE_T, size_t, nam, def, cmt)
201#define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
202#define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam)
203#define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam)
204#define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam)
205#define DEFINE_ALIAS_SIZE_T(alias, nam) FLAG_ALIAS(SIZE_T, size_t, alias, nam)
206#define DEFINE_ALIAS_STRING(alias, nam) \
207 FLAG_ALIAS(STRING, const char*, alias, nam)
208
209#ifdef DEBUG
210#define DEFINE_DEBUG_BOOL DEFINE_BOOL
211#else
212#define DEFINE_DEBUG_BOOL DEFINE_BOOL_READONLY
213#endif
214
215//
216// Flags in all modes.
217//
218#define FLAG FLAG_FULL
219
220// Experimental features.
221// Features that are still considered experimental and which are not ready for
222// fuzz testing should be defined using this macro. The feature will then imply
223// --experimental, which will indicate to the user that they are running an
224// experimental configuration of V8. Experimental features are always disabled
225// by default. When these features mature, the flag should first turn into a
226// regular feature flag (still disabled by default) and then ideally be staged
227// behind (for example) --future before being enabled by default.
228DEFINE_BOOL(experimental, false,
229 "Indicates that V8 is running with experimental features enabled. "
230 "This flag is typically not set explicitly but instead enabled as "
231 "an implication of other flags which enable experimental features.")
232#define DEFINE_EXPERIMENTAL_FEATURE(nam, cmt) \
233 FLAG(BOOL, bool, nam, false, cmt " (experimental)") \
234 DEFINE_IMPLICATION(nam, experimental)
235
236// ATTENTION: This is set to true by default in d8. But for API compatibility,
237// it generally defaults to false.
238DEFINE_BOOL(abort_on_contradictory_flags, false,
239 "Disallow flags or implications overriding each other.")
240// This implication is also hard-coded into the flags processing to make sure it
241// becomes active before we even process subsequent flags.
242DEFINE_NEG_IMPLICATION(fuzzing, abort_on_contradictory_flags)
243// As abort_on_contradictory_flags, but it will simply exit with return code 0.
244DEFINE_BOOL(exit_on_contradictory_flags, false,
245 "Exit with return code 0 on contradictory flags.")
246// We rely on abort_on_contradictory_flags to turn on the analysis.
247DEFINE_WEAK_IMPLICATION(exit_on_contradictory_flags,
248 abort_on_contradictory_flags)
249// This is not really a flag, it affects the interpretation of the next flag but
250// doesn't become permanently true when specified. This only works for flags
251// defined in this file, but not for d8 flags defined in src/d8/d8.cc.
252DEFINE_BOOL(allow_overwriting_for_next_flag, false,
253 "temporary disable flag contradiction to allow overwriting just "
254 "the next flag")
255
256// Flags for language modes and experimental language features.
257DEFINE_BOOL(use_strict, false, "enforce strict mode")
258
259DEFINE_BOOL(trace_temporal, false, "trace temporal code")
260
261DEFINE_BOOL(harmony, false, "enable all completed harmony features")
262DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
263
264DEFINE_BOOL(js_staging, false, "enable all completed JavaScript features")
265DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features")
266
267// Update bootstrapper.cc whenever adding a new feature flag.
268
269// Features that are still work in progress (behind individual flags).
270//
271// The "harmony" naming is now outdated and will no longer be used for new JS
272// features. Use the JAVASCRIPT macros instead.
273//
274// TODO(v8:14214): Remove --harmony flags once transition is complete.
275#define HARMONY_INPROGRESS_BASE(V) \
276 V(harmony_temporal, "Temporal") \
277 V(harmony_shadow_realm, "harmony ShadowRealm") \
278 V(harmony_struct, "harmony structs, shared structs, and shared arrays")
279
280#define JAVASCRIPT_INPROGRESS_FEATURES_BASE(V) \
281 V(js_decorators, "decorators") \
282 V(js_source_phase_imports, "source phase imports") \
283 V(js_base_64, "Uint8Array to/from base64 and hex")
284
285#ifdef V8_INTL_SUPPORT
286#define HARMONY_INPROGRESS(V) \
287 HARMONY_INPROGRESS_BASE(V) \
288 V(harmony_intl_best_fit_matcher, "Intl BestFitMatcher")
289#define JAVASCRIPT_INPROGRESS_FEATURES(V) JAVASCRIPT_INPROGRESS_FEATURES_BASE(V)
290#else
291#define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V)
292#define JAVASCRIPT_INPROGRESS_FEATURES(V) JAVASCRIPT_INPROGRESS_FEATURES_BASE(V)
293#endif
294
295// Features that are complete (but still behind the --harmony flag).
296#define HARMONY_STAGED_BASE(V)
297#define JAVASCRIPT_STAGED_FEATURES_BASE(V) \
298 V(js_explicit_resource_management, "explicit resource management") \
299 V(js_float16array, \
300 "Float16Array, Math.f16round, DataView.getFloat16, DataView.setFloat16")
301
302#ifdef V8_INTL_SUPPORT
303#define HARMONY_STAGED(V) \
304 HARMONY_STAGED_BASE(V) \
305 V(harmony_remove_intl_locale_info_getters, \
306 "Remove Obsoleted Intl Locale Info getters")
307#define JAVASCRIPT_STAGED_FEATURES(V) JAVASCRIPT_STAGED_FEATURES_BASE(V)
308#else
309#define HARMONY_STAGED(V) HARMONY_STAGED_BASE(V)
310#define JAVASCRIPT_STAGED_FEATURES(V) JAVASCRIPT_STAGED_FEATURES_BASE(V)
311#endif
312
313// Features that are shipping (turned on by default, but internal flag remains).
314#define HARMONY_SHIPPING_BASE(V) \
315 V(harmony_import_attributes, "harmony import attributes")
316
317#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \
318 V(js_regexp_duplicate_named_groups, "RegExp duplicate named groups") \
319 V(js_regexp_modifiers, "RegExp modifiers") \
320 V(js_promise_try, "Promise.try") \
321 V(js_atomics_pause, "Atomics.pause") \
322 V(js_error_iserror, "Error.isError") \
323 V(js_regexp_escape, "RegExp.escape")
324
325#ifdef V8_INTL_SUPPORT
326#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
327#define JAVASCRIPT_SHIPPING_FEATURES(V) JAVASCRIPT_SHIPPING_FEATURES_BASE(V)
328#else
329#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
330#define JAVASCRIPT_SHIPPING_FEATURES(V) JAVASCRIPT_SHIPPING_FEATURES_BASE(V)
331#endif
332
333// Once a shipping feature has proved stable in the wild, it will be dropped
334// from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,
335// and associated tests are moved from the harmony directory to the appropriate
336// esN directory.
337//
338// In-progress features are not code complete and are considered experimental,
339// i.e. not ready for fuzz testing.
340
341#define FLAG_INPROGRESS_FEATURES(id, description) \
342 DEFINE_BOOL(id, false, \
343 "enable " #description " (in progress / experimental)") \
344 DEFINE_IMPLICATION(id, experimental)
347#undef FLAG_INPROGRESS_FEATURES
348
349#define FLAG_STAGED_FEATURES(id, description) \
350 DEFINE_BOOL(id, false, "enable " #description) \
351 DEFINE_IMPLICATION(harmony, id) \
352 DEFINE_IMPLICATION(js_staging, id)
355DEFINE_IMPLICATION(harmony, js_staging)
356#undef FLAG_STAGED_FEATURES
357
358#define FLAG_SHIPPING_FEATURES(id, description) \
359 DEFINE_BOOL(id, true, "enable " #description) \
360 DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id) \
361 DEFINE_NEG_NEG_IMPLICATION(js_shipping, id)
364DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, js_shipping)
365#undef FLAG_SHIPPING_FEATURES
366
367DEFINE_BOOL(builtin_subclassing, true,
368 "subclassing support in built-in methods")
369
370// If the following flag is set to `true`, the SharedArrayBuffer constructor is
371// enabled per context depending on the callback set via
372// `SetSharedArrayBufferConstructorEnabledCallback`. If no callback is set, the
373// SharedArrayBuffer constructor is disabled.
374DEFINE_BOOL(enable_sharedarraybuffer_per_context, false,
375 "enable the SharedArrayBuffer constructor per context")
376
377#ifdef V8_INTL_SUPPORT
378DEFINE_BOOL(icu_timezone_data, true, "get information about timezones from ICU")
379#endif
380
381#ifdef V8_ENABLE_DOUBLE_CONST_STORE_CHECK
382#define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL true
383#else
384#define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL false
385#endif
386
387#ifdef V8_ENABLE_LAZY_SOURCE_POSITIONS
388#define V8_LAZY_SOURCE_POSITIONS_BOOL true
389#else
390#define V8_LAZY_SOURCE_POSITIONS_BOOL false
391#endif
392
393DEFINE_BOOL(stress_snapshot, false,
394 "disables sharing of the read-only heap for testing")
395// Incremental marking is incompatible with the stress_snapshot mode;
396// specifically, serialization may clear bytecode arrays from shared function
397// infos which the MarkCompactCollector (running concurrently) may still need.
398// See also https://crbug.com/v8/10882.
399//
400// Note: This is not an issue in production because we don't clear SFI's
401// there (that only happens in mksnapshot and in --stress-snapshot mode).
402DEFINE_NEG_IMPLICATION(stress_snapshot, incremental_marking)
403
404#ifdef V8_LITE_MODE
405#define V8_LITE_MODE_BOOL true
406#else
407#define V8_LITE_MODE_BOOL false
408#endif
409
411 "enables trade-off of performance for memory savings")
412
413// Lite mode implies other flags to trade-off performance for memory.
414DEFINE_IMPLICATION(lite_mode, jitless)
415DEFINE_IMPLICATION(lite_mode, optimize_for_size)
416
417#ifdef V8_ALLOCATION_FOLDING
418#define V8_ALLOCATION_FOLDING_BOOL true
419#else
420#define V8_ALLOCATION_FOLDING_BOOL false
421#endif
422
424 "Use allocation folding globally")
425DEFINE_NEG_NEG_IMPLICATION(enable_allocation_folding, turbo_allocation_folding)
426
427#ifdef V8_DISABLE_WRITE_BARRIERS
428#define V8_DISABLE_WRITE_BARRIERS_BOOL true
429#else
430#define V8_DISABLE_WRITE_BARRIERS_BOOL false
431#endif
432
434 "disable write barriers when GC is non-incremental "
435 "and heap contains single generation.")
436
437// Disable incremental marking barriers
438DEFINE_NEG_IMPLICATION(disable_write_barriers, incremental_marking)
439DEFINE_NEG_IMPLICATION(disable_write_barriers, concurrent_marking)
440DEFINE_NEG_IMPLICATION(disable_write_barriers, cppheap_incremental_marking)
441DEFINE_NEG_IMPLICATION(disable_write_barriers, cppheap_concurrent_marking)
442
443#ifdef V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS
444#define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL true
445#else
446#define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL false
447#endif
448
449DEFINE_BOOL_READONLY(enable_unconditional_write_barriers,
451 "always use full write barriers")
452
453#ifdef V8_ENABLE_SINGLE_GENERATION
454#define V8_SINGLE_GENERATION_BOOL true
455#else
456#define V8_SINGLE_GENERATION_BOOL false
457#endif
458
460 single_generation, V8_SINGLE_GENERATION_BOOL,
461 "allocate all objects from young generation to old generation")
462
463#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
464#define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL true
465#else
466#define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL false
467#endif
468DEFINE_BOOL_READONLY(conservative_stack_scanning,
470 "use conservative stack scanning")
471DEFINE_IMPLICATION(conservative_stack_scanning,
472 scavenger_conservative_object_pinning)
473DEFINE_NEG_IMPLICATION(conservative_stack_scanning, compact_with_stack)
474
475#ifdef V8_ENABLE_DIRECT_HANDLE
476#define V8_ENABLE_DIRECT_HANDLE_BOOL true
477#else
478#define V8_ENABLE_DIRECT_HANDLE_BOOL false
479#endif
481 "use direct handles with conservative stack scanning")
482// Do not use direct handles without conservative stack scanning, as this would
483// break the correctness of the GC.
484DEFINE_NEG_NEG_IMPLICATION(conservative_stack_scanning, direct_handle)
485
486DEFINE_EXPERIMENTAL_FEATURE(scavenger_conservative_object_pinning,
487 "Objects reachable from the native stack during "
488 "scavenge will be pinned and "
489 "won't move.")
491 stress_scavenger_conservative_object_pinning, false,
492 "Treat some precise references as conservative references to stress "
493 "test object pinning in Scavenger")
494DEFINE_IMPLICATION(stress_scavenger_conservative_object_pinning,
495 scavenger_conservative_object_pinning)
496DEFINE_NEG_IMPLICATION(stress_scavenger_conservative_object_pinning,
497 minor_gc_task)
498DEFINE_VALUE_IMPLICATION(stress_scavenger_conservative_object_pinning,
499 scavenger_max_new_space_capacity_mb, 1u)
500DEFINE_BOOL(stress_scavenger_conservative_object_pinning_random, false,
501 "Enables random stressing of object pinning in Scavenger, such "
502 "that each GC would randomly pick a subset of the precise "
503 "references to treat conservatively")
504DEFINE_IMPLICATION(stress_scavenger_conservative_object_pinning_random,
505 stress_scavenger_conservative_object_pinning)
506
507DEFINE_BOOL(scavenger_precise_object_pinning, false,
508 "Objects reachable from handles during scavenge "
509 "will be pinned and won't move.")
510
512 precise_object_pinning, false,
513 "Objects reachable from handles during GC will be pinned and won't move.")
514DEFINE_IMPLICATION(precise_object_pinning, scavenger_precise_object_pinning)
515
516DEFINE_BOOL(scavenger_promote_quarantined_pages, true,
517 "Quarantined pages in the intermediate generation will be promoted "
518 "to old space")
519
520#ifdef V8_ENABLE_LOCAL_OFF_STACK_CHECK
521#define V8_ENABLE_LOCAL_OFF_STACK_CHECK_BOOL true
522#else
523#define V8_ENABLE_LOCAL_OFF_STACK_CHECK_BOOL false
524#endif
525DEFINE_BOOL_READONLY(local_off_stack_check,
527 "check for off-stack allocation of v8::Local")
528
529#ifdef V8_ENABLE_FUTURE
530#define FUTURE_BOOL true
531#else
532#define FUTURE_BOOL false
533#endif
535 "Implies all staged features that we want to ship in the "
536 "not-too-far future")
537
538DEFINE_BOOL(force_emit_interrupt_budget_checks, false,
539 "force emit tier-up logic from all non-turbofan code, even if it "
540 "is the top enabled tier")
541#ifdef V8_ENABLE_MAGLEV
542DEFINE_BOOL(maglev, true, "enable the maglev optimizing compiler")
543#if !ENABLE_MAGLEV
544// Enable Maglev on Future for platforms in which it's not enabled by default
545// (eg, Android).
546DEFINE_WEAK_IMPLICATION(future, maglev)
547#endif
549 maglev_future,
550 "enable maglev features that we want to ship in the not-too-far future")
551DEFINE_IMPLICATION(maglev_future, maglev)
553 optimize_on_next_call_optimizes_to_maglev, false,
554 "make OptimizeFunctionOnNextCall optimize to maglev instead of turbofan")
555
556// We stress maglev by setting a very low interrupt budget for maglev. This
557// way, we still gather *some* feedback before compiling optimized code.
558DEFINE_BOOL(stress_maglev, false, "trigger maglev compilation earlier")
559DEFINE_IMPLICATION(stress_maglev, maglev)
560DEFINE_WEAK_VALUE_IMPLICATION(stress_maglev, invocation_count_for_maglev, 4)
561
562#else
563DEFINE_BOOL_READONLY(maglev, false, "enable the maglev optimizing compiler")
565 maglev_future, false,
566 "enable maglev features that we want to ship in the not-too-far future")
567DEFINE_BOOL_READONLY(stress_maglev, false, "trigger maglev compilation earlier")
569 optimize_on_next_call_optimizes_to_maglev, false,
570 "make OptimizeFunctionOnNextCall optimize to maglev instead of turbofan")
571#endif // V8_ENABLE_MAGLEV
572
573DEFINE_BOOL(maglev_inlining, true,
574 "enable inlining in the maglev optimizing compiler")
575DEFINE_BOOL(maglev_loop_peeling, true,
576 "enable loop peeling in the maglev optimizing compiler")
577DEFINE_BOOL(maglev_optimistic_peeled_loops, true,
578 "enable aggressive optimizations for loops (loop SPeeling) in the "
579 "maglev optimizing compiler")
580DEFINE_INT(maglev_loop_peeling_max_size, 400,
581 "max loop size for loop peeling in the maglev optimizing compiler")
583 maglev_loop_peeling_max_size_cumulative, 900,
584 "max cumulative size for loop peeling in the maglev optimizing compiler")
585DEFINE_BOOL(maglev_deopt_data_on_background, true,
586 "Generate deopt data on background thread")
587DEFINE_BOOL(maglev_build_code_on_background, true,
588 "Generate code on background thread")
589DEFINE_WEAK_IMPLICATION(maglev_build_code_on_background,
590 maglev_deopt_data_on_background)
591DEFINE_BOOL(maglev_destroy_on_background, true,
592 "Destroy compilation jobs on background thread")
593DEFINE_BOOL(maglev_inline_api_calls, false,
594 "Inline CallApiCallback builtin into generated code")
595DEFINE_BOOL(maglev_cons_string_elision, false,
596 "Native support for cons strings and their elision in maglev.")
597DEFINE_BOOL(maglev_pretenure_store_values, false,
598 "Recursively pretenure values which are stored into pretenured "
599 "allocation sites.")
600DEFINE_EXPERIMENTAL_FEATURE(maglev_licm, "loop invariant code motion")
601DEFINE_WEAK_IMPLICATION(maglev_future, maglev_speculative_hoist_phi_untagging)
602DEFINE_WEAK_IMPLICATION(maglev_future, maglev_inline_api_calls)
603DEFINE_WEAK_IMPLICATION(maglev_future, maglev_escape_analysis)
604DEFINE_WEAK_IMPLICATION(maglev_future, maglev_licm)
605DEFINE_WEAK_IMPLICATION(maglev_future, maglev_cons_string_elision)
606DEFINE_WEAK_IMPLICATION(maglev_future, maglev_pretenure_store_values)
607// This might be too big of a hammer but we must prohibit moving the C++
608// trampolines while we are executing a C++ code.
609DEFINE_NEG_IMPLICATION(maglev_inline_api_calls, compact_code_space_with_stack)
610
612 concurrent_maglev_max_threads, 2,
613 "max number of threads that concurrent Maglev can use (0 for unbounded)")
614DEFINE_BOOL(concurrent_maglev_high_priority_threads, false,
615 "use high priority compiler threads for concurrent Maglev")
616
618 max_maglev_inline_depth, 1,
619 "max depth of functions that Maglev will inline excl. small functions")
621 max_maglev_hard_inline_depth, 10,
622 "max depth of functions that Maglev will inline incl. small functions")
623DEFINE_INT(max_maglev_inlined_bytecode_size, 460,
624 "maximum size of bytecode for a single inlining")
625DEFINE_INT(max_maglev_inlined_bytecode_size_cumulative, 920,
626 "maximum cumulative size of bytecode considered for inlining excl. "
627 "small functions")
628DEFINE_INT(max_maglev_inlined_bytecode_size_small, 27,
629 "maximum size of bytecode considered for small function inlining")
630DEFINE_FLOAT(min_maglev_inlining_frequency, 0.10,
631 "minimum frequency for inlining")
632DEFINE_WEAK_VALUE_IMPLICATION(turbofan, max_maglev_inline_depth, 1)
633DEFINE_WEAK_VALUE_IMPLICATION(turbofan, max_maglev_inlined_bytecode_size, 100)
635 max_maglev_inlined_bytecode_size_cumulative, 920)
636DEFINE_WEAK_VALUE_IMPLICATION(turbofan, min_maglev_inlining_frequency, 0.95)
637DEFINE_BOOL(maglev_reuse_stack_slots, true,
638 "reuse stack slots in the maglev optimizing compiler")
639DEFINE_BOOL(maglev_untagged_phis, true,
640 "enable phi untagging in the maglev optimizing compiler")
641DEFINE_BOOL(maglev_hoist_osr_value_phi_untagging, true,
642 "enable phi untagging to hoist untagging of osr values")
644 maglev_speculative_hoist_phi_untagging,
645 "enable phi untagging to hoist untagging of loop phi inputs (could "
646 "still cause deopt loops)")
647DEFINE_BOOL(maglev_cse, true, "common subexpression elimination")
648
649DEFINE_EXPERIMENTAL_FEATURE(maglev_non_eager_inlining,
650 "enable Maglev non-eager inlining")
651
652DEFINE_EXPERIMENTAL_FEATURE(turbolev_non_eager_inlining,
653 "enable Turbolev non-eager inlining")
654DEFINE_WEAK_IMPLICATION(turbolev_future, turbolev_non_eager_inlining)
655
656DEFINE_BOOL(maglev_inlining_following_eager_order, false,
657 "enable Maglev non-eager inlining using the same order as eager "
658 "inlining (for testing)")
659DEFINE_IMPLICATION(maglev_inlining_following_eager_order,
660 maglev_non_eager_inlining)
661
662DEFINE_STRING(maglev_filter, "*", "optimization filter for the maglev compiler")
663DEFINE_STRING(maglev_print_filter, "*",
664 "filter for maglev's tracing/printing options")
665DEFINE_BOOL(maglev_assert, false, "insert extra assertion in maglev code")
666DEFINE_DEBUG_BOOL(maglev_assert_stack_size, true,
667 "insert stack size checks before every IR node")
668DEFINE_BOOL(maglev_break_on_entry, false, "insert an int3 on maglev entries")
669DEFINE_BOOL(maglev_print_feedback, true,
670 "print feedback vector for maglev compiled code")
671DEFINE_BOOL(maglev_print_inlined, true,
672 "print bytecode / feedback vectors also for inlined code")
673
674DEFINE_BOOL(print_maglev_code, false, "print maglev code")
675DEFINE_BOOL(trace_maglev_graph_building, false, "trace maglev graph building")
676DEFINE_BOOL(trace_maglev_loop_speeling, false, "trace maglev loop SPeeling")
677DEFINE_WEAK_IMPLICATION(trace_maglev_graph_building, trace_maglev_loop_speeling)
678DEFINE_BOOL(trace_maglev_inlining, false, "trace maglev inlining")
679DEFINE_BOOL(trace_maglev_inlining_verbose, false,
680 "trace maglev inlining (verbose)")
681DEFINE_IMPLICATION(trace_maglev_inlining_verbose, trace_maglev_inlining)
682
683#ifdef V8_ENABLE_MAGLEV_GRAPH_PRINTER
684DEFINE_BOOL(print_maglev_deopt_verbose, false, "print verbose deopt info")
685DEFINE_WEAK_IMPLICATION(trace_deopt_verbose, print_maglev_deopt_verbose)
686DEFINE_BOOL(print_maglev_graph, false, "print the final maglev graph")
687DEFINE_BOOL(print_maglev_graphs, false, "print maglev graph across all phases")
688DEFINE_BOOL(trace_maglev_phi_untagging, false, "trace maglev phi untagging")
689DEFINE_BOOL(trace_maglev_regalloc, false, "trace maglev register allocation")
690#else
691DEFINE_BOOL_READONLY(print_maglev_deopt_verbose, false,
692 "print verbose deopt info")
693DEFINE_BOOL_READONLY(print_maglev_graph, false, "print the final maglev graph")
694DEFINE_BOOL_READONLY(print_maglev_graphs, false,
695 "print maglev graph across all phases")
696DEFINE_BOOL_READONLY(trace_maglev_phi_untagging, false,
697 "trace maglev phi untagging")
698DEFINE_BOOL_READONLY(trace_maglev_regalloc, false,
699 "trace maglev register allocation")
700#endif // V8_ENABLE_MAGLEV_GRAPH_PRINTER
701
702DEFINE_BOOL(maglev_stats, false, "print Maglev statistics")
703DEFINE_BOOL(maglev_stats_nvp, false,
704 "print Maglev statistics in machine-readable format")
705
706// TODO(v8:7700): Remove once stable.
707DEFINE_BOOL(maglev_function_context_specialization, true,
708 "enable function context specialization in maglev")
709
710DEFINE_BOOL(maglev_skip_migration_check_for_polymorphic_access, false,
711 "skip generating a migration check when some maps of polymorphic "
712 "property access are migration targets")
713
714#ifdef V8_ENABLE_SPARKPLUG
715DEFINE_WEAK_IMPLICATION(future, flush_baseline_code)
716#endif
717
718#ifdef V8_TARGET_ARCH_64_BIT
719DEFINE_BOOL(additive_safe_int_feedback, false,
720 "Enable the use of AdditiveSafeInteger feedback")
721DEFINE_WEAK_IMPLICATION(future, additive_safe_int_feedback)
722#else
723DEFINE_BOOL_READONLY(additive_safe_int_feedback, false,
724 "Enable the use of AdditiveSafeInteger feedback")
725#endif // V8_TARGET_ARCH_64_BIT
726
728 enable_enumerated_keyed_access_bytecode, true,
729 "enable generating GetEnumeratedKeyedProperty bytecode for keyed access")
730
731DEFINE_BOOL_READONLY(dict_property_const_tracking,
733 "Use const tracking on dictionary properties")
734
735DEFINE_BOOL(const_tracking_let, true,
736 "Use const tracking on top-level `let` variables")
737
738DEFINE_BOOL(script_context_mutable_heap_number, true,
739 "Use mutable heap numbers in script contexts")
740
741#if defined(V8_31BIT_SMIS_ON_64BIT_ARCH) || defined(V8_TARGET_ARCH_32_BIT)
742#define SUPPORT_SCRIPT_CONTEXT_MUTABLE_HEAP_INT32
743DEFINE_BOOL(script_context_mutable_heap_int32, true,
744 "Use mutable heap int32 number in script contexts")
745DEFINE_WEAK_IMPLICATION(script_context_mutable_heap_int32,
746 script_context_mutable_heap_number)
747#else
748DEFINE_BOOL_READONLY(script_context_mutable_heap_int32, false,
749 "Use mutable heap int32 number in script contexts")
750#endif
751
752DEFINE_BOOL(empty_context_extension_dep, true,
753 "Use compilation dependency to avoid dynamic checks for "
754 "non-empty context extensions")
755
756DEFINE_BOOL(json_stringify_fast_path, false, "Enable JSON.stringify fast-path")
757DEFINE_WEAK_IMPLICATION(future, json_stringify_fast_path)
758
759#ifdef V8_ENABLE_EXTENSIBLE_RO_SNAPSHOT
760DEFINE_BOOL(extensible_ro_snapshot, true,
761 "Whether custom embedder snapshots may extend ReadOnlySpace")
762#else
764 extensible_ro_snapshot, false,
765 "Whether custom embedder snapshots may extend ReadOnlySpace")
766#endif // V8_ENABLE_EXTENSIBLE_RO_SNAPSHOT
767
768DEFINE_UINT(max_opt, 999,
769 "Set the maximal optimisation tier: "
770 "> 3 == any, 0 == ignition/interpreter, 1 == sparkplug/baseline, "
771 "2 == maglev, 3 == turbofan")
772
773#ifdef V8_ENABLE_TURBOFAN
774DEFINE_WEAK_VALUE_IMPLICATION(max_opt < 3, turbofan, false)
775#endif // V8_ENABLE_TURBOFAN
776#ifdef V8_ENABLE_MAGLEV
777DEFINE_WEAK_VALUE_IMPLICATION(max_opt < 2, maglev, false)
778#endif // V8_ENABLE_MAGLEV
779#ifdef V8_ENABLE_SPARKPLUG
780DEFINE_WEAK_VALUE_IMPLICATION(max_opt < 1, sparkplug, false)
781#endif // V8_ENABLE_SPARKPLUG
782
783// Flags to override efficiency and battery saver mode settings for debugging
784// and testing.
785DEFINE_MAYBE_BOOL(efficiency_mode,
786 "Forces efficiency mode on or off, disregarding any dynamic "
787 "signals. Efficiency mode is optimized for situations with "
788 "no latency requirements and uses fewer threads.")
790 battery_saver_mode,
791 "Forces battery saver mode on or off, disregarding any dynamic signals. "
792 "Battery saver tries to conserve overall cpu cycles spent.")
793
795 memory_saver_mode,
796 "Forces memory saver mode on or off, disregarding any dynamic signals. "
797 "Memory saver tries to keep memory footprint low at the expense of extra "
798 "cpu cycles.")
799
800// Flags to experiment with the new efficiency mode
801DEFINE_BOOL(efficiency_mode_for_tiering_heuristics, true,
802 "Use efficiency mode in tiering heuristics.")
803DEFINE_BOOL(efficiency_mode_disable_turbofan, false,
804 "Defer tier-up to turbofan while in efficiency mode.")
805DEFINE_INT(efficiency_mode_delay_turbofan, 15000,
806 "Delay tier-up to turbofan to a certain invocation count while in "
807 "efficiency mode.")
808
809// Flag to select wasm trace mark type
811 wasm_trace_native, nullptr,
812 "Select which native code sequence to use for wasm trace instruction: "
813 "default or cpuid")
814
815#ifdef V8_JITLESS
816#define V8_JITLESS_BOOL true
817DEFINE_BOOL_READONLY(jitless, true,
818 "Disable runtime allocation of executable memory.")
819#else
820#define V8_JITLESS_BOOL false
822 "Disable runtime allocation of executable memory.")
823#endif // V8_JITLESS
824
825// Jitless V8 has a few implications:
826// Field type tracking is only used by TurboFan.
827DEFINE_NEG_IMPLICATION(jitless, track_field_types)
828DEFINE_NEG_IMPLICATION(jitless, script_context_mutable_heap_number)
829// No code generation at runtime.
830DEFINE_IMPLICATION(jitless, regexp_interpret_all)
831DEFINE_NEG_IMPLICATION(jitless, turbofan)
832#ifdef V8_ENABLE_SPARKPLUG
833DEFINE_NEG_IMPLICATION(jitless, sparkplug)
834DEFINE_NEG_IMPLICATION(jitless, always_sparkplug)
835#endif // V8_ENABLE_SPARKPLUG
836#ifdef V8_ENABLE_MAGLEV
837DEFINE_NEG_IMPLICATION(jitless, maglev)
838#endif // V8_ENABLE_MAGLEV
839// Doesn't work without an executable code space.
840DEFINE_NEG_IMPLICATION(jitless, interpreted_frames_native_stack)
841
843 disable_optimizing_compilers, false,
844 "Disable all optimizing compilers while leaving baseline compilers enabled")
845// Disable all optimizing JavaScript compilers.
846// JavaScript code can execute either in Ignition or Sparkplug.
847DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, turbofan)
848DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, turboshaft)
849DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, maglev)
850#if V8_ENABLE_WEBASSEMBLY
851// Disable optimizing Wasm compilers. Wasm code must execute with Liftoff.
852DEFINE_IMPLICATION(disable_optimizing_compilers, liftoff)
853DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, wasm_tier_up)
854DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, wasm_dynamic_tiering)
855// Disable translation of asm.js to Wasm
856DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, validate_asm)
857#endif // V8_ENABLE_WEBASSEMBLY
858// Field type tracking is only used by TurboFan, so can be disabled.
859DEFINE_NEG_IMPLICATION(disable_optimizing_compilers, track_field_types)
860DEFINE_NEG_IMPLICATION(disable_optimizing_compilers,
861 script_context_mutable_heap_number)
862
863DEFINE_BOOL(memory_protection_keys, true,
864 "protect code memory with PKU if available")
865
866DEFINE_BOOL(assert_types, false,
867 "generate runtime type assertions to test the typer")
868// TODO(tebbi): Support allocating types from background thread.
869DEFINE_NEG_IMPLICATION(assert_types, concurrent_recompilation)
870DEFINE_NEG_IMPLICATION(assert_types, concurrent_builtin_generation)
872 turboshaft_assert_types,
873 "generate runtime type assertions to test the turboshaft type system")
874DEFINE_NEG_IMPLICATION(turboshaft_assert_types, concurrent_recompilation)
875DEFINE_NEG_IMPLICATION(turboshaft_assert_types, concurrent_builtin_generation)
876
877// Enable verification of SimplifiedLowering in debug builds.
878DEFINE_BOOL(verify_simplified_lowering, false,
879 "verify graph generated by simplified lowering")
880
881DEFINE_BOOL(trace_compilation_dependencies, false, "trace code dependencies")
882// Depend on --trace-deopt-verbose for reporting dependency invalidations.
883DEFINE_IMPLICATION(trace_compilation_dependencies, trace_deopt_verbose)
884
885#ifdef V8_ALLOCATION_SITE_TRACKING
886#define V8_ALLOCATION_SITE_TRACKING_BOOL true
887#else
888#define V8_ALLOCATION_SITE_TRACKING_BOOL false
889#endif
890
892 "Enable allocation site tracking")
893DEFINE_NEG_NEG_IMPLICATION(allocation_site_tracking,
894 allocation_site_pretenuring)
895
896// Flags for experimental implementation features.
897DEFINE_BOOL(allocation_site_pretenuring, true,
898 "pretenure with allocation sites")
899DEFINE_BOOL(page_promotion, true, "promote pages based on utilization")
900DEFINE_INT(page_promotion_threshold, 70,
901 "min percentage of live bytes on a page to enable fast evacuation "
902 "in full GCs")
903DEFINE_INT(minor_ms_page_promotion_threshold, 50,
904 "min percentage of live bytes on a page to enable fast evacuation "
905 "in MinorMS")
906DEFINE_INT(minor_ms_page_promotion_max_lab_threshold, 30,
907 "max percentage of labs out of a page to still be considered for "
908 "page promotion")
909DEFINE_UINT(minor_ms_max_page_age, 4,
910 "max age for a page after which it is force promoted to old space")
911DEFINE_UINT(minor_ms_max_new_space_capacity_mb, 72,
912 "max new space capacity in MBs when using MinorMS. When pointer "
913 "compression is disabled, twice the capacity is used.")
914DEFINE_REQUIREMENT(v8_flags.minor_ms_max_new_space_capacity_mb > 0)
915
916#if defined(ANDROID)
917#define DEFAULT_SCAVENGER_MAX_NEW_SPACE_CAPACITY_MB 8
918#else
919#define DEFAULT_SCAVENGER_MAX_NEW_SPACE_CAPACITY_MB 32
920#endif
921DEFINE_UINT(scavenger_max_new_space_capacity_mb,
923 "max new space capacity in MBs when using Scavenger. When pointer "
924 "compression is disabled, twice the capacity is used.")
925DEFINE_REQUIREMENT(v8_flags.scavenger_max_new_space_capacity_mb > 0)
926#undef DEFAULT_SCAVENGER_MAX_NEW_SPACE_CAPACITY_MB
927
928DEFINE_BOOL(trace_page_promotions, false, "trace page promotion decisions")
929DEFINE_BOOL(trace_pretenuring, false,
930 "trace pretenuring decisions of HAllocate instructions")
931DEFINE_BOOL(trace_pretenuring_statistics, false,
932 "trace allocation site pretenuring statistics")
933DEFINE_BOOL(track_field_types, true, "track field types")
934DEFINE_BOOL(trace_block_coverage, false,
935 "trace collected block coverage information")
936DEFINE_BOOL(trace_protector_invalidation, false,
937 "trace protector cell invalidations")
938DEFINE_BOOL(decommit_pooled_pages, true,
939 "decommit, rather than discard pooled pages")
941 zero_unused_memory, false,
942 "Zero unused memory (except for memory which was discarded) on memory "
943 "reducing GCs.")
944
945#ifdef V8_MINORMS_STRING_SHORTCUTTING
946DEFINE_BOOL(minor_ms_shortcut_strings, false,
947 "short cut strings during marking")
948// String shortcutting currently doesn't work with concurrent marking.
949DEFINE_NEG_IMPLICATION(minor_ms_shortcut_strings, concurrent_minor_ms_marking)
950#else
951DEFINE_BOOL_READONLY(minor_ms_shortcut_strings, false,
952 "short cut strings during marking")
953#endif
954
955DEFINE_EXPERIMENTAL_FEATURE(feedback_normalization,
956 "feed back normalization to constructors")
957// TODO(jkummerow): This currently adds too much load on the stub cache.
958DEFINE_BOOL_READONLY(internalize_on_the_fly, true,
959 "internalize string keys for generic keyed ICs on the fly")
960
961// Flags for data representation optimizations
962DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
963DEFINE_BOOL_READONLY(string_slices, true, "use string slices")
964
965// Tiering: Sparkplug / feedback vector allocation.
966DEFINE_INT(invocation_count_for_feedback_allocation, 8,
967 "invocation count required for allocating feedback vectors")
968
969// Tiering: Maglev.
970#if defined(ANDROID)
971DEFINE_INT(invocation_count_for_maglev, 1000,
972 "invocation count required for optimizing with Maglev")
973#else
974DEFINE_INT(invocation_count_for_maglev, 400,
975 "invocation count required for optimizing with Maglev")
976#endif // ANDROID
977DEFINE_INT(invocation_count_for_maglev_osr, 100,
978 "invocation count required for maglev OSR")
979DEFINE_BOOL(osr_from_maglev, false,
980 "whether we try to OSR to Turbofan from OSR'd Maglev")
982 osr_from_maglev_interrupt_scale_factor, 0.8,
983 "Scale interrupt budget reduction for OSR from Maglev vs. OSR to Maglev")
984DEFINE_BOOL(always_osr_from_maglev, false,
985 "whether we try to OSR to Turbofan from any Maglev")
986DEFINE_WEAK_IMPLICATION(always_osr_from_maglev, osr_from_maglev)
987
988// Tiering: Turbofan.
989DEFINE_INT(invocation_count_for_turbofan, 3000,
990 "invocation count required for optimizing with TurboFan")
991DEFINE_INT(invocation_count_for_osr, 500, "invocation count required for OSR")
992DEFINE_INT(osr_to_tierup, 1,
993 "number to decrease the invocation budget by when we follow OSR")
994DEFINE_INT(minimum_invocations_after_ic_update, 500,
995 "How long to minimally wait after IC update before tier up")
996DEFINE_INT(minimum_invocations_before_optimization, 2,
997 "Minimum number of invocations we need before non-OSR optimization")
998
999// Tiering: JIT fuzzing.
1000//
1001// When --jit-fuzzing is enabled, various tiering related thresholds are
1002// lowered so that the different JIT tiers are reached roughly within a few
1003// dozen executions of the code instead of a few hundred or thousand. As a rule
1004// of thumb, aiming for things to happen 5x to 10x sooner in this mode than
1005// they otherwise would is probably not unreasonable.
1006DEFINE_BOOL(jit_fuzzing, false,
1007 "Set JIT tiering thresholds suitable for JIT fuzzing")
1008// Tier up to Sparkplug should happen after a handful o executions in ignition.
1009DEFINE_NEG_IMPLICATION(jit_fuzzing, lazy_feedback_allocation)
1010DEFINE_NEG_IMPLICATION(jit_fuzzing, baseline_batch_compilation)
1011// Tier up to Maglev should happen soon afterwards.
1012DEFINE_VALUE_IMPLICATION(jit_fuzzing, invocation_count_for_maglev, 10)
1013// And tier up to Turbofan should happen after a couple dozen or so executions.
1014DEFINE_VALUE_IMPLICATION(jit_fuzzing, invocation_count_for_turbofan, 20)
1015// Additionally, some other JIT-related thresholds should also be lowered.
1016DEFINE_VALUE_IMPLICATION(jit_fuzzing, invocation_count_for_osr, 5)
1017DEFINE_VALUE_IMPLICATION(jit_fuzzing, invocation_count_for_maglev_osr, 1)
1018DEFINE_VALUE_IMPLICATION(jit_fuzzing, minimum_invocations_after_ic_update, 5)
1019
1020#if V8_ENABLE_WEBASSEMBLY
1021// Wasm tiering thresholds.
1022DEFINE_VALUE_IMPLICATION(jit_fuzzing, wasm_wrapper_tiering_budget, 1)
1023DEFINE_VALUE_IMPLICATION(jit_fuzzing, wasm_tiering_budget, 1)
1024DEFINE_IMPLICATION(jit_fuzzing, wasm_inlining_ignore_call_counts)
1025#endif // V8_ENABLE_WEBASSEMBLY
1026
1027DEFINE_BOOL(use_std_math_pow, true,
1028 "use std::pow instead of our custom implementation")
1029
1030// Flags for inline caching and feedback vectors.
1031DEFINE_BOOL(use_ic, true, "use inline caching")
1032DEFINE_BOOL(lazy_feedback_allocation, true, "Allocate feedback vectors lazily")
1033DEFINE_BOOL(stress_ic, false, "exercise interesting paths in ICs more often")
1034
1035// Flags for Ignition.
1036DEFINE_BOOL(ignition_elide_noneffectful_bytecodes, true,
1037 "elide bytecodes which won't have any external effect")
1038DEFINE_BOOL(ignition_reo, true, "use ignition register equivalence optimizer")
1039DEFINE_BOOL(ignition_filter_expression_positions, true,
1040 "filter expression positions before the bytecode pipeline")
1041DEFINE_BOOL(ignition_share_named_property_feedback, true,
1042 "share feedback slots when loading the same named property from "
1043 "the same object")
1044DEFINE_BOOL(ignition_elide_redundant_tdz_checks, true,
1045 "elide TDZ checks dominated by other TDZ checks")
1046DEFINE_BOOL(print_bytecode, false,
1047 "print bytecode generated by ignition interpreter")
1048DEFINE_BOOL(enable_lazy_source_positions, V8_LAZY_SOURCE_POSITIONS_BOOL,
1049 "skip generating source positions during initial compile but "
1050 "regenerate when actually required")
1051DEFINE_BOOL(stress_lazy_source_positions, false,
1052 "collect lazy source positions immediately after lazy compile")
1053DEFINE_STRING(print_bytecode_filter, "*",
1054 "filter for selecting which functions to print bytecode")
1055DEFINE_BOOL(omit_default_ctors, true, "omit calling default ctors in bytecode")
1056#ifdef V8_TRACE_UNOPTIMIZED
1057DEFINE_BOOL(trace_unoptimized, false,
1058 "trace the bytecodes executed by all unoptimized execution")
1059DEFINE_BOOL(trace_ignition, false,
1060 "trace the bytecodes executed by the ignition interpreter")
1061DEFINE_BOOL(trace_baseline_exec, false,
1062 "trace the bytecodes executed by the baseline code")
1063DEFINE_WEAK_IMPLICATION(trace_unoptimized, trace_ignition)
1064DEFINE_WEAK_IMPLICATION(trace_unoptimized, trace_baseline_exec)
1065#endif
1066#ifdef V8_TRACE_FEEDBACK_UPDATES
1068 trace_feedback_updates, false,
1069 "trace updates to feedback vectors during ignition interpreter execution.")
1070#endif
1071DEFINE_BOOL(trace_ignition_codegen, false,
1072 "trace the codegen of ignition interpreter bytecode handlers")
1074 trace_ignition_dispatches_output_file, nullptr,
1075 "write the bytecode handler dispatch table to the specified file (d8 only) "
1076 "(requires building with v8_enable_ignition_dispatch_counting)")
1077
1078DEFINE_BOOL(trace_track_allocation_sites, false,
1079 "trace the tracking of allocation sites")
1080DEFINE_BOOL(trace_migration, false, "trace object migration")
1081DEFINE_BOOL(trace_generalization, false, "trace map generalization")
1082
1083DEFINE_BOOL(reuse_scope_infos, true, "reuse scope infos from previous compiles")
1084
1085DEFINE_IMPLICATION(fuzzing, reuse_scope_infos)
1086
1087// Flags for Sparkplug
1088#undef FLAG
1089#if V8_ENABLE_SPARKPLUG
1090#define FLAG FLAG_FULL
1091#else
1092#define FLAG FLAG_READONLY
1093#endif
1095 "enable Sparkplug baseline compiler")
1096DEFINE_BOOL(always_sparkplug, false, "directly tier up to Sparkplug code")
1097#if V8_ENABLE_SPARKPLUG
1098DEFINE_IMPLICATION(always_sparkplug, sparkplug)
1099DEFINE_BOOL(baseline_batch_compilation, true, "batch compile Sparkplug code")
1100#if defined(V8_OS_DARWIN) && defined(V8_HOST_ARCH_ARM64) && \
1101 !V8_HEAP_USE_PTHREAD_JIT_WRITE_PROTECT && \
1102 !V8_HEAP_USE_BECORE_JIT_WRITE_PROTECT
1103// M1 requires W^X.
1104DEFINE_BOOL_READONLY(concurrent_sparkplug, false,
1105 "compile Sparkplug code in a background thread")
1106#else
1107DEFINE_BOOL(concurrent_sparkplug, ENABLE_SPARKPLUG_BY_DEFAULT,
1108 "compile Sparkplug code in a background thread")
1109DEFINE_WEAK_IMPLICATION(future, concurrent_sparkplug)
1110DEFINE_NEG_IMPLICATION(predictable, concurrent_sparkplug)
1111DEFINE_NEG_IMPLICATION(single_threaded, concurrent_sparkplug)
1112DEFINE_NEG_IMPLICATION(jitless, concurrent_sparkplug)
1113#endif
1115 concurrent_sparkplug_max_threads, 1,
1116 "max number of threads that concurrent Sparkplug can use (0 for unbounded)")
1117DEFINE_BOOL(concurrent_sparkplug_high_priority_threads, false,
1118 "use high priority compiler threads for concurrent Sparkplug")
1119#else
1120DEFINE_BOOL(baseline_batch_compilation, false, "batch compile Sparkplug code")
1121DEFINE_BOOL_READONLY(concurrent_sparkplug, false,
1122 "compile Sparkplug code in a background thread")
1123#endif
1124DEFINE_STRING(sparkplug_filter, "*", "filter for Sparkplug baseline compiler")
1125DEFINE_BOOL(sparkplug_needs_short_builtins, false,
1126 "only enable Sparkplug baseline compiler when "
1127 "--short-builtin-calls are also enabled")
1128DEFINE_INT(baseline_batch_compilation_threshold, 4 * KB,
1129 "the estimated instruction size of a batch to trigger compilation")
1130DEFINE_BOOL(trace_baseline, false, "trace baseline compilation")
1131DEFINE_BOOL(trace_baseline_batch_compilation, false,
1132 "trace baseline batch compilation")
1133DEFINE_WEAK_IMPLICATION(trace_baseline, trace_baseline_batch_compilation)
1134#undef FLAG
1135#define FLAG FLAG_FULL
1136
1137// Internalize into a shared string table in the shared isolate
1138DEFINE_BOOL(shared_string_table, false, "internalize strings into shared table")
1139DEFINE_IMPLICATION(harmony_struct, shared_string_table)
1140DEFINE_IMPLICATION(shared_string_table, shared_heap)
1141DEFINE_BOOL_READONLY(always_use_string_forwarding_table, false,
1142 "use string forwarding table instead of thin strings for "
1143 "all strings (experimental)")
1144DEFINE_IMPLICATION(always_use_string_forwarding_table, experimental)
1145// With --always-use-string-forwarding-table, we can have young generation
1146// string entries in the forwarding table, requiring table updates when these
1147// strings get promoted to old space. Parallel GCs in client isolates
1148// (enabled by --shared-string-table) are not supported using a single shared
1149// forwarding table.
1150DEFINE_NEG_IMPLICATION(shared_string_table, always_use_string_forwarding_table)
1151
1152DEFINE_BOOL(transition_strings_during_gc_with_stack, false,
1153 "Transition strings during a full GC with stack")
1154
1155DEFINE_SIZE_T(initial_shared_heap_size, 0,
1156 "initial size of the shared heap (in Mbytes); "
1157 "other heap size flags (e.g. initial_heap_size) take precedence")
1159 max_shared_heap_size, 0,
1160 "max size of the shared heap (in Mbytes); "
1161 "other heap size flags (e.g. max_shared_heap_size) take precedence")
1162
1163DEFINE_BOOL(concurrent_builtin_generation, false,
1164 "generate builtins concurrently on separate threads in mksnapshot")
1165
1166// Flags for concurrent recompilation.
1167DEFINE_BOOL(concurrent_recompilation, true,
1168 "optimizing hot functions asynchronously on a separate thread")
1169DEFINE_BOOL(trace_concurrent_recompilation, false,
1170 "track concurrent recompilation")
1171DEFINE_INT(concurrent_recompilation_queue_length, 8,
1172 "the length of the concurrent compilation queue")
1173DEFINE_INT(concurrent_recompilation_delay, 0,
1174 "artificial compilation delay in ms")
1175DEFINE_BOOL(concurrent_recompilation_front_running, true,
1176 "move compile jobs to the front if recompilation is requested "
1177 "multiple times")
1179 concurrent_turbofan_max_threads, 4,
1180 "max number of threads that concurrent Turbofan can use (0 for unbounded)")
1182 stress_concurrent_inlining, false,
1183 "create additional concurrent optimization jobs but throw away result")
1184DEFINE_IMPLICATION(stress_concurrent_inlining, concurrent_recompilation)
1185DEFINE_IMPLICATION(stress_concurrent_inlining, turbofan)
1186DEFINE_NEG_IMPLICATION(stress_concurrent_inlining, lazy_feedback_allocation)
1187DEFINE_WEAK_VALUE_IMPLICATION(stress_concurrent_inlining,
1188 invocation_count_for_turbofan, 150)
1189DEFINE_BOOL(maglev_overwrite_budget, false,
1190 "whether maglev resets the interrupt budget")
1191DEFINE_WEAK_IMPLICATION(maglev, maglev_overwrite_budget)
1192DEFINE_NEG_IMPLICATION(stress_concurrent_inlining, maglev_overwrite_budget)
1193DEFINE_WEAK_VALUE_IMPLICATION(maglev_overwrite_budget,
1194 invocation_count_for_turbofan, 10000)
1195DEFINE_BOOL(maglev_overwrite_osr_budget, false,
1196 "whether maglev resets the OSR interrupt budget")
1197DEFINE_WEAK_IMPLICATION(maglev_osr, maglev_overwrite_osr_budget)
1198DEFINE_NEG_IMPLICATION(stress_concurrent_inlining, maglev_overwrite_osr_budget)
1199DEFINE_WEAK_VALUE_IMPLICATION(maglev_overwrite_osr_budget,
1200 invocation_count_for_osr, 800)
1201DEFINE_BOOL(stress_concurrent_inlining_attach_code, false,
1202 "create additional concurrent optimization jobs")
1203DEFINE_IMPLICATION(stress_concurrent_inlining_attach_code,
1204 stress_concurrent_inlining)
1205DEFINE_INT(max_serializer_nesting, 25,
1206 "maximum levels for nesting child serializers")
1207DEFINE_BOOL(trace_heap_broker_verbose, false,
1208 "trace the heap broker verbosely (all reports)")
1209DEFINE_BOOL(trace_heap_broker, false,
1210 "trace the heap broker (reports on missing data only)")
1211DEFINE_IMPLICATION(trace_heap_broker_verbose, trace_heap_broker)
1212DEFINE_IMPLICATION(trace_heap_broker, trace_pending_allocations)
1213
1214// Flags for stress-testing the compiler.
1215DEFINE_INT(stress_runs, 0, "number of stress runs")
1216DEFINE_INT(deopt_every_n_times, 0,
1217 "deoptimize every n times a deopt point is passed")
1218DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points")
1219
1220// Flags for TurboFan.
1221#ifdef V8_ENABLE_TURBOFAN
1222#define V8_ENABLE_TURBOFAN_BOOL true
1223DEFINE_BOOL(turbofan, true, "use the Turbofan optimizing compiler")
1224// TODO(leszeks): Temporary alias until we make sure all our infra is passing
1225// --turbofan instead of --opt.
1226DEFINE_ALIAS_BOOL(opt, turbofan)
1227#else
1228#define V8_ENABLE_TURBOFAN_BOOL false
1229DEFINE_BOOL_READONLY(turbofan, false, "use the Turbofan optimizing compiler")
1230DEFINE_BOOL_READONLY(opt, false, "use the Turbofan optimizing compiler")
1231#endif // V8_ENABLE_TURBOFAN
1232
1234 stress_turbo_late_spilling, false,
1235 "optimize placement of all spill instructions, not just loop-top phis")
1236
1237DEFINE_BOOL(turbo_wasm_address_reassociation, true,
1238 "refactor address components for immediate indexing")
1239
1240DEFINE_BOOL(concurrent_turbo_tracing, false,
1241 "allow concurrent compilation to happen in combination with "
1242 "trace-turbo* flags")
1243
1245 optimize_maglev_optimizes_to_turbofan, false,
1246 "make OptimizeMaglevOnNextCall optimize to turbofan instead of maglev")
1247
1248DEFINE_STRING(turbo_filter, "*", "optimization filter for TurboFan compiler")
1249DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR")
1250DEFINE_NEG_IMPLICATION(trace_turbo, concurrent_builtin_generation)
1251DEFINE_WEAK_IMPLICATION(trace_turbo, concurrent_turbo_tracing)
1252DEFINE_STRING(trace_turbo_path, nullptr,
1253 "directory to dump generated TurboFan IR to")
1254DEFINE_STRING(trace_turbo_filter, "*",
1255 "filter for tracing turbofan compilation")
1256DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs")
1257DEFINE_NEG_IMPLICATION(trace_turbo_graph, concurrent_builtin_generation)
1258DEFINE_BOOL(trace_turbo_scheduled, false, "trace TurboFan IR with schedule")
1259DEFINE_IMPLICATION(trace_turbo_scheduled, trace_turbo_graph)
1260DEFINE_STRING(trace_turbo_file_prefix, "turbo",
1261 "trace turbo graph to a file with given prefix")
1262DEFINE_STRING(trace_turbo_cfg_file, nullptr,
1263 "trace turbo cfg graph (for C1 visualizer) to a given file name")
1264DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types")
1265DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler")
1266DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers")
1267#ifdef V8_ENABLE_SLOW_TRACING
1268#define DEFINE_SLOW_TRACING_BOOL DEFINE_BOOL
1269#else
1270#define DEFINE_SLOW_TRACING_BOOL DEFINE_BOOL_READONLY
1271#endif // V8_ENABLE_SLOW_TRACING
1272DEFINE_SLOW_TRACING_BOOL(trace_turbo_trimming, false,
1273 "trace TurboFan's graph trimmer")
1274DEFINE_SLOW_TRACING_BOOL(trace_turbo_jt, false,
1275 "trace TurboFan's jump threading")
1276DEFINE_SLOW_TRACING_BOOL(trace_turbo_ceq, false,
1277 "trace TurboFan's control equivalence")
1278DEFINE_SLOW_TRACING_BOOL(trace_turbo_loop, false,
1279 "trace TurboFan's loop optimizations")
1280DEFINE_SLOW_TRACING_BOOL(trace_turbo_alloc, false,
1281 "trace TurboFan's register allocator")
1282DEFINE_SLOW_TRACING_BOOL(trace_all_uses, false, "trace all use positions")
1283DEFINE_SLOW_TRACING_BOOL(trace_representation, false,
1284 "trace representation types")
1286 trace_turbo_stack_accesses, false,
1287 "trace stack load/store counters for optimized code in run-time (x64 only)")
1288
1289// When fuzzing and concurrent compilation is enabled, disable Turbofan
1290// tracing flags since reading/printing heap state is not thread-safe and
1291// leads to false positives on TSAN bots.
1292// TODO(chromium:1205289): Teach relevant fuzzers to not pass TF tracing
1293// flags instead, and remove this section.
1294DEFINE_BOOL(fuzzing_and_concurrent_recompilation, true,
1295 "fuzzing && concurrent_recompilation")
1296DEFINE_NEG_NEG_IMPLICATION(fuzzing, fuzzing_and_concurrent_recompilation)
1297DEFINE_NEG_NEG_IMPLICATION(concurrent_recompilation,
1298 fuzzing_and_concurrent_recompilation)
1299DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1300 trace_turbo)
1301DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1302 trace_turbo_graph)
1303DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1304 trace_turbo_scheduled)
1305DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1306 trace_turbo_reduction)
1307#ifdef V8_ENABLE_SLOW_TRACING
1308// If expensive tracing is disabled via a build flag, the following flags
1309// cannot be disabled (because they are already).
1310DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1311 trace_turbo_trimming)
1312DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1313 trace_turbo_jt)
1314DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1315 trace_turbo_ceq)
1316DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1317 trace_turbo_loop)
1318DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1319 trace_turbo_alloc)
1320DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1321 trace_all_uses)
1322DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1323 trace_representation)
1324#endif
1325DEFINE_DISABLE_FLAG_IMPLICATION(fuzzing_and_concurrent_recompilation,
1326 trace_turbo_stack_accesses)
1327
1328DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase")
1329DEFINE_STRING(turbo_verify_machine_graph, nullptr,
1330 "verify TurboFan machine graph before instruction selection")
1331#ifdef ENABLE_VERIFY_CSA
1332DEFINE_BOOL(verify_csa, DEBUG_BOOL,
1333 "verify TurboFan machine graph of code stubs")
1334#else
1335// Define the flag as read-only-false so that code still compiles even in the
1336// non-ENABLE_VERIFY_CSA configuration.
1337DEFINE_BOOL_READONLY(verify_csa, false,
1338 "verify TurboFan machine graph of code stubs")
1339#endif // ENABLE_VERIFY_CSA
1340DEFINE_BOOL(trace_verify_csa, false, "trace code stubs verification")
1341DEFINE_STRING(csa_trap_on_node, nullptr,
1342 "trigger break point when a node with given id is created in "
1343 "given stub. The format is: StubName,NodeId")
1344DEFINE_BOOL_READONLY(fixed_array_bounds_checks, true,
1345 "enable FixedArray bounds checks")
1346DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
1347DEFINE_BOOL(turbo_stats_nvp, false,
1348 "print TurboFan statistics in machine-readable format")
1349DEFINE_BOOL(turbo_stats_wasm, false,
1350 "print TurboFan statistics of wasm compilations")
1351DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan")
1352DEFINE_BOOL(turbo_inlining, true, "enable inlining in TurboFan")
1353DEFINE_BOOL(turbo_elide_frames, true, "enable frame elision in TurboFan")
1354DEFINE_INT(max_inlined_bytecode_size, 460,
1355 "maximum size of bytecode for a single inlining")
1356DEFINE_INT(max_inlined_bytecode_size_cumulative, 920,
1357 "maximum cumulative size of bytecode considered for inlining")
1359 "maximum absolute size of bytecode considered for inlining")
1361 reserve_inline_budget_scale_factor, 1.2,
1362 "scale factor of bytecode size used to calculate the inlining budget")
1363DEFINE_INT(max_inlined_bytecode_size_small, 27,
1364 "maximum size of bytecode considered for small function inlining")
1365DEFINE_INT(max_optimized_bytecode_size, 60 * KB,
1366 "maximum bytecode size to "
1367 "be considered for turbofan optimization; too high values may cause "
1368 "the compiler to hit (release) assertions")
1369DEFINE_FLOAT(min_inlining_frequency, 0.15, "minimum frequency for inlining")
1370DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining")
1371DEFINE_BOOL(stress_inline, false,
1372 "set high thresholds for inlining to inline as much as possible")
1373DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size, 999999)
1374DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_cumulative,
1375 999999)
1377 999999)
1378DEFINE_VALUE_IMPLICATION(stress_inline, min_inlining_frequency, 0.)
1379DEFINE_IMPLICATION(stress_inline, polymorphic_inlining)
1380DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
1381DEFINE_BOOL(turbo_inline_array_builtins, true,
1382 "inline array builtins in TurboFan code")
1383DEFINE_BOOL(use_osr, true, "use on-stack replacement")
1384DEFINE_BOOL(maglev_osr, true, "use maglev as on-stack replacement target")
1385
1386// When using maglev as OSR target allow us to tier up further
1387DEFINE_WEAK_VALUE_IMPLICATION(maglev_osr, osr_from_maglev, true)
1388DEFINE_NEG_VALUE_IMPLICATION(use_osr, maglev_osr, false)
1389DEFINE_NEG_VALUE_IMPLICATION(turbofan, osr_from_maglev, false)
1390DEFINE_BOOL(concurrent_osr, true, "enable concurrent OSR")
1391
1392DEFINE_INT(maglev_allocation_folding, 1, "maglev allocation folding level")
1393DEFINE_WEAK_VALUE_IMPLICATION(maglev_future, maglev_allocation_folding, 2)
1394DEFINE_BOOL(maglev_escape_analysis, true,
1395 "avoid inlined allocation of objects that cannot escape")
1396DEFINE_BOOL(trace_maglev_escape_analysis, false, "trace maglev escape analysis")
1397DEFINE_EXPERIMENTAL_FEATURE(maglev_object_tracking,
1398 "track object changes to avoid escaping them")
1399DEFINE_WEAK_IMPLICATION(maglev_future, maglev_object_tracking)
1400DEFINE_BOOL(trace_maglev_object_tracking, false,
1401 "trace load/stores from maglev virtual objects")
1402DEFINE_WEAK_IMPLICATION(trace_maglev_graph_building,
1403 trace_maglev_object_tracking)
1404
1405// TODO(dmercadier): fix and re-enable string builder.
1406DEFINE_BOOL_READONLY(turbo_string_builder, false,
1407 "use TurboFan fast string builder")
1408
1409DEFINE_BOOL(trace_osr, false, "trace on-stack replacement")
1410DEFINE_BOOL(log_or_trace_osr, false,
1411 "internal helper flag, please use --trace-osr instead.")
1412DEFINE_IMPLICATION(trace_osr, log_or_trace_osr)
1413DEFINE_IMPLICATION(log_function_events, log_or_trace_osr)
1414
1415DEFINE_BOOL(analyze_environment_liveness, true,
1416 "analyze liveness of environment slots and zap dead values")
1417DEFINE_BOOL(trace_environment_liveness, false,
1418 "trace liveness of local variable slots")
1419DEFINE_BOOL(turbo_load_elimination, true, "enable load elimination in TurboFan")
1420DEFINE_BOOL(trace_turbo_load_elimination, false,
1421 "trace TurboFan load elimination")
1422DEFINE_BOOL(turbo_profiling, false, "enable basic block profiling in TurboFan")
1423DEFINE_NEG_IMPLICATION(turbo_profiling, concurrent_builtin_generation)
1424DEFINE_BOOL(turbo_profiling_verbose, false,
1425 "enable basic block profiling in TurboFan, and include each "
1426 "function's schedule and disassembly in the output")
1427DEFINE_IMPLICATION(turbo_profiling_verbose, turbo_profiling)
1429 turbo_profiling_output, nullptr,
1430 "emit data about basic block usage in builtins to this file "
1431 "(requires that V8 was built with v8_enable_builtins_profiling=true)")
1432DEFINE_BOOL(reorder_builtins, false,
1433 "enable builtin reordering when run mksnapshot.")
1434DEFINE_NEG_IMPLICATION(reorder_builtins, concurrent_builtin_generation)
1435
1436DEFINE_BOOL(abort_on_bad_builtin_profile_data, false,
1437 "flag for mksnapshot, abort if builtins profile can't be applied")
1439 warn_about_builtin_profile_data, false,
1440 "flag for mksnapshot, emit warnings when applying builtin profile data")
1442 dump_builtins_hashes_to_file, nullptr,
1443 "flag for mksnapshot, dump CSA builtins graph hashes to this file")
1444
1445DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL,
1446 "verify register allocation in TurboFan")
1447DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan")
1448DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan")
1449DEFINE_BOOL(turbo_loop_peeling, true, "TurboFan loop peeling")
1450DEFINE_BOOL(turbo_loop_variable, true, "TurboFan loop variable optimization")
1451DEFINE_BOOL(turbo_loop_rotation, true, "TurboFan loop rotation")
1452DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan")
1453DEFINE_BOOL(turbo_escape, true, "enable escape analysis")
1454DEFINE_BOOL(turbo_allocation_folding, true, "TurboFan allocation folding")
1455DEFINE_BOOL(turbo_instruction_scheduling, false,
1456 "enable instruction scheduling in TurboFan")
1457DEFINE_BOOL(turbo_stress_instruction_scheduling, false,
1458 "randomly schedule instructions to stress dependency tracking")
1459DEFINE_IMPLICATION(turbo_stress_instruction_scheduling,
1460 turbo_instruction_scheduling)
1461DEFINE_BOOL(turbo_store_elimination, true,
1462 "enable store-store elimination in TurboFan")
1463DEFINE_BOOL(trace_store_elimination, false, "trace store elimination")
1464DEFINE_BOOL_READONLY(turbo_typer_hardening, true,
1465 "extra bounds checks to protect against some known typer "
1466 "mismatch exploit techniques (best effort)")
1467
1468#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32)
1469DEFINE_BOOL(turbo_rewrite_far_jumps, true,
1470 "rewrite far to near jumps (ia32,x64)")
1471#else
1472DEFINE_BOOL_READONLY(turbo_rewrite_far_jumps, false,
1473 "rewrite far to near jumps (ia32,x64)")
1474#endif
1475
1477 stress_gc_during_compilation, false,
1478 "simulate GC/compiler thread race related to https://crbug.com/v8/8520")
1479DEFINE_BOOL(turbo_fast_api_calls, true, "enable fast API calls from TurboFan")
1480
1481DEFINE_BOOL(fast_api_allow_float_in_sim, false,
1482 "allow float parameters to be passed in simulator mode")
1483
1484// Float parameters in fast API calls don't work in the simulator in general,
1485// only for some specially prepared test functions. With this flag implication
1486// we want to make sure that the fuzzer does not enable float parameters also
1487// for other tests, which would just lead to errors or crashes.
1488DEFINE_NEG_IMPLICATION(fuzzing, fast_api_allow_float_in_sim)
1489
1490#ifdef V8_USE_ZLIB
1491DEFINE_BOOL(turbo_compress_frame_translations, false,
1492 "compress deoptimization frame translations (experimental)")
1493#else
1495 turbo_compress_frame_translations, false,
1496 "compress deoptimization frame translations (experimental)")
1497#endif // V8_USE_ZLIB
1499 turbo_inline_js_wasm_calls, true,
1500 "inline JS->Wasm calls (specifically: inline JS-to-Wasm wrappers and then "
1501 "the body of the Wasm function, if applicable)")
1502
1503DEFINE_BOOL(turbo_optimize_inlined_js_wasm_wrappers, false,
1504 "Run additional optimizations (especially load-elimination) on "
1505 "inlined JS-to-Wasm wrappers")
1506DEFINE_NEG_NEG_IMPLICATION(turbo_inline_js_wasm_calls,
1507 turbo_optimize_inlined_js_wasm_wrappers)
1508DEFINE_WEAK_IMPLICATION(future, turbo_optimize_inlined_js_wasm_wrappers)
1509
1510DEFINE_BOOL(turbo_optimize_apply, true, "optimize Function.prototype.apply")
1511DEFINE_BOOL(turbo_optimize_math_minmax, true,
1512 "optimize call math.min/max with double array")
1513
1514DEFINE_BOOL(turbo_collect_feedback_in_generic_lowering, false,
1515 "enable experimental feedback collection in generic lowering.")
1516
1517DEFINE_BOOL(turboshaft, true, "enable TurboFan's Turboshaft phases for JS")
1518
1519// Can't use Turbofan without Turboshaft.
1520DEFINE_NEG_NEG_IMPLICATION(turboshaft, turbofan)
1521
1522#ifdef V8_ENABLE_EXPERIMENTAL_TSA_BUILTINS
1523DEFINE_BOOL(turboshaft_enable_debug_features, DEBUG_BOOL,
1524 "enables Turboshaft's DebugPrint, StaticAssert and "
1525 "CheckTurboshaftTypeOf operations")
1526#else
1527DEFINE_BOOL(turboshaft_enable_debug_features, false,
1528 "enables Turboshaft's DebugPrint, StaticAssert and "
1529 "CheckTurboshaftTypeOf operations")
1530#endif
1531
1532DEFINE_BOOL(turboshaft_wasm_load_elimination, true,
1533 "enable Turboshaft's WasmLoadElimination")
1534
1536 turboshaft_wasm_in_js_inlining,
1537 "inline Wasm code into JS functions via Turboshaft (instead of via "
1538 "TurboFan). Only the Wasm code is inlined in Turboshaft, the JS-to-Wasm "
1539 "wrappers are still inlined in TurboFan. For controlling whether to inline "
1540 "at all, see --turbo-inline-js-wasm-calls.")
1541// Can't use Turboshaft Wasm-in-JS inlining without the Turboshaft JavaScript
1542// pipeline. Note however, that this feature is independent of the Turboshaft
1543// Wasm pipeline (since the inlinee gets compiled with the JS pipeline).
1544DEFINE_IMPLICATION(turboshaft_wasm_in_js_inlining, turboshaft)
1545DEFINE_IMPLICATION(turboshaft_wasm_in_js_inlining, turbo_inline_js_wasm_calls)
1546
1547DEFINE_BOOL(turboshaft_load_elimination, true,
1548 "enable Turboshaft's low-level load elimination for JS")
1549DEFINE_BOOL(turboshaft_loop_unrolling, true,
1550 "enable Turboshaft's loop unrolling")
1551DEFINE_BOOL(turboshaft_string_concat_escape_analysis, true,
1552 "enable Turboshaft's escape analysis for string concatenation")
1553
1554DEFINE_EXPERIMENTAL_FEATURE(turboshaft_typed_optimizations,
1555 "enable an additional Turboshaft phase that "
1556 "performs optimizations based on type information")
1557#if V8_TARGET_ARCH_ARM64
1558DEFINE_EXPERIMENTAL_FEATURE(experimental_wasm_simd_opt,
1559 "enable optimizations for Webassembly SIMD")
1560#endif // V8_TARGET_ARCH_ARM64
1561
1562DEFINE_BOOL(turbolev, false,
1563 "use Turbolev (≈ Maglev + Turboshaft combined) as the 4th tier "
1564 "compiler instead of Turbofan")
1565// inline_api_calls are not supported by the Turboshaft->Maglev translation.
1566DEFINE_NEG_IMPLICATION(turbolev, maglev_inline_api_calls)
1567
1569 turbolev_future,
1570 "enable Turbolev features that we want to ship in the not-too-far future")
1571DEFINE_IMPLICATION(turbolev_future, turbolev)
1572
1573DEFINE_BOOL(turboshaft_csa, true, "run the CSA pipeline with turboshaft")
1574DEFINE_WEAK_IMPLICATION(turboshaft_csa, turboshaft_load_elimination)
1575
1577 typed_array_length_loading, true,
1578 "Enable specializing loading the TypedArray length in Maglev / Turbofan")
1579DEFINE_WEAK_IMPLICATION(future, typed_array_length_loading)
1580
1581#if V8_ENABLE_WEBASSEMBLY
1582DEFINE_NEG_IMPLICATION(experimental_wasm_shared, liftoff)
1583#endif
1584
1585#ifdef DEBUG
1586
1587DEFINE_UINT64(turboshaft_opt_bisect_limit, std::numeric_limits<uint64_t>::max(),
1588 "stop applying optional optimizations after a specified number "
1589 "of steps, useful for bisecting optimization bugs")
1590DEFINE_UINT64(turboshaft_opt_bisect_break, std::numeric_limits<uint64_t>::max(),
1591 "abort after a specified number of steps, useful for bisecting "
1592 "optimization bugs")
1593DEFINE_BOOL(turboshaft_verify_reductions, false,
1594 "check that turboshaft reductions are correct with respect to "
1595 "inferred types")
1596DEFINE_BOOL(turboshaft_trace_typing, false,
1597 "print typing steps of turboshaft type inference")
1598DEFINE_BOOL(turboshaft_trace_reduction, false,
1599 "trace individual Turboshaft reduction steps")
1600DEFINE_BOOL(turboshaft_trace_intermediate_reductions, false,
1601 "trace intermediate Turboshaft reduction steps")
1602DEFINE_BOOL(turboshaft_trace_emitted, false,
1603 "trace emitted Turboshaft instructions")
1604DEFINE_WEAK_IMPLICATION(turboshaft_trace_intermediate_reductions,
1605 turboshaft_trace_reduction)
1606DEFINE_BOOL(turboshaft_trace_unrolling, false,
1607 "trace Turboshaft's loop unrolling reducer")
1608DEFINE_BOOL(turboshaft_trace_peeling, false,
1609 "trace Turboshaft's loop peeling reducer")
1610DEFINE_BOOL(turboshaft_trace_load_elimination, false,
1611 "trace Turboshaft's late load elimination")
1612#else
1613DEFINE_BOOL_READONLY(turboshaft_trace_reduction, false,
1614 "trace individual Turboshaft reduction steps")
1615DEFINE_BOOL_READONLY(turboshaft_trace_emitted, false,
1616 "trace emitted Turboshaft instructions")
1617DEFINE_BOOL_READONLY(turboshaft_trace_intermediate_reductions, false,
1618 "trace intermediate Turboshaft reduction steps")
1619#endif // DEBUG
1620
1621DEFINE_BOOL(profile_guided_optimization, true, "profile guided optimization")
1622DEFINE_BOOL(profile_guided_optimization_for_empty_feedback_vector, true,
1623 "profile guided optimization for empty feedback vector")
1624DEFINE_INT(invocation_count_for_early_optimization, 30,
1625 "invocation count threshold for early optimization")
1626DEFINE_INT(invocation_count_for_maglev_with_delay, 600,
1627 "invocation count for maglev for functions which according to "
1628 "profile_guided_optimization are likely to deoptimize before "
1629 "reaching this invocation count")
1630
1631// Favor memory over execution speed.
1632DEFINE_BOOL(optimize_for_size, false,
1633 "Enables optimizations which favor memory size over execution "
1634 "speed")
1635DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, size_t{1})
1636
1637DEFINE_BOOL(reopt_after_lazy_deopts, true,
1638 "Immediately re-optimize code after some lazy deopts")
1639
1640// Flags for WebAssembly.
1641#if V8_ENABLE_WEBASSEMBLY
1642
1643DEFINE_BOOL(wasm_generic_wrapper, true,
1644 "allow use of the generic js-to-wasm wrapper instead of "
1645 "per-signature wrappers")
1646DEFINE_INT(wasm_num_compilation_tasks, 128,
1647 "maximum number of parallel compilation tasks for wasm")
1648DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0)
1649DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
1650 "trace wasm native heap events")
1651DEFINE_BOOL(trace_wasm_offheap_memory, false,
1652 "print details of wasm off-heap memory when the memory measurement "
1653 "API is used")
1655 print_wasm_offheap_memory_size, false,
1656 "print off-heap memory consumption per module and engine when they die")
1657DEFINE_DEBUG_BOOL(trace_wasm_serialization, false,
1658 "trace serialization/deserialization")
1659DEFINE_BOOL(wasm_async_compilation, true,
1660 "enable actual asynchronous compilation for WebAssembly.compile")
1661DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation)
1662DEFINE_BOOL(wasm_test_streaming, false,
1663 "use streaming compilation instead of async compilation for tests")
1664DEFINE_BOOL(wasm_native_module_cache, true, "enable the native module cache")
1665// The actual value used at runtime is clamped to kV8MaxWasmMemory{32,64}Pages.
1666DEFINE_UINT(wasm_max_mem_pages, kMaxUInt32,
1667 "maximum number of 64KiB memory pages per wasm memory")
1668DEFINE_UINT(wasm_max_table_size, wasm::kV8MaxWasmTableSize,
1669 "maximum table size of a wasm instance")
1670DEFINE_UINT(wasm_max_committed_code_mb, kMaxCommittedWasmCodeMB,
1671 "maximum committed code space for wasm (in MB)")
1672DEFINE_UINT(wasm_max_code_space_size_mb, kDefaultMaxWasmCodeSpaceSizeMb,
1673 "maximum size of a single wasm code space")
1674DEFINE_BOOL(wasm_tier_up, true,
1675 "enable tier up to the optimizing compiler (requires --liftoff to "
1676 "have an effect)")
1677DEFINE_BOOL(wasm_dynamic_tiering, true,
1678 "enable dynamic tier up to the optimizing compiler")
1679DEFINE_NEG_NEG_IMPLICATION(liftoff, wasm_dynamic_tiering)
1680DEFINE_BOOL(wasm_sync_tier_up, false,
1681 "run tier up jobs synchronously for testing")
1682DEFINE_INT(wasm_tiering_budget, 13'000'000,
1683 "budget for dynamic tiering (rough approximation of bytes executed")
1684DEFINE_INT(wasm_wrapper_tiering_budget, wasm::kGenericWrapperBudget,
1685 "budget for wrapper tierup (number of calls until tier-up)")
1686DEFINE_INT(max_wasm_functions, wasm::kV8MaxWasmDefinedFunctions,
1687 "maximum number of wasm functions defined in a module")
1689 wasm_caching_threshold, 1'000,
1690 "the amount of wasm top tier code that triggers the next caching event")
1691// Note: wasm_caching_hard_threshold should always be larger than
1692// wasm_caching_threshold. If wasm_caching_timeout_ms is 0, the hard threshold
1693// will be ignored.
1694DEFINE_INT(wasm_caching_hard_threshold, 1'000'000,
1695 "the amount of wasm top tier code that triggers caching "
1696 "immediately, ignoring the --wasm-caching-timeout-ms")
1698 wasm_caching_timeout_ms, 2000,
1699 "only trigger caching if no new code was compiled within this timeout (0 "
1700 "to disable this logic and only use --wasm-caching-threshold)")
1701DEFINE_BOOL(trace_wasm_compilation_times, false,
1702 "print how long it took to compile each wasm function")
1703DEFINE_INT(wasm_tier_up_filter, -1, "only tier-up function with this index")
1704DEFINE_INT(wasm_eager_tier_up_function, -1,
1705 "eagerly tier-up function with this index")
1706DEFINE_DEBUG_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code")
1707DEFINE_DEBUG_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code")
1708DEFINE_DEBUG_BOOL(trace_wasm_streaming, false,
1709 "trace streaming compilation of wasm code")
1710DEFINE_DEBUG_BOOL(trace_wasm_stack_switching, false,
1711 "trace wasm stack switching")
1712DEFINE_BOOL(stress_wasm_stack_switching, false,
1713 "Always run wasm on a secondary stack, even when it is called "
1714 "with a regular (non-JSPI) export")
1715DEFINE_INT(wasm_stack_switching_stack_size, V8_DEFAULT_STACK_SIZE_KB,
1716 "default size of stacks for wasm stack-switching (in kB)")
1717DEFINE_BOOL(liftoff, true,
1718 "enable Liftoff, the baseline compiler for WebAssembly")
1719DEFINE_BOOL(liftoff_only, false,
1720 "disallow TurboFan compilation for WebAssembly (for testing)")
1721DEFINE_IMPLICATION(liftoff_only, liftoff)
1722DEFINE_NEG_IMPLICATION(liftoff_only, wasm_tier_up)
1723DEFINE_NEG_IMPLICATION(liftoff_only, wasm_dynamic_tiering)
1724DEFINE_NEG_IMPLICATION(fuzzing, liftoff_only)
1726 enable_testing_opcode_in_wasm, false,
1727 "enables a testing opcode in wasm that is only implemented in TurboFan")
1728// We can't tier up (from Liftoff to TurboFan) in single-threaded mode, hence
1729// disable tier up in that configuration for now.
1730DEFINE_NEG_IMPLICATION(single_threaded, wasm_tier_up)
1731DEFINE_DEBUG_BOOL(trace_liftoff, false,
1732 "trace Liftoff, the baseline compiler for WebAssembly")
1733DEFINE_BOOL(trace_wasm_memory, false,
1734 "print all memory updates performed in wasm code")
1735// Fuzzers use {wasm_tier_mask_for_testing} and {wasm_debug_mask_for_testing}
1736// together with {liftoff} and {no_wasm_tier_up} to force some functions to be
1737// compiled with TurboFan or for debug.
1738DEFINE_INT(wasm_tier_mask_for_testing, 0,
1739 "bitmask of declared(!) function indices to compile with TurboFan "
1740 "instead of Liftoff")
1741DEFINE_INT(wasm_debug_mask_for_testing, 0,
1742 "bitmask of declared(!) function indices to compile for debugging, "
1743 "only applies if the tier is Liftoff")
1744// TODO(clemensb): Introduce experimental_wasm_pgo to read from a custom section
1745// instead of from a local file.
1747 experimental_wasm_pgo_to_file, false,
1748 "experimental: dump Wasm PGO information to a local file (for testing)")
1749DEFINE_NEG_IMPLICATION(experimental_wasm_pgo_to_file, single_threaded)
1751 experimental_wasm_pgo_from_file, false,
1752 "experimental: read and use Wasm PGO data from a local file (for testing)")
1753
1754DEFINE_BOOL(validate_asm, true,
1755 "validate asm.js modules and translate them to Wasm")
1756// Directly interpret asm.js code as regular JavaScript code.
1757// asm.js validation is disabled since it triggers wasm code generation.
1758DEFINE_NEG_IMPLICATION(jitless, validate_asm)
1759
1760#if V8_ENABLE_DRUMBRAKE
1761// Wasm is put into interpreter-only mode. We repeat flag implications down
1762// here to ensure they're applied correctly by setting the --jitless flag.
1763DEFINE_NEG_IMPLICATION(jitless, asm_wasm_lazy_compilation)
1764DEFINE_NEG_IMPLICATION(jitless, wasm_lazy_compilation)
1765#endif // V8_ENABLE_DRUMBRAKE
1766
1767DEFINE_BOOL(suppress_asm_messages, false,
1768 "don't emit asm.js related messages (for golden file testing)")
1769DEFINE_BOOL(trace_asm_time, false, "print asm.js timing info to the console")
1770DEFINE_BOOL(trace_asm_scanner, false,
1771 "print tokens encountered by asm.js scanner")
1772DEFINE_BOOL(trace_asm_parser, false, "verbose logging of asm.js parse failures")
1773DEFINE_BOOL(stress_validate_asm, false, "try to validate everything as asm.js")
1774
1775DEFINE_DEBUG_BOOL(dump_wasm_module, false, "dump wasm module bytes")
1776DEFINE_STRING(dump_wasm_module_path, nullptr,
1777 "directory to dump wasm modules to")
1779 wasm_fast_api,
1780 "Enable direct calls from wasm to fast API functions with bound "
1781 "call function to pass the the receiver as first parameter")
1782
1783DEFINE_BOOL(wasm_deopt, false, "enable deopts in optimized wasm functions")
1784DEFINE_WEAK_IMPLICATION(future, wasm_deopt)
1785// Deopt only works in combination with feedback.
1786DEFINE_NEG_NEG_IMPLICATION(liftoff, wasm_deopt)
1787
1788// Note that this limit doesn't guarantee an upper bound, as e.g. with multiple
1789// frames of the same function on the stack, many more deopts can happen.
1790DEFINE_SIZE_T(wasm_deopts_per_function_limit, 50,
1791 "limit of wasm deopts for a single function after which no "
1792 "further deopt points are emitted in Turbofan")
1793
1794// Declare command-line flags for Wasm features. Warning: avoid using these
1795// flags directly in the implementation. Instead accept
1796// wasm::WasmEnabledFeatures for configurability.
1797#include "src/wasm/wasm-feature-flags.h"
1798
1799#define DECL_WASM_FLAG(feat, desc, val) \
1800 DEFINE_BOOL(experimental_wasm_##feat, val, "enable " desc " for Wasm")
1801#define DECL_EXPERIMENTAL_WASM_FLAG(feat, desc, val) \
1802 DEFINE_EXPERIMENTAL_FEATURE(experimental_wasm_##feat, \
1803 "enable " desc " for Wasm")
1804// Experimental wasm features imply --experimental and get the " (experimental)"
1805// suffix.
1806FOREACH_WASM_EXPERIMENTAL_FEATURE_FLAG(DECL_EXPERIMENTAL_WASM_FLAG)
1807// Staging and shipped features do not imply --experimental.
1810#undef DECL_WASM_FLAG
1811#undef DECL_EXPERIMENTAL_WASM_FLAG
1812
1813DEFINE_IMPLICATION(experimental_wasm_stack_switching, experimental_wasm_jspi)
1814
1815DEFINE_IMPLICATION(experimental_wasm_growable_stacks, experimental_wasm_jspi)
1816
1817DEFINE_IMPLICATION(experimental_wasm_imported_strings_utf8,
1818 experimental_wasm_imported_strings)
1819
1820// Unsafe additions to the GC proposal for performance experiments.
1822 experimental_wasm_assume_ref_cast_succeeds,
1823 "assume ref.cast always succeeds and skip the related type check (unsafe)")
1824DEFINE_EXPERIMENTAL_FEATURE(experimental_wasm_ref_cast_nop,
1825 "enable unsafe ref.cast_nop instruction")
1827 experimental_wasm_skip_null_checks,
1828 "skip null checks for call.ref and array and struct operations (unsafe)")
1829DEFINE_EXPERIMENTAL_FEATURE(experimental_wasm_skip_bounds_checks,
1830 "skip array bounds checks (unsafe)")
1831
1832DEFINE_BOOL(wasm_staging, false, "enable staged wasm features")
1833
1834#define WASM_STAGING_IMPLICATION(feat, desc, val) \
1835 DEFINE_IMPLICATION(wasm_staging, experimental_wasm_##feat)
1836FOREACH_WASM_STAGING_FEATURE_FLAG(WASM_STAGING_IMPLICATION)
1837#undef WASM_STAGING_IMPLICATION
1838
1839DEFINE_DEBUG_BOOL(wasm_opt, true, "enable wasm optimization")
1840DEFINE_BOOL(wasm_bounds_checks, true,
1841 "enable bounds checks (disable for performance testing only)")
1842DEFINE_BOOL(wasm_stack_checks, true,
1843 "enable stack checks (disable for performance testing only)")
1845 wasm_enforce_bounds_checks, false,
1846 "enforce explicit bounds check even if the trap handler is available")
1847// "no bounds checks" implies "no enforced bounds checks".
1848DEFINE_NEG_NEG_IMPLICATION(wasm_bounds_checks, wasm_enforce_bounds_checks)
1849DEFINE_BOOL(wasm_math_intrinsics, true,
1850 "intrinsify some Math imports into wasm")
1851
1852DEFINE_BOOL(wasm_inlining_call_indirect, false,
1853 "enable speculative inlining of Wasm indirect calls")
1854DEFINE_WEAK_IMPLICATION(future, wasm_inlining_call_indirect)
1855// This doesn't make sense without and requires the basic inlining machinery,
1856// e.g., for allocating feedback vectors, so we automatically enable it.
1857DEFINE_IMPLICATION(wasm_inlining_call_indirect, wasm_inlining)
1858
1859DEFINE_BOOL(wasm_inlining, true,
1860 "enable inlining of Wasm functions into Wasm functions")
1861DEFINE_SIZE_T(wasm_inlining_budget, 5000,
1862 "maximum graph size (in TF nodes) that allows inlining more")
1863DEFINE_SIZE_T(wasm_inlining_max_size, 500,
1864 "maximum function size (in wire bytes) that may be inlined")
1866 wasm_inlining_factor, 3,
1867 "maximum multiple graph size (in TF nodes) in comparison to initial size")
1868DEFINE_SIZE_T(wasm_inlining_min_budget, 50,
1869 "minimum graph size budget (in TF nodes) for which the "
1870 "wasm_inlinining_factor does not apply")
1871DEFINE_BOOL(wasm_inlining_ignore_call_counts, false,
1872 "Ignore call counts when considering inlining candidates. The flag "
1873 "is supposed to be used for fuzzing")
1874DEFINE_BOOL(trace_wasm_inlining, false, "trace wasm inlining")
1875DEFINE_BOOL(trace_wasm_typer, false, "trace wasm typer")
1876
1877DEFINE_BOOL(wasm_loop_unrolling, true,
1878 "enable loop unrolling for wasm functions")
1879DEFINE_BOOL(wasm_loop_peeling, true, "enable loop peeling for wasm functions")
1880DEFINE_SIZE_T(wasm_loop_peeling_max_size, 1000, "maximum size for peeling")
1881DEFINE_BOOL(trace_wasm_loop_peeling, false, "trace wasm loop peeling")
1882DEFINE_BOOL(wasm_fuzzer_gen_test, false,
1883 "generate a test case when running a wasm fuzzer")
1884DEFINE_IMPLICATION(wasm_fuzzer_gen_test, single_threaded)
1885DEFINE_BOOL(print_wasm_code, false, "print WebAssembly code")
1886DEFINE_INT(print_wasm_code_function_index, -1,
1887 "print WebAssembly code for function at index")
1888DEFINE_BOOL(print_wasm_stub_code, false, "print WebAssembly stub code")
1889DEFINE_BOOL(asm_wasm_lazy_compilation, true,
1890 "enable lazy compilation for asm.js translated to wasm (see "
1891 "--validate-asm)")
1892DEFINE_BOOL(wasm_lazy_compilation, true,
1893 "enable lazy compilation for all wasm modules")
1894DEFINE_DEBUG_BOOL(trace_wasm_lazy_compilation, false,
1895 "trace lazy compilation of wasm functions")
1897 wasm_lazy_validation,
1898 "enable lazy validation for lazily compiled wasm functions")
1899DEFINE_WEAK_IMPLICATION(wasm_lazy_validation, wasm_lazy_compilation)
1900DEFINE_BOOL(wasm_simd_ssse3_codegen, false, "allow wasm SIMD SSSE3 codegen")
1901
1902DEFINE_BOOL(wasm_code_gc, true, "enable garbage collection of wasm code")
1903DEFINE_BOOL(trace_wasm_code_gc, false, "trace garbage collection of wasm code")
1904DEFINE_BOOL(stress_wasm_code_gc, false,
1905 "stress test garbage collection of wasm code")
1906DEFINE_INT(wasm_max_initial_code_space_reservation, 0,
1907 "maximum size of the initial wasm code space reservation (in MB)")
1908DEFINE_BOOL(stress_wasm_memory_moving, false,
1909 "always move non-shared bounds-checked Wasm memory on grow")
1910DEFINE_BOOL(flush_liftoff_code, true,
1911 "enable flushing liftoff code on memory pressure signal")
1912DEFINE_BOOL(stress_branch_hinting, false,
1913 "stress branch hinting by generating a random hint for each branch "
1914 "instruction")
1915DEFINE_WEAK_IMPLICATION(fuzzing, stress_branch_hinting)
1916
1917DEFINE_SIZE_T(wasm_max_module_size, wasm::kV8MaxWasmModuleSize,
1918 "maximum allowed size of wasm modules")
1919DEFINE_SIZE_T(wasm_disassembly_max_mb, 1000,
1920 "maximum size of produced disassembly (in MB, approximate)")
1921
1922DEFINE_INT(wasm_capi_thread_pool_size, 0,
1923 "size of the thread pool used by the wasm C API, with 0 meaning the "
1924 "maximum number of threads")
1925
1926DEFINE_BOOL(trace_wasm, false, "trace wasm function calls")
1927// Inlining breaks --trace-wasm, hence disable that if --trace-wasm is enabled.
1928// TODO(40898108,mliedtke,manoskouk): We should fix this; now that inlining is
1929// enabled by default, one cannot trace the production configuration anymore.
1930DEFINE_NEG_IMPLICATION(trace_wasm, wasm_inlining)
1931
1932// Flags for Wasm GDB remote debugging.
1933#ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
1934#define DEFAULT_WASM_GDB_REMOTE_PORT 8765
1935DEFINE_BOOL(wasm_gdb_remote, false,
1936 "enable GDB-remote for WebAssembly debugging")
1937DEFINE_NEG_IMPLICATION(wasm_gdb_remote, wasm_tier_up)
1938DEFINE_INT(wasm_gdb_remote_port, DEFAULT_WASM_GDB_REMOTE_PORT,
1939 "default port for WebAssembly debugging with LLDB.")
1940DEFINE_BOOL(wasm_pause_waiting_for_debugger, false,
1941 "pause at the first Webassembly instruction waiting for a debugger "
1942 "to attach")
1943DEFINE_BOOL(trace_wasm_gdb_remote, false, "trace Webassembly GDB-remote server")
1944#endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
1945
1946// wasm instance management
1947DEFINE_DEBUG_BOOL(trace_wasm_instances, false,
1948 "trace creation and collection of wasm instances")
1949
1950// Flags for WASM SIMD256 revectorize
1951#ifdef V8_ENABLE_WASM_SIMD256_REVEC
1953 experimental_wasm_revectorize,
1954 "enable 128 to 256 bit revectorization for Webassembly SIMD")
1955DEFINE_BOOL(trace_wasm_revectorize, false, "trace wasm revectorize")
1956#endif // V8_ENABLE_WASM_SIMD256_REVEC
1957
1958#if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64
1959DEFINE_BOOL(wasm_memory64_trap_handling, true,
1960 "Use trap handling for Wasm memory64 bounds checks")
1961#else
1962DEFINE_BOOL_READONLY(wasm_memory64_trap_handling, false,
1963 "Use trap handling for Wasm memory64 bounds checks (not "
1964 "supported for this architecture)")
1965#endif // V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64
1966
1967#ifdef V8_ENABLE_DRUMBRAKE
1968// DrumBrake flags.
1969DEFINE_EXPERIMENTAL_FEATURE(wasm_jitless,
1970 "Execute all wasm code in the Wasm interpreter")
1971DEFINE_BOOL(wasm_jitless_if_available_for_testing, false,
1972 "Enables the Wasm interpreter, for testing, but only if "
1973 "the 'v8_enable_drumbrake' flag is set.")
1974DEFINE_IMPLICATION(wasm_jitless_if_available_for_testing, wasm_jitless)
1975
1976DEFINE_BOOL(drumbrake_compact_bytecode, false,
1977 "Compress the Wasm interpreter bytecode")
1978DEFINE_BOOL(trace_drumbrake_compact_bytecode, false,
1979 "Traces the Wasm interpreter compact bytecode")
1980DEFINE_BOOL(drumbrake_fuzzer_timeout, false,
1981 "enable timeout for wasm fuzzer (for testing)")
1982DEFINE_SIZE_T(drumbrake_fuzzer_timeout_limit_ms, 250,
1983 "timeout for wasm fuzzer (in ms)")
1984#ifdef V8_ENABLE_DRUMBRAKE_TRACING
1985DEFINE_BOOL(trace_drumbrake_bytecode_generator, false,
1986 "trace drumbrake generation of interpreter bytecode")
1987DEFINE_BOOL(trace_drumbrake_execution, false,
1988 "trace drumbrake execution of wasm code")
1989DEFINE_BOOL(trace_drumbrake_execution_verbose, false,
1990 "print more information for the drumbrake execution of wasm code")
1991DEFINE_IMPLICATION(trace_drumbrake_execution_verbose, trace_drumbrake_execution)
1992DEFINE_BOOL(redirect_drumbrake_traces, false,
1993 "write drumbrake traces into file <pid>-<isolate id>.dbt")
1995 trace_drumbrake_filter, "*",
1996 "filter for selecting which wasm functions to trace in the interpreter")
1997#endif // V8_ENABLE_DRUMBRAKE_TRACING
1998DEFINE_BOOL(drumbrake_super_instructions, true,
1999 "enable drumbrake merged wasm instructions optimization")
2000DEFINE_BOOL(drumbrake_register_optimization, true,
2001 "enable passing the top stack value in a register in drumbrake")
2002
2003// Directly interpret asm.js code as regular JavaScript code, instead of
2004// translating it to Wasm bytecode first and then interpreting that with
2005// DrumBrake. (validate_asm=false turns off asm.js to Wasm compilation.)
2006DEFINE_NEG_IMPLICATION(wasm_jitless, validate_asm)
2007
2008// --wasm-jitless resets {asm-,}wasm-lazy-compilation.
2009DEFINE_NEG_IMPLICATION(wasm_jitless, asm_wasm_lazy_compilation)
2010DEFINE_NEG_IMPLICATION(wasm_jitless, wasm_lazy_compilation)
2011DEFINE_NEG_IMPLICATION(wasm_jitless, wasm_lazy_validation)
2012DEFINE_NEG_IMPLICATION(wasm_jitless, wasm_tier_up)
2013
2014// --wasm-enable-exec-time-histograms works both in jitted and jitless mode
2015// and enables histogram V8.Jit[less]WasmExecutionPercentage, which measures
2016// the percentage of time spent running Wasm code. Note that generating samples
2017// for this metric causes a small performance degradation, and requires setting
2018// the additional flag --slow-histograms.
2019DEFINE_BOOL(wasm_enable_exec_time_histograms, false,
2020 "enables histograms that track the time spent executing Wasm code")
2021DEFINE_INT(wasm_exec_time_histogram_sample_duration, 1000,
2022 "sample duration for V8.Jit[less]WasmExecutionPercentage, in msec")
2023DEFINE_INT(wasm_exec_time_histogram_sample_period, 4000,
2024 "sample period for V8.Jit[less]WasmExecutionPercentage, in msec")
2025DEFINE_INT(wasm_exec_time_histogram_slow_threshold, 10000,
2026 "V8.Jit[less]WasmExecutionPercentage threshold used to detect "
2027 "Wasm-intensive workloads (0-100000)")
2028DEFINE_INT(wasm_exec_time_slow_threshold_samples_count, 1,
2029 "number of V8.Jit[less]WasmExecutionPercentage samples used to "
2030 "calculate the threshold for the V8.Jit[less]WasmExecutionTooSlow "
2031 "histogram")
2032DEFINE_IMPLICATION(wasm_enable_exec_time_histograms, slow_histograms)
2033DEFINE_NEG_IMPLICATION(wasm_enable_exec_time_histograms,
2034 turbo_inline_js_wasm_calls)
2035DEFINE_NEG_IMPLICATION(wasm_enable_exec_time_histograms, wasm_generic_wrapper)
2036#else // V8_ENABLE_DRUMBRAKE
2037DEFINE_BOOL_READONLY(wasm_jitless, false,
2038 "execute all Wasm code in the Wasm interpreter")
2039DEFINE_BOOL(wasm_jitless_if_available_for_testing, false, "")
2040#endif // V8_ENABLE_DRUMBRAKE
2041
2042#endif // V8_ENABLE_WEBASSEMBLY
2043
2044DEFINE_INT(stress_sampling_allocation_profiler, 0,
2045 "Enables sampling allocation profiler with X as a sample interval")
2046
2047// Garbage collections flags.
2048DEFINE_BOOL(lazy_new_space_shrinking, false,
2049 "Enables the lazy new space shrinking strategy")
2050DEFINE_SIZE_T(min_semi_space_size, 0,
2051 "min size of a semi-space (in MBytes), the new space consists of "
2052 "two semi-spaces")
2053DEFINE_SIZE_T(max_semi_space_size, 0,
2054 "max size of a semi-space (in MBytes), the new space consists of "
2055 "two semi-spaces")
2056DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
2057// Set minimum semi space growth factor
2058DEFINE_MIN_VALUE_IMPLICATION(semi_space_growth_factor, 2)
2059DEFINE_SIZE_T(max_old_space_size, 0, "max size of the old space (in Mbytes)")
2061 max_heap_size, 0,
2062 "max size of the heap (in Mbytes) "
2063 "both max_semi_space_size and max_old_space_size take precedence. "
2064 "All three flags cannot be specified at the same time.")
2065DEFINE_SIZE_T(initial_heap_size, 0, "initial size of the heap (in Mbytes)")
2066DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)")
2067DEFINE_BOOL(gc_global, false, "always perform global GCs")
2068
2069// TODO(12950): The next three flags only have an effect if
2070// V8_ENABLE_ALLOCATION_TIMEOUT is set, so we should only define them in that
2071// config. That currently breaks Node's parallel/test-domain-error-types test
2072// though.
2073DEFINE_INT(random_gc_interval, 0,
2074 "Collect garbage after random(0, X) V8 allocations. It overrides "
2075 "gc_interval.")
2076DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
2077DEFINE_INT(cppgc_random_gc_interval, 0,
2078 "Collect garbage after random(0, X) cppgc allocations.")
2079
2080DEFINE_INT(retain_maps_for_n_gc, 2,
2081 "keeps maps alive for <n> old space garbage collections")
2082DEFINE_BOOL(trace_gc, false,
2083 "print one trace line following each garbage collection")
2084DEFINE_BOOL(trace_gc_nvp, false,
2085 "print one detailed trace line in name=value format "
2086 "after each garbage collection")
2087DEFINE_BOOL(trace_gc_ignore_scavenger, false,
2088 "do not print trace line after scavenger collection")
2089DEFINE_BOOL(trace_memory_reducer, false, "print memory reducer behavior")
2090DEFINE_BOOL(trace_gc_verbose, false,
2091 "print more details following each garbage collection")
2092DEFINE_IMPLICATION(trace_gc_verbose, trace_gc)
2093DEFINE_BOOL(trace_gc_freelists, false,
2094 "prints details of each freelist before and after "
2095 "each major garbage collection")
2096DEFINE_BOOL(trace_gc_freelists_verbose, false,
2097 "prints details of freelists of each page before and after "
2098 "each major garbage collection")
2099DEFINE_IMPLICATION(trace_gc_freelists_verbose, trace_gc_freelists)
2100DEFINE_BOOL(trace_gc_heap_layout, false,
2101 "print layout of pages in heap before and after gc")
2102DEFINE_BOOL(trace_gc_heap_layout_ignore_minor_gc, true,
2103 "do not print trace line before and after minor-gc")
2104DEFINE_BOOL(trace_evacuation_candidates, false,
2105 "Show statistics about the pages evacuation by the compaction")
2106
2107DEFINE_BOOL(trace_pending_allocations, false,
2108 "trace calls to Heap::IsAllocationPending that return true")
2109
2110DEFINE_INT(trace_allocation_stack_interval, -1,
2111 "print stack trace after <n> free-list allocations")
2112DEFINE_INT(trace_duplicate_threshold_kb, 0,
2113 "print duplicate objects in the heap if their size is more than "
2114 "given threshold")
2115DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space")
2116DEFINE_BOOL(trace_fragmentation_verbose, false,
2117 "report fragmentation for old space (detailed)")
2118DEFINE_BOOL(minor_ms_trace_fragmentation, false,
2119 "trace fragmentation after marking")
2120DEFINE_BOOL(trace_evacuation, false, "report evacuation statistics")
2121DEFINE_BOOL(trace_mutator_utilization, false,
2122 "print mutator utilization, allocation speed, gc speed")
2123DEFINE_BOOL(incremental_marking, true, "use incremental marking")
2124DEFINE_BOOL(incremental_marking_task, true, "use tasks for incremental marking")
2125DEFINE_BOOL(incremental_marking_start_user_visible, true,
2126 "Starts incremental marking with kUserVisible priority.")
2127DEFINE_INT(incremental_marking_soft_trigger, 0,
2128 "threshold for starting incremental marking via a task in percent "
2129 "of available space: limit - size")
2130DEFINE_INT(incremental_marking_hard_trigger, 0,
2131 "threshold for starting incremental marking immediately in percent "
2132 "of available space: limit - size")
2133DEFINE_BOOL(incremental_marking_unified_schedule, false,
2134 "Use a single schedule for determining a marking schedule between "
2135 "JS and C++ objects.")
2136DEFINE_BOOL(trace_unmapper, false, "Trace the unmapping")
2137DEFINE_BOOL(parallel_scavenge, true, "parallel scavenge")
2138DEFINE_BOOL(minor_gc_task, true, "schedule minor GC tasks")
2139DEFINE_UINT(minor_gc_task_trigger, 80,
2140 "minor GC task trigger in percent of the current heap limit")
2141DEFINE_BOOL(minor_gc_task_with_lower_priority, true,
2142 "schedules the minor GC task with kUserVisible priority.")
2143DEFINE_BOOL(trace_parallel_scavenge, false, "trace parallel scavenge")
2145 cppgc_young_generation,
2146 "run young generation garbage collections in Oilpan")
2147// CppGC young generation (enables unified young heap) is based on Minor MS.
2148DEFINE_IMPLICATION(cppgc_young_generation, minor_ms)
2149// Unified young generation disables the unmodified wrapper reclamation
2150// optimization.
2151DEFINE_NEG_IMPLICATION(cppgc_young_generation, reclaim_unmodified_wrappers)
2152DEFINE_BOOL(optimize_gc_for_battery, false, "optimize GC for battery")
2153#if defined(V8_ATOMIC_OBJECT_FIELD_WRITES)
2154DEFINE_BOOL(concurrent_marking, true, "use concurrent marking")
2155#else
2156// Concurrent marking cannot be used without atomic object field loads and
2157// stores.
2158DEFINE_BOOL(concurrent_marking, false, "use concurrent marking")
2159#endif
2161 concurrent_marking_max_worker_num, 7,
2162 "max worker number of concurrent marking, 0 for NumberOfWorkerThreads")
2163DEFINE_BOOL(concurrent_array_buffer_sweeping, true,
2164 "concurrently sweep array buffers")
2165DEFINE_BOOL(stress_concurrent_allocation, false,
2166 "start background threads that allocate memory")
2167DEFINE_BOOL(parallel_marking, true, "use parallel marking in atomic pause")
2168DEFINE_INT(ephemeron_fixpoint_iterations, 10,
2169 "number of fixpoint iterations it takes to switch to linear "
2170 "ephemeron algorithm")
2171DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking")
2172DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
2173DEFINE_NEG_NEG_IMPLICATION(concurrent_sweeping,
2174 concurrent_array_buffer_sweeping)
2175DEFINE_BOOL(parallel_compaction, true, "use parallel compaction")
2176DEFINE_BOOL(parallel_pointer_update, true,
2177 "use parallel pointer update during compaction")
2178DEFINE_BOOL(parallel_weak_ref_clearing, true,
2179 "use parallel threads to clear weak refs in the atomic pause.")
2180DEFINE_BOOL(detect_ineffective_gcs_near_heap_limit, true,
2181 "trigger out-of-memory failure to avoid GC storm near heap limit")
2182DEFINE_BOOL(trace_incremental_marking, false,
2183 "trace progress of the incremental marking")
2184DEFINE_BOOL(trace_stress_marking, false, "trace stress marking progress")
2185DEFINE_BOOL(trace_stress_scavenge, false, "trace stress scavenge progress")
2186DEFINE_BOOL(track_gc_object_stats, false,
2187 "track object counts and memory usage")
2188DEFINE_BOOL(trace_gc_object_stats, false,
2189 "trace object counts and memory usage")
2190DEFINE_BOOL(trace_zone_stats, false, "trace zone memory usage")
2192 trace_zone_stats,
2193 TracingFlags::zone_stats.store(
2194 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
2196 zone_stats_tolerance, 1 * MB,
2197 "report a tick only when allocated zone memory changes by this amount")
2198DEFINE_BOOL(trace_zone_type_stats, false, "trace per-type zone memory usage")
2200 trace_zone_type_stats,
2201 TracingFlags::zone_stats.store(
2202 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
2203DEFINE_DEBUG_BOOL(trace_backing_store, false, "trace backing store events")
2204DEFINE_INT(gc_stats, 0, "Used by tracing internally to enable gc statistics")
2205DEFINE_IMPLICATION(trace_gc_object_stats, track_gc_object_stats)
2207 track_gc_object_stats,
2208 TracingFlags::gc_stats.store(
2209 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
2211 trace_gc_object_stats,
2212 TracingFlags::gc_stats.store(
2213 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
2214DEFINE_NEG_IMPLICATION(trace_gc_object_stats, incremental_marking)
2215DEFINE_NEG_NEG_IMPLICATION(incremental_marking, concurrent_marking)
2216DEFINE_NEG_NEG_IMPLICATION(parallel_marking, concurrent_marking)
2217DEFINE_IMPLICATION(concurrent_marking, incremental_marking)
2218DEFINE_BOOL(track_detached_contexts, true,
2219 "track native contexts that are expected to be garbage collected")
2220DEFINE_BOOL(trace_detached_contexts, false,
2221 "trace native contexts that are expected to be garbage collected")
2222DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts)
2223#ifdef VERIFY_HEAP
2224DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC")
2225DEFINE_BOOL(verify_heap_skip_remembered_set, false,
2226 "disable remembered set verification")
2227#else
2228DEFINE_BOOL_READONLY(verify_heap, false,
2229 "verify heap pointers before and after GC")
2230#endif
2231#if V8_OS_DARWIN
2232DEFINE_BOOL(safepoint_bump_qos_class, false,
2233 "Bump QOS class for running threads to reach safepoint")
2234#endif
2235DEFINE_BOOL(memory_reducer_respects_frozen_state, false,
2236 "don't schedule another GC when we are frozen")
2237DEFINE_BOOL(move_object_start, true, "enable moving of object starts")
2238DEFINE_BOOL(memory_reducer, true, "use memory reducer")
2239DEFINE_BOOL(memory_reducer_favors_memory, true,
2240 "memory reducer runs GC with ReduceMemoryFootprint flag")
2241DEFINE_BOOL(memory_reducer_for_small_heaps, true,
2242 "use memory reducer for small heaps")
2243DEFINE_INT(memory_reducer_gc_count, 2,
2244 "Maximum number of memory reducer GCs scheduled")
2246 external_memory_accounted_in_global_limit, false,
2247 "External memory limits are computed as part of global limits in v8 Heap.")
2248DEFINE_BOOL(gc_speed_uses_counters, false,
2249 "Old gen GC speed is computed directly from gc tracer counters.")
2250DEFINE_INT(heap_growing_percent, 0,
2251 "specifies heap growing factor as (1 + heap_growing_percent/100)")
2252DEFINE_INT(v8_os_page_size, 0, "override OS page size (in KBytes)")
2253DEFINE_BOOL(allocation_buffer_parking, true, "allocation buffer parking")
2254DEFINE_BOOL(compact, true,
2255 "Perform compaction on full GCs based on V8's default heuristics")
2256DEFINE_BOOL(compact_code_space, true,
2257 "Perform code space compaction on full collections.")
2258DEFINE_BOOL(compact_on_every_full_gc, false,
2259 "Perform compaction on every full GC")
2260DEFINE_BOOL(compact_with_stack, true,
2261 "Perform compaction when finalizing a full GC with stack")
2263 compact_code_space_with_stack, true,
2264 "Perform code space compaction when finalizing a full GC with stack")
2265// Disabling compaction with stack implies also disabling code space compaction
2266// with stack.
2267DEFINE_NEG_NEG_IMPLICATION(compact_with_stack, compact_code_space_with_stack)
2268DEFINE_BOOL(shortcut_strings_with_stack, true,
2269 "Shortcut Strings during GC with stack")
2270DEFINE_BOOL(stress_compaction, false,
2271 "Stress GC compaction to flush out bugs with moving objects")
2272DEFINE_BOOL(stress_compaction_random, false,
2273 "Stress GC compaction by selecting random percent of pages as "
2274 "evacuation candidates. Overrides stress_compaction.")
2275DEFINE_IMPLICATION(stress_compaction, gc_global)
2276DEFINE_VALUE_IMPLICATION(stress_compaction, max_semi_space_size, (size_t)1)
2277DEFINE_BOOL(flush_baseline_code, false,
2278 "flush of baseline code when it has not been executed recently")
2279DEFINE_BOOL(flush_bytecode, true,
2280 "flush of bytecode when it has not been executed recently")
2281DEFINE_INT(bytecode_old_age, 6, "number of gcs before we flush code")
2282DEFINE_BOOL(flush_code_based_on_time, false,
2283 "Use time-base code flushing instead of age.")
2284DEFINE_BOOL(flush_code_based_on_tab_visibility, false,
2285 "Flush code when tab goes into the background.")
2286DEFINE_INT(bytecode_old_time, 30, "number of seconds before we flush code")
2287DEFINE_BOOL(stress_flush_code, false, "stress code flushing")
2288DEFINE_BOOL(trace_flush_code, false, "trace bytecode flushing")
2289DEFINE_BOOL(use_marking_progress_bar, true,
2290 "Use a progress bar to scan large objects in increments when "
2291 "incremental marking is active.")
2292DEFINE_BOOL(stress_per_context_marking_worklist, false,
2293 "Use per-context worklist for marking")
2294DEFINE_BOOL(stress_incremental_marking, false,
2295 "force incremental marking for small heaps and run it more often")
2296
2297DEFINE_BOOL(fuzzer_gc_analysis, false,
2298 "prints number of allocations and enables analysis mode for gc "
2299 "fuzz testing, e.g. --stress-marking, --stress-scavenge")
2300DEFINE_INT(stress_marking, 0,
2301 "force marking at random points between 0 and X (inclusive) percent "
2302 "of the regular marking start limit")
2303DEFINE_INT(stress_scavenge, 0,
2304 "force scavenge at random points between 0 and X (inclusive) "
2305 "percent of the new space capacity")
2306DEFINE_VALUE_IMPLICATION(fuzzer_gc_analysis, stress_marking, 99)
2307DEFINE_VALUE_IMPLICATION(fuzzer_gc_analysis, stress_scavenge, 99)
2309 reclaim_unmodified_wrappers, true,
2310 "reclaim otherwise unreachable unmodified wrapper objects when possible")
2311DEFINE_BOOL(parallel_reclaim_unmodified_wrappers, true,
2312 "reclaim wrapper objects in parallel")
2313
2314// These flags will be removed after experiments. Do not rely on them.
2315DEFINE_BOOL(gc_experiment_less_compaction, false,
2316 "less compaction in non-memory reducing mode")
2317
2318DEFINE_INT(gc_memory_reducer_start_delay_ms, 8000,
2319 "Delay before memory reducer start")
2320
2321DEFINE_BOOL(concurrent_marking_high_priority_threads, false,
2322 "use high priority threads for concurrent Marking")
2323
2324DEFINE_BOOL(disable_abortjs, false, "disables AbortJS runtime function")
2325
2326DEFINE_BOOL(randomize_all_allocations, false,
2327 "randomize virtual memory reservations by ignoring any hints "
2328 "passed when allocating pages")
2329
2330DEFINE_BOOL(manual_evacuation_candidates_selection, false,
2331 "Test mode only flag. It allows an unit test to select evacuation "
2332 "candidates pages (requires --stress_compaction).")
2333
2334DEFINE_BOOL(clear_free_memory, false, "initialize free memory with 0")
2335
2336DEFINE_BOOL(idle_gc_on_context_disposal, true, "idle gc on context disposal")
2337
2338DEFINE_BOOL(trace_context_disposal, false, "trace context disposal")
2339
2340// v8::CppHeap flags that allow fine-grained control of how C++ memory is
2341// reclaimed in the garbage collector.
2342DEFINE_BOOL(cppheap_incremental_marking, false,
2343 "use incremental marking for CppHeap")
2344DEFINE_NEG_NEG_IMPLICATION(incremental_marking, cppheap_incremental_marking)
2345DEFINE_NEG_NEG_IMPLICATION(incremental_marking, memory_reducer)
2346DEFINE_WEAK_IMPLICATION(incremental_marking, cppheap_incremental_marking)
2347DEFINE_BOOL(cppheap_concurrent_marking, false,
2348 "use concurrent marking for CppHeap")
2349DEFINE_NEG_NEG_IMPLICATION(cppheap_incremental_marking,
2350 cppheap_concurrent_marking)
2351DEFINE_NEG_NEG_IMPLICATION(concurrent_marking, cppheap_concurrent_marking)
2352DEFINE_WEAK_IMPLICATION(concurrent_marking, cppheap_concurrent_marking)
2353
2354DEFINE_BOOL(memory_balancer, false,
2355 "use membalancer, "
2356 "a new heap limit balancing algorithm")
2357DEFINE_FLOAT(memory_balancer_c_value, 3e-10,
2358 "c value for membalancer. "
2359 "A special constant to balance between memory and space tradeoff. "
2360 "The smaller the more memory it uses.")
2361DEFINE_NEG_IMPLICATION(memory_balancer, memory_reducer)
2362DEFINE_BOOL(trace_memory_balancer, false, "print memory balancer behavior.")
2363
2364// assembler-ia32.cc / assembler-arm.cc / assembler-arm64.cc / assembler-x64.cc
2365#ifdef V8_ENABLE_DEBUG_CODE
2366DEFINE_BOOL(debug_code, DEBUG_BOOL,
2367 "generate extra code (assertions) for debugging")
2368DEFINE_BOOL(trap_on_abort, false, "trap instead of calling abort for debugging")
2369#if defined(V8_ENABLE_SLOW_DEBUG_CODE_BY_DEFAULT) || \
2370 defined(ENABLE_SLOW_DCHECKS)
2371#define V8_ENABLE_SLOW_DEBUG_CODE_BY_DEFAULT_BOOL true
2372#else
2373#define V8_ENABLE_SLOW_DEBUG_CODE_BY_DEFAULT_BOOL false
2374#endif
2375// slow_debug_code is enabled by default for builds with is_debug or
2376// v8_enable_slow_dchecks.
2377DEFINE_BOOL(slow_debug_code, V8_ENABLE_SLOW_DEBUG_CODE_BY_DEFAULT_BOOL,
2378 "generate slow extra code (assertions) for debugging")
2379DEFINE_NEG_NEG_IMPLICATION(debug_code, slow_debug_code)
2380#else
2381DEFINE_BOOL_READONLY(debug_code, false, "")
2382DEFINE_BOOL_READONLY(trap_on_abort, true, "")
2383DEFINE_BOOL_READONLY(slow_debug_code, false, "")
2384#endif
2385#ifdef V8_CODE_COMMENTS
2386DEFINE_BOOL(code_comments, false,
2387 "emit comments in code disassembly; for more readable source "
2388 "positions you should add --no-concurrent_recompilation")
2389#else
2390DEFINE_BOOL_READONLY(code_comments, false, "")
2391#endif
2392DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available")
2393DEFINE_BOOL(enable_ssse3, true, "enable use of SSSE3 instructions if available")
2394DEFINE_BOOL(enable_sse4_1, true,
2395 "enable use of SSE4.1 instructions if available")
2396DEFINE_BOOL(enable_sse4_2, true,
2397 "enable use of SSE4.2 instructions if available")
2398DEFINE_BOOL(enable_sahf, true,
2399 "enable use of SAHF instruction if available (X64 only)")
2400DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available")
2401DEFINE_BOOL(enable_avx2, true, "enable use of AVX2 instructions if available")
2402DEFINE_BOOL(enable_avx_vnni, true,
2403 "enable use of AVX-VNNI instructions if available")
2404DEFINE_BOOL(enable_avx_vnni_int8, true,
2405 "enable use of AVX-VNNI-INT8 instructions if available")
2406DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available")
2407DEFINE_BOOL(enable_f16c, true, "enable use of F16C instructions if available")
2408DEFINE_BOOL(enable_bmi1, true, "enable use of BMI1 instructions if available")
2409DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available")
2410DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available")
2411DEFINE_BOOL(enable_popcnt, true,
2412 "enable use of POPCNT instruction if available")
2414 "generate instructions for the selected ARM architecture if "
2415 "available: armv6, armv7, armv7+sudiv or armv8")
2416DEFINE_BOOL(force_long_branches, false,
2417 "force all emitted branches to be in long mode (MIPS/PPC only)")
2418DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu")
2419DEFINE_BOOL(partial_constant_pool, true,
2420 "enable use of partial constant pools (x64 only)")
2421DEFINE_STRING(sim_arm64_optional_features, "none",
2422 "enable optional features on the simulator for testing: none or "
2423 "all")
2424DEFINE_BOOL(intel_jcc_erratum_mitigation, true,
2425 "enable mitigation for Intel JCC erratum on affected CPUs")
2426
2427#if defined(V8_TARGET_ARCH_RISCV32) || defined(V8_TARGET_ARCH_RISCV64)
2428DEFINE_BOOL(riscv_trap_to_simulator_debugger, false,
2429 "enable simulator trap to debugger")
2430DEFINE_BOOL(riscv_debug, false, "enable debug prints")
2431
2432DEFINE_BOOL(riscv_constant_pool, true, "enable constant pool (RISCV only)")
2433
2434DEFINE_BOOL(riscv_c_extension, false,
2435 "enable compressed extension isa variant (RISCV only)")
2436DEFINE_BOOL(riscv_b_extension, false,
2437 "enable B extension isa variant (RISCV only)")
2439 use_aliases, true,
2440 "use aliases for instruction mnemonics when printing code (RISCV only)")
2441#endif
2442
2443// Controlling source positions for Torque/CSA code.
2444DEFINE_BOOL(enable_source_at_csa_bind, false,
2445 "Include source information in the binary at CSA bind locations.")
2446
2447// Deprecated ARM flags (replaced by arm_arch).
2448DEFINE_MAYBE_BOOL(enable_armv7, "deprecated (use --arm_arch instead)")
2449DEFINE_MAYBE_BOOL(enable_vfp3, "deprecated (use --arm_arch instead)")
2450DEFINE_MAYBE_BOOL(enable_32dregs, "deprecated (use --arm_arch instead)")
2451DEFINE_MAYBE_BOOL(enable_neon, "deprecated (use --arm_arch instead)")
2452DEFINE_MAYBE_BOOL(enable_sudiv, "deprecated (use --arm_arch instead)")
2453DEFINE_MAYBE_BOOL(enable_armv8, "deprecated (use --arm_arch instead)")
2454
2455// regexp-macro-assembler-*.cc
2456DEFINE_BOOL(enable_regexp_unaligned_accesses, true,
2457 "enable unaligned accesses for the regexp engine")
2458
2459// api.cc
2460DEFINE_BOOL(script_streaming, true, "enable parsing on background")
2461DEFINE_BOOL(stress_background_compile, false,
2462 "stress test parsing on background")
2463DEFINE_BOOL(concurrent_cache_deserialization, true,
2464 "enable deserializing code caches on background")
2466 merge_background_deserialized_script_with_compilation_cache, true,
2467 "After deserializing code cache data on a background thread, merge it into "
2468 "an existing Script if one is found in the Isolate compilation cache")
2469DEFINE_BOOL(verify_code_merge, false, "Verify scope infos after merge")
2470
2471// Fix https://issues.chromium.org/u/1/issues/366783806 before enabling.
2473 experimental_embedder_instance_types, false,
2474 "enable type checks based on instance types provided by the embedder")
2475DEFINE_IMPLICATION(experimental_embedder_instance_types, experimental)
2476
2477// bootstrapper.cc
2478DEFINE_BOOL(expose_gc, false, "expose gc extension")
2479DEFINE_STRING(expose_gc_as, nullptr,
2480 "expose gc extension under the specified name")
2481DEFINE_IMPLICATION(expose_gc_as, expose_gc)
2482DEFINE_BOOL(expose_externalize_string, false,
2483 "expose externalize string extension")
2484DEFINE_BOOL(expose_statistics, false, "expose statistics extension")
2485DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension")
2486DEFINE_BOOL(expose_ignition_statistics, false,
2487 "expose ignition-statistics extension (requires building with "
2488 "v8_enable_ignition_dispatch_counting)")
2489DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture")
2490DEFINE_BOOL(builtins_in_stack_traces, false,
2491 "show built-in functions in stack traces")
2492DEFINE_BOOL(experimental_stack_trace_frames, false,
2493 "enable experimental frames (API/Builtins) and stack trace layout")
2494DEFINE_BOOL(disallow_code_generation_from_strings, false,
2495 "disallow eval and friends")
2496DEFINE_BOOL(expose_async_hooks, false, "expose async_hooks object")
2497DEFINE_STRING(expose_cputracemark_as, nullptr,
2498 "expose cputracemark extension under the specified name")
2499#ifdef ENABLE_VTUNE_TRACEMARK
2500DEFINE_BOOL(enable_vtune_domain_support, true, "enable vtune domain support")
2501#endif // ENABLE_VTUNE_TRACEMARK
2502
2503#ifdef ENABLE_VTUNE_JIT_INTERFACE
2504DEFINE_BOOL(enable_vtunejit, true, "enable vtune jit interface")
2505DEFINE_NEG_IMPLICATION(enable_vtunejit, compact_code_space)
2506#endif // ENABLE_VTUNE_JIT_INTERFACE
2507
2508DEFINE_BOOL(experimental_report_exceptions_from_callbacks, true,
2509 "Notify Api callback about exceptions thrown in Api callbacks")
2510
2511// builtins.cc
2512DEFINE_BOOL(allow_unsafe_function_constructor, false,
2513 "allow invoking the function constructor without security checks")
2514DEFINE_BOOL(force_slow_path, false, "always take the slow path for builtins")
2515DEFINE_BOOL(test_small_max_function_context_stub_size, false,
2516 "enable testing the function context size overflow path "
2517 "by making the maximum size smaller")
2518
2519DEFINE_BOOL(inline_new, true, "use fast inline allocation")
2520DEFINE_NEG_NEG_IMPLICATION(inline_new, turbo_allocation_folding)
2521
2522// bytecode-generator.cc
2523DEFINE_INT(switch_table_spread_threshold, 3,
2524 "allow the jump table used for switch statements to span a range "
2525 "of integers roughly equal to this number times the number of "
2526 "clauses in the switch")
2527DEFINE_INT(switch_table_min_cases, 6,
2528 "the number of Smi integer cases present in the switch statement "
2529 "before using the jump table optimization")
2530// Note that enabling this stress mode might result in a failure to compile
2531// even a top-level code.
2532DEFINE_INT(stress_lazy_compilation, 0,
2533 "stress lazy compilation by simulating stack overflow during "
2534 "unoptimized bytecode generation with 1/n-th probability, "
2535 "do nothing on 0")
2536// Correctness fuzzing treats stack overflows as crashes.
2537DEFINE_VALUE_IMPLICATION(correctness_fuzzer_suppressions,
2538 stress_lazy_compilation, 0)
2539
2540// codegen-ia32.cc / codegen-arm.cc
2541DEFINE_BOOL(trace, false, "trace javascript function calls")
2542
2543// codegen.cc
2544DEFINE_BOOL(lazy, true, "use lazy compilation")
2545DEFINE_BOOL(lazy_eval, true, "use lazy compilation during eval")
2546DEFINE_BOOL(lazy_streaming, true,
2547 "use lazy compilation during streaming compilation")
2548DEFINE_BOOL(max_lazy, false, "ignore eager compilation hints")
2549DEFINE_IMPLICATION(max_lazy, lazy)
2550DEFINE_BOOL(trace_opt, false, "trace optimized compilation")
2551DEFINE_BOOL(trace_opt_status, false,
2552 "trace the optimization status of functions during tiering events")
2553DEFINE_BOOL(trace_opt_verbose, false,
2554 "extra verbose optimized compilation tracing")
2555DEFINE_IMPLICATION(trace_opt_verbose, trace_opt)
2556DEFINE_BOOL(trace_opt_stats, false, "trace optimized compilation statistics")
2557DEFINE_BOOL(trace_deopt, false, "trace deoptimization")
2558DEFINE_BOOL(log_deopt, false, "log deoptimization")
2559DEFINE_BOOL(trace_deopt_verbose, false, "extra verbose deoptimization tracing")
2560DEFINE_IMPLICATION(trace_deopt_verbose, trace_deopt)
2561DEFINE_BOOL(trace_file_names, false,
2562 "include file names in trace-opt/trace-deopt output")
2563DEFINE_BOOL(always_turbofan, false, "always try to optimize functions")
2564DEFINE_IMPLICATION(always_turbofan, turbofan)
2565DEFINE_BOOL(always_osr, false, "always try to OSR functions")
2566DEFINE_BOOL(prepare_always_turbofan, false, "prepare for turning on always opt")
2567
2568DEFINE_BOOL(trace_serializer, false, "print code serializer trace")
2569#ifdef DEBUG
2570DEFINE_BOOL(external_reference_stats, false,
2571 "print statistics on external references used during serialization")
2572#endif // DEBUG
2573
2574// compilation-cache.cc
2575DEFINE_BOOL(compilation_cache, true, "enable compilation cache")
2576
2577DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions")
2578
2579// lazy-compile-dispatcher.cc
2580DEFINE_EXPERIMENTAL_FEATURE(lazy_compile_dispatcher,
2581 "enable compiler dispatcher")
2582DEFINE_UINT(lazy_compile_dispatcher_max_threads, 0,
2583 "max threads for compiler dispatcher (0 for unbounded)")
2584DEFINE_BOOL(trace_compiler_dispatcher, false,
2585 "trace compiler dispatcher activity")
2587 parallel_compile_tasks_for_eager_toplevel,
2588 "spawn parallel compile tasks for eagerly compiled, top-level functions")
2589DEFINE_IMPLICATION(parallel_compile_tasks_for_eager_toplevel,
2590 lazy_compile_dispatcher)
2592 parallel_compile_tasks_for_lazy,
2593 "spawn parallel compile tasks for all lazily compiled functions")
2594DEFINE_IMPLICATION(parallel_compile_tasks_for_lazy, lazy_compile_dispatcher)
2595
2596// cpu-profiler.cc
2597DEFINE_INT(cpu_profiler_sampling_interval, 1000,
2598 "CPU profiler sampling interval in microseconds")
2599
2600// debugger
2602 trace_side_effect_free_debug_evaluate, false,
2603 "print debug messages for side-effect-free debug-evaluate for testing")
2604DEFINE_BOOL(hard_abort, true, "abort by crashing")
2605DEFINE_NEG_IMPLICATION(fuzzing, hard_abort)
2606DEFINE_NEG_IMPLICATION(hole_fuzzing, hard_abort)
2607DEFINE_NEG_IMPLICATION(sandbox_fuzzing, hard_abort)
2608
2609// disassembler
2610DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR,
2611 "When logging, try to use coloured output.")
2612
2613// inspector
2614DEFINE_BOOL(expose_inspector_scripts, false,
2615 "expose injected-script-source.js for debugging")
2616
2617// execution.cc
2619 "default size of stack region v8 is allowed to use (in kBytes)")
2620
2621// frames.cc
2622DEFINE_INT(max_stack_trace_source_length, 300,
2623 "maximum length of function source code printed in a stack trace.")
2624
2625// execution.cc, messages.cc
2626DEFINE_BOOL(clear_exceptions_on_js_entry, false,
2627 "clear exceptions when entering JavaScript")
2628
2629DEFINE_BOOL(use_original_message_for_stack_trace, true,
2630 "use the message with which the Error constructor was called "
2631 "rather than the value of the \"message\" property for Error.stack")
2632
2633// counters.cc
2634DEFINE_INT(histogram_interval, 600000,
2635 "time interval in ms for aggregating memory histograms")
2636
2637// heap-snapshot-generator.cc
2638DEFINE_BOOL(heap_profiler_trace_objects, false,
2639 "Dump heap object allocations/movements/size_updates")
2640DEFINE_BOOL(heap_profiler_use_embedder_graph, true,
2641 "Use the new EmbedderGraph API to get embedder nodes")
2642DEFINE_BOOL(heap_snapshot_on_oom, false,
2643 "Write a heap snapshot to disk on last-resort GCs")
2644DEFINE_INT(heap_snapshot_on_gc, -1,
2645 "Write a heap snapshot to disk on a certain GC invocation")
2646DEFINE_UINT(heap_snapshot_string_limit, 1024,
2647 "truncate strings to this length in the heap snapshot")
2648DEFINE_BOOL(heap_profiler_show_hidden_objects, false,
2649 "use 'native' rather than 'hidden' node type in snapshot")
2650DEFINE_BOOL(profile_heap_snapshot, false, "dump time spent on heap snapshot")
2651#ifdef V8_ENABLE_HEAP_SNAPSHOT_VERIFY
2652DEFINE_BOOL(heap_snapshot_verify, false,
2653 "verify that heap snapshot matches marking visitor behavior")
2654DEFINE_IMPLICATION(enable_slow_asserts, heap_snapshot_verify)
2655#endif
2656
2657// sampling-heap-profiler.cc
2658DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false,
2659 "Use constant sample intervals to eliminate test flakiness")
2660
2661// ic.cc
2662DEFINE_BOOL(log_ic, false,
2663 "Log inline cache state transitions for tools/ic-processor")
2664DEFINE_IMPLICATION(log_ic, log_code)
2666 log_ic, TracingFlags::ic_stats.store(
2667 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
2668DEFINE_BOOL_READONLY(fast_map_update, false,
2669 "enable fast map update by caching the migration target")
2670#define DEFAULT_MAX_POLYMORPHIC_MAP_COUNT 4
2671DEFINE_INT(max_valid_polymorphic_map_count, DEFAULT_MAX_POLYMORPHIC_MAP_COUNT,
2672 "maximum number of valid maps to track in POLYMORPHIC state")
2674 clone_object_sidestep_transitions, true,
2675 "support sidestep transitions for dependency tracking object clone maps")
2676DEFINE_WEAK_IMPLICATION(future, clone_object_sidestep_transitions)
2677
2678// map-inl.h
2679DEFINE_INT(fast_properties_soft_limit, 12,
2680 "limits the number of properties that can be added to an object "
2681 "using keyed store before transitioning to dictionary mode")
2682DEFINE_INT(max_fast_properties, 128,
2683 "limits the number of mutable properties that can be added to an "
2684 "object before transitioning to dictionary mode")
2685
2686DEFINE_BOOL(native_code_counters, DEBUG_BOOL,
2687 "generate extra code for manipulating stats counters")
2688
2689DEFINE_BOOL(super_ic, true, "use an IC for super property loads")
2690
2691DEFINE_BOOL(mega_dom_ic, false, "use MegaDOM IC state for API objects")
2692
2693// objects.cc
2694DEFINE_BOOL(trace_prototype_users, false,
2695 "Trace updates to prototype user tracking")
2696DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths")
2697DEFINE_BOOL(log_maps, false, "Log map creation")
2698DEFINE_BOOL(log_maps_details, true, "Also log map details")
2699DEFINE_IMPLICATION(log_maps, log_code)
2701 move_prototype_transitions_first, true,
2702 "Always move prototype transitions to the front of the tree")
2703
2704// parser.cc
2705DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
2706DEFINE_BOOL(allow_natives_for_differential_fuzzing, false,
2707 "allow only natives explicitly allowlisted for differential "
2708 "fuzzers")
2709DEFINE_IMPLICATION(allow_natives_for_differential_fuzzing, allow_natives_syntax)
2710DEFINE_IMPLICATION(allow_natives_for_differential_fuzzing, fuzzing)
2711DEFINE_BOOL(parse_only, false, "only parse the sources")
2712
2713// simulator-arm.cc and simulator-arm64.cc.
2714#ifdef USE_SIMULATOR
2715DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
2716DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator")
2717DEFINE_BOOL(check_icache, false,
2718 "Check icache flushes in ARM and MIPS simulator")
2719DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions")
2720#if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \
2721 defined(V8_TARGET_ARCH_PPC64) || defined(V8_TARGET_ARCH_RISCV64) || \
2722 defined(V8_TARGET_ARCH_LOONG64)
2723DEFINE_INT(sim_stack_alignment, 16,
2724 "Stack alignment in bytes in simulator. This must be a power of two "
2725 "and it must be at least 16. 16 is default.")
2726#else
2727DEFINE_INT(sim_stack_alignment, 8,
2728 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
2729#endif
2730DEFINE_INT(sim_stack_size, 2 * MB / KB,
2731 "Stack size of the ARM64, MIPS64 and PPC64 simulator "
2732 "in kBytes (default is 2 MB)")
2733DEFINE_BOOL(trace_sim_messages, false,
2734 "Trace simulator debug messages. Implied by --trace-sim.")
2735#endif // USE_SIMULATOR
2736
2737#if defined V8_TARGET_ARCH_ARM64
2738// pointer-auth-arm64.cc
2739DEFINE_BOOL(sim_abort_on_bad_auth, true,
2740 "Stop execution when a pointer authentication fails in the "
2741 "ARM64 simulator.")
2742#endif
2743
2744// isolate.cc
2745DEFINE_BOOL(async_stack_traces, true,
2746 "include async stack traces in Error.stack")
2747DEFINE_BOOL(stack_trace_on_illegal, false,
2748 "print stack trace when an illegal exception is thrown")
2749DEFINE_BOOL(abort_on_uncaught_exception, false,
2750 "abort program (dump core) when an uncaught exception is thrown")
2751DEFINE_BOOL(correctness_fuzzer_suppressions, false,
2752 "Suppress certain unspecified behaviors to ease correctness "
2753 "fuzzing: Abort program when the stack overflows or a string "
2754 "exceeds maximum length (as opposed to throwing RangeError). "
2755 "Use a fixed suppression string for error messages.")
2756DEFINE_BOOL(rehash_snapshot, false,
2757 "rehash strings from the snapshot to override the baked-in seed")
2758DEFINE_UINT64(hash_seed, 0,
2759 "Fixed seed to use to hash property keys (0 means random)"
2760 "(with snapshots this option cannot override the baked-in seed)")
2761DEFINE_INT(random_seed, 0,
2762 "Default seed for initializing random generator "
2763 "(0, the default, means to use system random).")
2764DEFINE_INT(fuzzer_random_seed, 0,
2765 "Default seed for initializing fuzzer random generator "
2766 "(0, the default, means to use v8's random number generator seed).")
2767DEFINE_BOOL(trace_rail, false, "trace RAIL mode")
2768DEFINE_BOOL(print_all_exceptions, false,
2769 "print exception object and stack trace on each thrown exception")
2771 detailed_error_stack_trace, false,
2772 "includes arguments for each function call in the error stack frames array")
2773DEFINE_BOOL(adjust_os_scheduling_parameters, true,
2774 "adjust OS specific scheduling params for the isolate")
2775DEFINE_BOOL(experimental_flush_embedded_blob_icache, true,
2776 "Used in an experiment to evaluate icache flushing on certain CPUs")
2777DEFINE_BOOL(allow_allocation_in_fast_api_call, true,
2778 "Allow allocations in fast API calls.")
2779
2780// Flags for short builtin calls feature
2781#if V8_SHORT_BUILTIN_CALLS
2782#define V8_SHORT_BUILTIN_CALLS_BOOL true
2783#else
2784#define V8_SHORT_BUILTIN_CALLS_BOOL false
2785#endif
2786
2787DEFINE_BOOL(short_builtin_calls, V8_SHORT_BUILTIN_CALLS_BOOL,
2788 "Put embedded builtins code into the code range for shorter "
2789 "builtin calls/jumps if system has >=4GB memory")
2790DEFINE_BOOL(trace_code_range_allocation, false,
2791 "Trace code range allocation process.")
2792
2793DEFINE_BOOL(better_code_range_allocation,
2795 "This mode tries harder to allocate code range near .text section. "
2796 "Works only for configurations with external code space and "
2797 "shared pointer compression cage.")
2798DEFINE_BOOL(abort_on_far_code_range, false,
2799 "Abort if code range is allocated further away than 4GB from the"
2800 ".text section")
2801
2802// runtime.cc
2803DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times")
2805 runtime_call_stats,
2806 TracingFlags::runtime_stats.store(
2807 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
2808DEFINE_BOOL(rcs, false, "report runtime call counts and times")
2809DEFINE_IMPLICATION(rcs, runtime_call_stats)
2810
2811DEFINE_BOOL(rcs_cpu_time, false,
2812 "report runtime times in cpu time (the default is wall time)")
2813DEFINE_IMPLICATION(rcs_cpu_time, rcs)
2814
2815// snapshot-common.cc
2816DEFINE_BOOL(verify_snapshot_checksum, DEBUG_BOOL,
2817 "Verify snapshot checksums when deserializing snapshots. Enable "
2818 "checksum creation and verification for code caches. Enabled by "
2819 "default in debug builds and once per process for Android.")
2820DEFINE_BOOL(profile_deserialization, false,
2821 "Print the time it takes to deserialize the snapshot.")
2822DEFINE_BOOL(trace_deserialization, false, "Trace the snapshot deserialization.")
2823DEFINE_BOOL(serialization_statistics, false,
2824 "Collect statistics on serialized objects.")
2825// Regexp
2826DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code")
2827DEFINE_BOOL(regexp_interpret_all, false, "interpret all regexp code")
2828#ifdef V8_TARGET_BIG_ENDIAN
2829#define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL false
2830#else
2831#define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL true
2832#endif
2833DEFINE_BOOL(regexp_tier_up, true,
2834 "enable regexp interpreter and tier up to the compiler after the "
2835 "number of executions set by the tier up ticks flag")
2836DEFINE_NEG_IMPLICATION(regexp_interpret_all, regexp_tier_up)
2837DEFINE_INT(regexp_tier_up_ticks, 1,
2838 "set the number of executions for the regexp interpreter before "
2839 "tiering-up to the compiler")
2840DEFINE_BOOL(regexp_peephole_optimization, REGEXP_PEEPHOLE_OPTIMIZATION_BOOL,
2841 "enable peephole optimization for regexp bytecode")
2842DEFINE_BOOL(regexp_results_cache, true, "enable the regexp results cache")
2843DEFINE_BOOL(trace_regexp_peephole_optimization, false,
2844 "trace regexp bytecode peephole optimization")
2845DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
2846DEFINE_BOOL(trace_regexp_assembler, false,
2847 "trace regexp macro assembler calls.")
2848DEFINE_BOOL(trace_regexp_parser, false, "trace regexp parsing")
2849DEFINE_BOOL(trace_regexp_tier_up, false, "trace regexp tiering up execution")
2850DEFINE_BOOL(trace_regexp_graph, false, "trace the regexp graph")
2851
2852DEFINE_BOOL(enable_experimental_regexp_engine, false,
2853 "recognize regexps with 'l' flag, run them on experimental engine")
2854DEFINE_BOOL(default_to_experimental_regexp_engine, false,
2855 "run regexps with the experimental engine where possible")
2856DEFINE_IMPLICATION(default_to_experimental_regexp_engine,
2857 enable_experimental_regexp_engine)
2858DEFINE_BOOL(experimental_regexp_engine_capture_group_opt, false,
2859 "enable time optimizations for the experimental regexp engine")
2860DEFINE_IMPLICATION(experimental_regexp_engine_capture_group_opt,
2861 enable_experimental_regexp_engine)
2862DEFINE_UINT64(experimental_regexp_engine_capture_group_opt_max_memory_usage,
2863 1024,
2864 "maximum memory usage in MB allowed for experimental engine")
2865DEFINE_BOOL(trace_experimental_regexp_engine, false,
2866 "trace execution of experimental regexp engine")
2867
2868DEFINE_BOOL(enable_experimental_regexp_engine_on_excessive_backtracks, false,
2869 "fall back to a breadth-first regexp engine on excessive "
2870 "backtracking")
2871DEFINE_UINT(regexp_backtracks_before_fallback, 50000,
2872 "number of backtracks during regexp execution before fall back "
2873 "to experimental engine if "
2874 "enable_experimental_regexp_engine_on_excessive_backtracks is set")
2875
2876#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
2877DEFINE_BOOL(regexp_simd, true, "enable SIMD for regexp jit code")
2878#else
2880 regexp_simd, false,
2881 "enable SIMD for regexp jit code (not supported for this architecture)")
2882#endif // V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
2883
2884DEFINE_BOOL(trace_read_only_promotion, false,
2885 "trace the read-only promotion pass")
2886DEFINE_BOOL(trace_read_only_promotion_verbose, false,
2887 "trace the read-only promotion pass")
2888DEFINE_WEAK_IMPLICATION(trace_read_only_promotion_verbose,
2889 trace_read_only_promotion)
2890
2891// Testing flags test/cctest/test-{flags,api,serialization}.cc
2892DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag")
2893DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag")
2894DEFINE_INT(testing_int_flag, 13, "testing_int_flag")
2895DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag")
2896DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag")
2897DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness")
2898
2899// Test flag for a check in %OptimizeFunctionOnNextCall
2901 testing_d8_test_runner, false,
2902 "test runner turns on this flag to enable a check that the function was "
2903 "prepared for optimization before marking it for optimization")
2904
2906 strict_termination_checks,
2907 "Enable strict terminating DCHECKs to prevent accidentally "
2908 "keeping on executing JS after terminating V8.")
2909
2911 fuzzing, false,
2912 "Fuzzers use this flag to signal that they are ... fuzzing. This causes "
2913 "intrinsics to fail silently (e.g. return undefined) on invalid usage.")
2914
2915// When fuzzing, always compile functions twice and ensure that the generated
2916// bytecode is the same. This can help find bugs such as crbug.com/1394403 as it
2917// avoids the need for bytecode aging to kick in to trigger the recomplication.
2918DEFINE_WEAK_NEG_IMPLICATION(fuzzing, lazy)
2919DEFINE_WEAK_IMPLICATION(fuzzing, stress_lazy_source_positions)
2920
2922 hole_fuzzing, false,
2923 "Fuzzers use this flag to turn DCHECKs into NOPs and CHECK failures into "
2924 "silent exits. This is useful if we want to find memory corruption "
2925 "primitives with a leaked hole, where the engine is already in a weird "
2926 "state")
2927
2928//
2929// Sandbox-related flags.
2930//
2931#ifdef V8_ENABLE_SANDBOX
2932DEFINE_BOOL(sandbox_testing, false,
2933 "Enable sandbox testing mode. This exposes the memory corruption "
2934 "API (if available) and enables the sandbox crash filter to "
2935 "terminate the process (with status zero) if a crash that does not "
2936 "represent a sandbox violation is detected.")
2937#else
2939 sandbox_testing, false,
2940 "Enable sandbox testing mode. This exposes the memory corruption API (if "
2941 "available) and enables the sandbox crash filter to terminate the process "
2942 "(with status zero) if a crash that does not represent a sandbox violation "
2943 "is detected.")
2944#endif
2945
2946#ifdef V8_ENABLE_MEMORY_CORRUPTION_API
2947// Sandbox fuzzing mode requires the memory corruption API.
2948DEFINE_BOOL(sandbox_fuzzing, false,
2949 "Enable sandbox fuzzing mode. This exposes the memory corruption "
2950 "API and enables the sandbox crash filter to terminate the process "
2951 "(with non-zero status) if a crash that does not represent a "
2952 "sandbox violation is detected.")
2953#else
2954DEFINE_BOOL_READONLY(sandbox_fuzzing, false,
2955 "Enable sandbox fuzzing mode. This exposes the memory "
2956 "corruption API and enables the sandbox crash filter to "
2957 "terminate the process (with non-zero status) if a crash "
2958 "that does not represent a sandbox violation is detected.")
2959#endif
2960
2961// Only one of these can be enabled.
2962DEFINE_NEG_IMPLICATION(sandbox_fuzzing, sandbox_testing)
2963DEFINE_NEG_IMPLICATION(sandbox_testing, sandbox_fuzzing)
2964
2965#ifdef V8_ENABLE_MEMORY_CORRUPTION_API
2966DEFINE_BOOL(expose_memory_corruption_api, false,
2967 "Exposes the memory corruption API. Set automatically by "
2968 "--sandbox-testing and --sandbox-fuzzing.")
2969DEFINE_IMPLICATION(sandbox_fuzzing, expose_memory_corruption_api)
2970DEFINE_IMPLICATION(sandbox_testing, expose_memory_corruption_api)
2971#else
2972DEFINE_BOOL_READONLY(expose_memory_corruption_api, false,
2973 "Exposes the memory corruption API. Set automatically by "
2974 "--sandbox-testing and --sandbox-fuzzing.")
2975#endif
2976
2977#if defined(V8_OS_AIX) && defined(COMPONENT_BUILD)
2978// FreezeFlags relies on mprotect() method, which does not work by default on
2979// shared mem: https://www.ibm.com/docs/en/aix/7.2?topic=m-mprotect-subroutine
2980DEFINE_BOOL(freeze_flags_after_init, false,
2981 "Disallow changes to flag values after initializing V8")
2982#else
2983DEFINE_BOOL(freeze_flags_after_init, true,
2984 "Disallow changes to flag values after initializing V8")
2985#endif // defined(V8_OS_AIX) && defined(COMPONENT_BUILD)
2986
2987#if V8_ENABLE_CET_SHADOW_STACK
2988#define V8_CET_SHADOW_STACK_BOOL true
2989#else
2990#define V8_CET_SHADOW_STACK_BOOL false
2991#endif
2993 "Generate Intel CET compatible code")
2994DEFINE_NEG_IMPLICATION(cet_compatible, compact_code_space_with_stack)
2995
2996// mksnapshot.cc
2997DEFINE_STRING(embedded_src, nullptr,
2998 "Path for the generated embedded data file. (mksnapshot only)")
3000 embedded_variant, nullptr,
3001 "Label to disambiguate symbols in embedded data file. (mksnapshot only)")
3002#if V8_STATIC_ROOTS_GENERATION_BOOL
3003DEFINE_STRING(static_roots_src, nullptr,
3004 "Path for writing a fresh static-roots.h. (mksnapshot only, "
3005 "build without static roots only)")
3006#endif
3007DEFINE_STRING(startup_src, nullptr,
3008 "Write V8 startup as C++ src. (mksnapshot only)")
3009DEFINE_STRING(startup_blob, nullptr,
3010 "Write V8 startup blob file. (mksnapshot only)")
3011DEFINE_STRING(target_arch, nullptr,
3012 "The mksnapshot target arch. (mksnapshot only)")
3013DEFINE_STRING(target_os, nullptr, "The mksnapshot target os. (mksnapshot only)")
3014DEFINE_BOOL(target_is_simulator, false,
3015 "Instruct mksnapshot that the target is meant to run in the "
3016 "simulator and it can generate simulator-specific instructions. "
3017 "(mksnapshot only)")
3018DEFINE_STRING(turbo_profiling_input, nullptr,
3019 "Path of the input file containing basic information for "
3020 "builtins. (mksnapshot only)")
3021DEFINE_STRING(turbo_log_builtins_count_input, nullptr,
3022 "Path of the input file containing basic block counters for "
3023 "builtins for logging in turbolizer. (mksnapshot only)")
3024
3025// On some platforms, the .text section only has execute permissions.
3026DEFINE_BOOL(text_is_readable, true,
3027 "Whether the .text section of binary can be read")
3028DEFINE_NEG_NEG_IMPLICATION(text_is_readable, partial_constant_pool)
3029
3030//
3031// Minor mark sweep collector flags.
3032//
3033DEFINE_BOOL(trace_minor_ms_parallel_marking, false,
3034 "trace parallel marking for the young generation")
3035DEFINE_BOOL(minor_ms, false, "perform young generation mark sweep GCs")
3036DEFINE_IMPLICATION(minor_ms, page_promotion)
3037
3038DEFINE_BOOL(concurrent_minor_ms_marking, true,
3039 "perform young generation marking concurrently")
3040DEFINE_NEG_NEG_IMPLICATION(concurrent_marking, concurrent_minor_ms_marking)
3041
3042#ifdef V8_ENABLE_BLACK_ALLOCATED_PAGES
3043#define V8_ENABLE_BLACK_ALLOCATED_PAGES_BOOL true
3044#else
3045#define V8_ENABLE_BLACK_ALLOCATED_PAGES_BOOL false
3046#endif
3048 black_allocated_pages, V8_ENABLE_BLACK_ALLOCATED_PAGES_BOOL,
3049 "allocate non-young objects during incremental marking on separate pages")
3050
3051#ifdef V8_ENABLE_STICKY_MARK_BITS
3052#define V8_ENABLE_STICKY_MARK_BITS_BOOL true
3053#if V8_ENABLE_BLACK_ALLOCATED_PAGES_BOOL
3054#error "Black allocated pages are not supported with sticky mark bits"
3055#endif // V8_ENABLE_BLACK_ALLOCATED_PAGES_BOOL
3056#else
3057#define V8_ENABLE_STICKY_MARK_BITS_BOOL false
3058#endif
3060 "use sticky mark bits for separation of generations")
3061DEFINE_IMPLICATION(sticky_mark_bits, minor_ms)
3062// TODO(333906585): Copy mark bits and live bytes on compaction.
3063DEFINE_NEG_IMPLICATION(sticky_mark_bits, compact)
3064
3065#ifndef DEBUG
3066#define V8_MINOR_MS_CONCURRENT_MARKING_MIN_CAPACITY_DEFAULT 8
3067#else
3068#define V8_MINOR_MS_CONCURRENT_MARKING_MIN_CAPACITY_DEFAULT 0
3069#endif
3070
3071DEFINE_UINT(minor_ms_min_new_space_capacity_for_concurrent_marking_mb,
3073 "min new space capacity in MBs for using young generation "
3074 "concurrent marking.")
3075
3076DEFINE_UINT(minor_ms_concurrent_marking_trigger, 90,
3077 "minor ms concurrent marking trigger in percent of the current new "
3078 "space capacity")
3079
3080DEFINE_SIZE_T(minor_ms_min_lab_size_kb, 0,
3081 "override for the minimum lab size in KB to be used for new "
3082 "space allocations with minor ms. ")
3083
3084//
3085// Dev shell flags
3086//
3087
3088DEFINE_BOOL(help, false, "Print usage message, including flags, on console")
3089DEFINE_BOOL(print_flag_values, false, "Print all flag values of V8")
3090DEFINE_BOOL(print_feature_flags_json, false,
3091 "Print JS and Wasm feature flags grouped by in-progress, staged, "
3092 "and shipped")
3093
3094// Slow histograms are also enabled via --dump-counters in d8.
3095DEFINE_BOOL(slow_histograms, false,
3096 "Enable slow histograms with more overhead.")
3097
3098DEFINE_BOOL(use_external_strings, false, "Use external strings for source code")
3099DEFINE_STRING(map_counters, "", "Map counters to a file")
3100DEFINE_BOOL(mock_arraybuffer_allocator, false,
3101 "Use a mock ArrayBuffer allocator for testing.")
3102DEFINE_SIZE_T(mock_arraybuffer_allocator_limit, 0,
3103 "Memory limit for mock ArrayBuffer allocator used to simulate "
3104 "OOM for testing.")
3105#ifdef V8_OS_LINUX
3106DEFINE_BOOL(multi_mapped_mock_allocator, false,
3107 "Use a multi-mapped mock ArrayBuffer allocator for testing.")
3108#endif
3109
3110//
3111// GDB JIT integration flags.
3112//
3113#undef FLAG
3114#ifdef ENABLE_GDB_JIT_INTERFACE
3115#define FLAG FLAG_FULL
3116#else
3117#define FLAG FLAG_READONLY
3118#endif
3119
3120DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface")
3121DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects")
3122DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk")
3123DEFINE_STRING(gdbjit_dump_filter, "",
3124 "dump only objects containing this substring")
3125
3126#ifdef ENABLE_GDB_JIT_INTERFACE
3127DEFINE_IMPLICATION(gdbjit_full, gdbjit)
3128DEFINE_IMPLICATION(gdbjit_dump, gdbjit)
3129#endif
3130DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space)
3131
3132//
3133// Debug only flags
3134//
3135#undef FLAG
3136#ifdef DEBUG
3137#define FLAG FLAG_FULL
3138#else
3139#define FLAG FLAG_READONLY
3140#endif
3141
3142#ifdef ENABLE_SLOW_DCHECKS
3143DEFINE_BOOL(enable_slow_asserts, true,
3144 "enable asserts that are slow to execute")
3145#else
3146DEFINE_BOOL_READONLY(enable_slow_asserts, false,
3147 "enable asserts that are slow to execute")
3148#endif
3149
3150// codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc
3151DEFINE_BOOL(print_ast, false, "print source AST")
3152
3153// compiler.cc
3154DEFINE_BOOL(print_scopes, false, "print scopes")
3155
3156// contexts.cc
3157DEFINE_BOOL(trace_contexts, false, "trace contexts operations")
3158
3159// heap.cc
3160DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection")
3161DEFINE_BOOL(code_stats, false, "report code statistics after GC")
3162DEFINE_BOOL(print_handles, false, "report handles after GC")
3163DEFINE_BOOL(check_handle_count, false,
3164 "Check that there are not too many handles at GC")
3165DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
3166
3167// TurboFan debug-only flags.
3168DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
3169
3170// objects.cc
3171DEFINE_BOOL(trace_module_status, false,
3172 "Trace status transitions of ECMAScript modules")
3173DEFINE_BOOL(trace_normalization, false,
3174 "prints when objects are turned into dictionaries.")
3175
3176// runtime.cc
3177DEFINE_BOOL(trace_lazy, false, "trace lazy compilation")
3178
3179// spaces.cc
3180DEFINE_BOOL(trace_isolates, false, "trace isolate state changes")
3181
3182// Regexp
3183DEFINE_BOOL(regexp_possessive_quantifier, false,
3184 "enable possessive quantifier syntax for testing")
3185
3186// Debugger
3187DEFINE_BOOL(print_break_location, false, "print source location on debug break")
3188
3189//
3190// Logging and profiling flags
3191//
3192// Logging flag dependencies are also set separately in
3193// V8::InitializeOncePerProcessImpl. Please add your flag to the log_all_flags
3194// list in v8.cc to properly set v8_flags.log and automatically enable it with
3195// --log-all.
3196#undef FLAG
3197#define FLAG FLAG_FULL
3198
3199// log.cc
3200DEFINE_STRING(logfile, "v8.log",
3201 "Specify the name of the log file, use '-' for console, '+' for "
3202 "a temporary file.")
3203DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
3204
3205DEFINE_BOOL(log, false,
3206 "Minimal logging (no API, code, GC, suspect, or handles samples).")
3207DEFINE_BOOL(log_all, false, "Log all events to the log file.")
3208
3209DEFINE_BOOL(log_internal_timer_events, false, "See --log-timer-events")
3210DEFINE_BOOL(log_timer_events, false,
3211 "Log timer events (incl. console.time* and Date.now).")
3212
3213DEFINE_BOOL(log_source_code, false, "Log source code.")
3214DEFINE_BOOL(log_source_position, false, "Log detailed source information.")
3215DEFINE_BOOL(log_code, false,
3216 "Log code events to the log file without profiling.")
3217DEFINE_WEAK_IMPLICATION(log_code, log_source_code)
3218DEFINE_WEAK_IMPLICATION(log_code, log_source_position)
3219DEFINE_BOOL(log_feedback_vector, false, "Log FeedbackVectors on first creation")
3220DEFINE_BOOL(log_code_disassemble, false,
3221 "Log all disassembled code to the log file.")
3222DEFINE_IMPLICATION(log_code_disassemble, log_code)
3223DEFINE_BOOL(log_function_events, false,
3224 "Log function events "
3225 "(parse, compile, execute) separately.")
3226
3227DEFINE_BOOL(detailed_line_info, false,
3228 "Always generate detailed line information for CPU profiling.")
3229
3230DEFINE_BOOL(perfetto_code_logger, false,
3231 "Enable the Perfetto code data source.")
3232
3233#if defined(ANDROID)
3234// Phones and tablets have processors that are much slower than desktop
3235// and laptop computers for which current heuristics are tuned.
3236#define DEFAULT_PROF_SAMPLING_INTERVAL 5000
3237#else
3238#define DEFAULT_PROF_SAMPLING_INTERVAL 1000
3239#endif
3240DEFINE_INT(prof_sampling_interval, DEFAULT_PROF_SAMPLING_INTERVAL,
3241 "Interval for --prof samples (in microseconds).")
3242#undef DEFAULT_PROF_SAMPLING_INTERVAL
3243
3244DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.")
3245DEFINE_BOOL(prof_browser_mode, true,
3246 "Used with --prof, turns on browser-compatible mode for profiling.")
3247
3248DEFINE_BOOL(prof, false,
3249 "Log statistical profiling information (implies --log-code).")
3250DEFINE_IMPLICATION(prof, prof_cpp)
3251DEFINE_IMPLICATION(prof, log_code)
3252
3253DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
3254
3255#if V8_OS_LINUX
3256#define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL(nam, false, cmt)
3257#define DEFINE_PERF_PROF_IMPLICATION DEFINE_IMPLICATION
3258#else
3259#define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL_READONLY(nam, false, cmt)
3260#define DEFINE_PERF_PROF_IMPLICATION(...)
3261#endif
3262
3263#if defined(ANDROID)
3264#define DEFAULT_PERF_BASIC_PROF_PATH "/data/local/tmp"
3265#define DEFAULT_PERF_PROF_PATH DEFAULT_PERF_BASIC_PROF_PATH
3266#else
3267#define DEFAULT_PERF_BASIC_PROF_PATH "/tmp"
3268#define DEFAULT_PERF_PROF_PATH "."
3269#endif
3270
3271DEFINE_PERF_PROF_BOOL(perf_basic_prof,
3272 "Enable perf linux profiler (basic support).")
3273DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
3274DEFINE_STRING(perf_basic_prof_path, DEFAULT_PERF_BASIC_PROF_PATH,
3275 "directory to write perf-<pid>.map symbol file to")
3277 perf_basic_prof_only_functions,
3278 "Only report function code ranges to perf (i.e. no stubs).")
3279DEFINE_PERF_PROF_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof)
3280
3282 perf_prof, "Enable perf linux profiler (experimental annotate support).")
3284 "directory to write jit-<pid>.dump symbol file to")
3286 perf_prof_annotate_wasm,
3287 "Used with --perf-prof, load wasm source map and provide annotate "
3288 "support (experimental).")
3290 perf_prof_delete_file,
3291 "Remove the perf file right after creating it (for testing only).")
3292DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space)
3293
3294// --perf-prof-unwinding-info is available only on selected architectures.
3295#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || \
3296 V8_TARGET_ARCH_S390X || V8_TARGET_ARCH_PPC64
3298 perf_prof_unwinding_info,
3299 "Enable unwinding info for perf linux profiler (experimental).")
3300DEFINE_PERF_PROF_IMPLICATION(perf_prof, perf_prof_unwinding_info)
3301#else
3303 perf_prof_unwinding_info, false,
3304 "Enable unwinding info for perf linux profiler (experimental).")
3305#endif
3306
3307#undef DEFINE_PERF_PROF_BOOL
3308#undef DEFINE_PERF_PROF_IMPLICATION
3309
3310DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
3311 "Specify the name of the file for fake gc mmap used in ll_prof")
3312
3313DEFINE_BOOL(redirect_code_traces, false,
3314 "output deopt information and disassembly into file "
3315 "code-<pid>-<isolate id>.asm")
3316DEFINE_STRING(redirect_code_traces_to, nullptr,
3317 "output deopt information and disassembly into the given file")
3318
3319DEFINE_BOOL(print_opt_source, false,
3320 "print source code of optimized and inlined functions")
3321
3322DEFINE_BOOL(vtune_prof_annotate_wasm, false,
3323 "Used when v8_enable_vtunejit is enabled, load wasm source map and "
3324 "provide annotate support (experimental).")
3325
3326DEFINE_BOOL(win64_unwinding_info, true, "Enable unwinding info for Windows/x64")
3327
3328DEFINE_BOOL(interpreted_frames_native_stack, false,
3329 "Show interpreted frames on the native stack (useful for external "
3330 "profilers).")
3331
3332#if defined(V8_ENABLE_ETW_STACK_WALKING)
3333DEFINE_BOOL(enable_etw_stack_walking, false,
3334 "Enable etw stack walking for windows")
3335DEFINE_WEAK_IMPLICATION(future, enable_etw_stack_walking)
3336DEFINE_BOOL(etw_trace_debug, false,
3337 "Enable etw debug logging (only on debug builds)")
3338DEFINE_BOOL(enable_etw_by_custom_filter_only, true,
3339 "Enable etw stack walking for windows, but only if explicitly "
3340 "specified in a WPR profile")
3341#else // V8_ENABLE_ETW_STACK_WALKING
3342DEFINE_BOOL_READONLY(enable_etw_stack_walking, false,
3343 "Enable etw stack walking for windows")
3344DEFINE_BOOL_READONLY(etw_trace_debug, false,
3345 "Enable etw debug logging (only on debug builds)")
3347 enable_etw_by_custom_filter_only, false,
3348 "Enable etw stack walking for windows, but only if explicitly "
3349 "specified in a WPR profile")
3350#endif // V8_ENABLE_ETW_STACK_WALKING
3351
3352DEFINE_BOOL(print_builtin_size, false, "print code size for builtins")
3353
3354//
3355// Disassembler only flags
3356//
3357#undef FLAG
3358#ifdef ENABLE_DISASSEMBLER
3359#define FLAG FLAG_FULL
3360#else
3361#define FLAG FLAG_READONLY
3362#endif
3363
3364// elements.cc
3365DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions")
3366
3367DEFINE_BOOL(trace_creation_allocation_sites, false,
3368 "trace the creation of allocation sites")
3369
3370DEFINE_BOOL(print_code, false, "print generated code")
3371DEFINE_BOOL(print_opt_code, false, "print optimized code")
3372DEFINE_STRING(print_opt_code_filter, "*", "filter for printing optimized code")
3373DEFINE_BOOL(print_code_verbose, false, "print more information for code")
3374DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins")
3375DEFINE_STRING(print_builtin_code_filter, "*",
3376 "filter for printing builtin code")
3377DEFINE_BOOL(print_regexp_code, false, "print generated regexp code")
3378DEFINE_BOOL(print_regexp_bytecode, false, "print generated regexp bytecode")
3379
3380#ifdef ENABLE_DISASSEMBLER
3381DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code")
3382DEFINE_IMPLICATION(print_all_code, print_code)
3383DEFINE_IMPLICATION(print_all_code, print_opt_code)
3384DEFINE_IMPLICATION(print_all_code, print_code_verbose)
3385DEFINE_IMPLICATION(print_all_code, print_builtin_code)
3386DEFINE_IMPLICATION(print_all_code, print_regexp_code)
3387#endif
3388
3389#undef FLAG
3390#define FLAG FLAG_FULL
3391
3392//
3393// Predictable mode related flags.
3394//
3395
3396DEFINE_BOOL(predictable, false, "enable predictable mode")
3397DEFINE_NEG_IMPLICATION(predictable, memory_reducer)
3398// TODO(v8:11848): These flags were recursively implied via --single-threaded
3399// before. Audit them, and remove any unneeded implications.
3400DEFINE_IMPLICATION(predictable, single_threaded_gc)
3401DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation)
3402DEFINE_NEG_IMPLICATION(predictable, stress_concurrent_inlining)
3403DEFINE_NEG_IMPLICATION(predictable, lazy_compile_dispatcher)
3404DEFINE_NEG_IMPLICATION(predictable, parallel_compile_tasks_for_eager_toplevel)
3405DEFINE_NEG_IMPLICATION(predictable, parallel_compile_tasks_for_lazy)
3406#ifdef V8_ENABLE_MAGLEV
3407DEFINE_NEG_IMPLICATION(predictable, maglev_deopt_data_on_background)
3408DEFINE_NEG_IMPLICATION(predictable, maglev_build_code_on_background)
3409#endif // V8_ENABLE_MAGLEV
3410// Avoid random seeds in predictable mode.
3411DEFINE_BOOL(predictable_and_random_seed_is_0, true,
3412 "predictable && (random_seed == 0)")
3413DEFINE_NEG_NEG_IMPLICATION(predictable, predictable_and_random_seed_is_0)
3415 predictable_and_random_seed_is_0, false)
3416DEFINE_VALUE_IMPLICATION(predictable_and_random_seed_is_0, random_seed, 12347)
3417
3418DEFINE_BOOL(predictable_gc_schedule, false,
3419 "Predictable garbage collection schedule. Fixes heap growing, "
3420 "idle, and memory reducing behavior.")
3421DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, min_semi_space_size,
3422 size_t{4})
3423DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, max_semi_space_size,
3424 size_t{4})
3425DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, heap_growing_percent, 30)
3426DEFINE_NEG_IMPLICATION(predictable_gc_schedule, memory_reducer)
3427
3428//
3429// Threading related flags.
3430//
3431
3432DEFINE_BOOL(single_threaded, false, "disable the use of background tasks")
3433DEFINE_IMPLICATION(single_threaded, single_threaded_gc)
3434DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation)
3435DEFINE_NEG_IMPLICATION(single_threaded, concurrent_builtin_generation)
3436DEFINE_NEG_IMPLICATION(single_threaded, stress_concurrent_inlining)
3437DEFINE_NEG_IMPLICATION(single_threaded, lazy_compile_dispatcher)
3438DEFINE_NEG_IMPLICATION(single_threaded,
3439 parallel_compile_tasks_for_eager_toplevel)
3440DEFINE_NEG_IMPLICATION(single_threaded, parallel_compile_tasks_for_lazy)
3441#ifdef V8_ENABLE_MAGLEV
3442DEFINE_NEG_IMPLICATION(single_threaded, maglev_deopt_data_on_background)
3443DEFINE_NEG_IMPLICATION(single_threaded, maglev_build_code_on_background)
3444#endif // V8_ENABLE_MAGLEV
3445
3446//
3447// Parallel and concurrent GC (Orinoco) related flags.
3448//
3449DEFINE_BOOL(single_threaded_gc, false, "disable the use of background gc tasks")
3450DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_marking)
3451DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_sweeping)
3452DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_compaction)
3453DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_marking)
3454DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_pointer_update)
3455DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_weak_ref_clearing)
3456DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_scavenge)
3457DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_array_buffer_sweeping)
3458DEFINE_NEG_IMPLICATION(single_threaded_gc, stress_concurrent_allocation)
3459DEFINE_NEG_IMPLICATION(single_threaded_gc, cppheap_concurrent_marking)
3460
3461DEFINE_BOOL(single_threaded_gc_in_background, true,
3462 "disable the use of background gc tasks when in background")
3463DEFINE_BOOL(parallel_pause_for_gc_in_background, true,
3464 "Use parallel threads in the atomic pause for background GCs")
3465DEFINE_BOOL(incremental_marking_for_gc_in_background, true,
3466 "Use parallel threads in the atomic pause for background GCs")
3467
3468DEFINE_EXPERIMENTAL_FEATURE(shared_heap,
3469 "Enables a shared heap between isolates.")
3470
3471#if defined(V8_USE_LIBM_TRIG_FUNCTIONS)
3472DEFINE_BOOL(use_libm_trig_functions, true, "use libm trig functions")
3473#endif
3474
3475#undef FLAG
3476
3477#ifdef VERIFY_PREDICTABLE
3478#define FLAG FLAG_FULL
3479#else
3480#define FLAG FLAG_READONLY
3481#endif
3482
3483DEFINE_BOOL(verify_predictable, false,
3484 "this mode is used for checking that V8 behaves predictably")
3485DEFINE_IMPLICATION(verify_predictable, predictable)
3486DEFINE_INT(dump_allocations_digest_at_alloc, -1,
3487 "dump allocations digest each n-th allocation")
3488
3489#define LOG_FLAGS(V) \
3490 V(log_code) \
3491 V(log_code_disassemble) \
3492 V(log_deopt) \
3493 V(log_feedback_vector) \
3494 V(log_function_events) \
3495 V(log_ic) \
3496 V(log_maps) \
3497 V(log_source_code) \
3498 V(log_source_position) \
3499 V(log_timer_events) \
3500 V(prof) \
3501 V(prof_cpp)
3502
3503#define SET_IMPLICATIONS(V) \
3504 DEFINE_IMPLICATION(log_all, V) \
3505 DEFINE_IMPLICATION(V, log)
3506
3508
3509#undef SET_IMPLICATIONS
3510#undef LOG_FLAGS
3511
3512DEFINE_IMPLICATION(log_all, log)
3513DEFINE_IMPLICATION(perf_prof, log)
3514DEFINE_IMPLICATION(perf_basic_prof, log)
3515DEFINE_IMPLICATION(ll_prof, log)
3516DEFINE_IMPLICATION(gdbjit, log)
3517
3518// Cleanup...
3519#undef FLAG_FULL
3520#undef FLAG_READONLY
3521#undef FLAG
3522#undef FLAG_ALIAS
3523
3524#undef DEFINE_BOOL
3525#undef DEFINE_MAYBE_BOOL
3526#undef DEFINE_DEBUG_BOOL
3527#undef DEFINE_INT
3528#undef DEFINE_STRING
3529#undef DEFINE_FLOAT
3530#undef DEFINE_IMPLICATION
3531#undef DEFINE_WEAK_IMPLICATION
3532#undef DEFINE_NEG_IMPLICATION
3533#undef DEFINE_NEG_IMPLICATION_WITH_WARNING
3534#undef DEFINE_WEAK_NEG_IMPLICATION
3535#undef DEFINE_NEG_NEG_IMPLICATION
3536#undef DEFINE_NEG_VALUE_IMPLICATION
3537#undef DEFINE_NEG_VALUE_VALUE_IMPLICATION
3538#undef DEFINE_VALUE_IMPLICATION
3539#undef DEFINE_MIN_VALUE_IMPLICATION
3540#undef DEFINE_DISABLE_FLAG_IMPLICATION
3541#undef DEFINE_WEAK_VALUE_IMPLICATION
3542#undef DEFINE_GENERIC_IMPLICATION
3543#undef DEFINE_REQUIREMENT
3544#undef DEFINE_ALIAS_BOOL
3545#undef DEFINE_ALIAS_INT
3546#undef DEFINE_ALIAS_STRING
3547#undef DEFINE_ALIAS_FLOAT
3548
3549#undef FLAG_MODE_DECLARE
3550#undef FLAG_MODE_DEFINE_DEFAULTS
3551#undef FLAG_MODE_META
3552#undef FLAG_MODE_DEFINE_IMPLICATIONS
3553#undef FLAG_MODE_APPLY
Schedule * schedule
#define one
interpreter::OperandScale scale
Definition builtins.cc:44
#define V8_EXTERNAL_CODE_SPACE_BOOL
Definition globals.h:255
#define V8_DICT_PROPERTY_CONST_TRACKING_BOOL
Definition globals.h:249
#define COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL
Definition globals.h:111
#define V8_DEFAULT_STACK_SIZE_KB
Definition globals.h:191
#define DEBUG_BOOL
Definition globals.h:87
int start
ZoneVector< OpIndex > candidates
LineAndColumn previous
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation speed
#define DEFINE_PERF_PROF_IMPLICATION(...)
#define DEFINE_WEAK_NEG_IMPLICATION(whenflag, thenflag)
#define DEFINE_IMPLICATION(whenflag, thenflag)
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and X(inclusive) percent " "of the regular marking start limit") DEFINE_INT(stress_scavenge
#define DEFINE_UINT64(nam, def, cmt)
#define FUTURE_BOOL
too high values may cause the compiler to hit(release) assertions") DEFINE_BOOL(stress_inline
#define JAVASCRIPT_INPROGRESS_FEATURES(V)
#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value)
#define DEFINE_MIN_VALUE_IMPLICATION(flag, min_value)
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long enable use of partial constant pools(x64 only)") DEFINE_STRING(sim_arm64_optional_features
#define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag)
Implies all staged features that we want to ship in the not too far future enable maglev features that we want to ship in the not too far future enable inlining in the maglev optimizing compiler enable aggressive optimizations for loops(loop SPeeling) in the " "maglev optimizing compiler") DEFINE_INT(maglev_loop_peeling_max_size
#define DEFINE_DEBUG_BOOL
#define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL
#define DEFAULT_SCAVENGER_MAX_NEW_SPACE_CAPACITY_MB
#define LOG_FLAGS(V)
#define ARM_ARCH_DEFAULT
#define DEFINE_BOOL(nam, def, cmt)
#define DEFAULT_PERF_PROF_PATH
#define DEFINE_ALIAS_BOOL(alias, nam)
#define V8_SINGLE_GENERATION_BOOL
#define DEFINE_INT(nam, def, cmt)
#define DEFINE_SIZE_T(nam, def, cmt)
#define DEFINE_NEG_VALUE_VALUE_IMPLICATION(whenflag, whenvalue, thenflag, thenvalue)
#define V8_LAZY_SOURCE_POSITIONS_BOOL
#define DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, value)
#define HARMONY_SHIPPING(V)
#define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL
#define DEFINE_GENERIC_IMPLICATION(whenflag, statement)
#define DEFINE_MAYBE_BOOL(nam, cmt)
#define FLAG_INPROGRESS_FEATURES(id, description)
#define V8_ENABLE_LOCAL_OFF_STACK_CHECK_BOOL
#define V8_CET_SHADOW_STACK_BOOL
#define JAVASCRIPT_STAGED_FEATURES(V)
#define DEFINE_UINT(nam, def, cmt)
#define V8_DISABLE_WRITE_BARRIERS_BOOL
#define V8_SHORT_BUILTIN_CALLS_BOOL
#define FLAG_SHIPPING_FEATURES(id, description)
#define ENABLE_SPARKPLUG_BY_DEFAULT
#define SET_IMPLICATIONS(V)
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use Turbolev(≈ Maglev+Turboshaft combined) as the 4th tier " "compiler instead of Turbofan") DEFINE_EXPERIMENTAL_FEATURE( turbolev_future
#define DEFAULT_MAX_POLYMORPHIC_MAP_COUNT
#define DEFINE_PERF_PROF_BOOL(nam, cmt)
#define HARMONY_INPROGRESS(V)
#define DEFINE_WEAK_IMPLICATION(whenflag, thenflag)
#define V8_ENABLE_DIRECT_HANDLE_BOOL
#define V8_ENABLE_BLACK_ALLOCATED_PAGES_BOOL
#define DEFINE_BOOL_READONLY(nam, def, cmt)
#define V8_ENABLE_STICKY_MARK_BITS_BOOL
#define V8_ALLOCATION_FOLDING_BOOL
#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value)
#define V8_ALLOCATION_SITE_TRACKING_BOOL
#define JAVASCRIPT_SHIPPING_FEATURES(V)
#define DEFINE_REQUIREMENT(statement)
#define DEFAULT_PERF_BASIC_PROF_PATH
#define DEFAULT_PROF_SAMPLING_INTERVAL
#define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL
too high values may cause the compiler to set high thresholds for inlining to as much as possible max_inlined_bytecode_size_absolute
#define DEFINE_EXPERIMENTAL_FEATURE(nam, cmt)
#define FLAG_STAGED_FEATURES(id, description)
#define HARMONY_STAGED(V)
#define DEFINE_STRING(nam, def, cmt)
use conservative stack scanning use direct handles with conservative stack scanning Treat some precise references as conservative references to stress test object pinning in Scavenger minor_gc_task Enables random stressing of object pinning in Scavenger
#define V8_MINOR_MS_CONCURRENT_MARKING_MIN_CAPACITY_DEFAULT
#define DEFINE_SLOW_TRACING_BOOL
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long enable use of partial constant none
#define DEFINE_DISABLE_FLAG_IMPLICATION(whenflag, thenflag)
#define DEFINE_NEG_IMPLICATION(whenflag, thenflag)
#define ENABLE_LOG_COLOUR
#define V8_LITE_MODE_BOOL
#define DEFINE_FLOAT(nam, def, cmt)
JSHeapBroker * broker
std::string extension
TNode< Object > receiver
bool defined
ZoneVector< RpoNumber > & result
ZoneVector< Entry > entries
std::optional< OolTrapLabel > trap
int x
std::vector< Point > points
#define API(name, Name)
size_t priority
STL namespace.
Definition c-api.cc:87
BodyGen * gen
#define CHECK(condition)
Definition logging.h:124
Symbol statement
#define FOREACH_WASM_STAGING_FEATURE_FLAG(V)
#define FOREACH_WASM_SHIPPED_FEATURE_FLAG(V)
#define FOREACH_WASM_EXPERIMENTAL_FEATURE_FLAG(V)