15 #define DEFINE_IMPLICATION(whenflag, thenflag) \ 16 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, true) 18 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \ 19 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false) 21 #define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \ 22 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false) 27 #if defined(FLAG_MODE_DECLARE) 28 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 29 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; 30 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 31 static constexpr ctype FLAG_##nam = def; 35 #elif defined(FLAG_MODE_DEFINE) 36 #ifdef USING_V8_SHARED 37 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 38 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; 40 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 41 V8_EXPORT_PRIVATE ctype FLAG_##nam = def; 47 #elif defined(FLAG_MODE_DEFINE_DEFAULTS) 48 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 49 static constexpr ctype FLAGDEFAULT_##nam = def; 53 #elif defined(FLAG_MODE_META) 54 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 55 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false } \ 57 #define FLAG_ALIAS(ftype, ctype, alias, nam) \ 59 Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \ 60 "alias for --" #nam, false \ 65 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 66 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \ 67 if (FLAG_##whenflag) FLAG_##thenflag = value; 69 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \ 70 if (!FLAG_##whenflag) FLAG_##thenflag = value; 73 #error No mode supplied when including flags.defs 78 #define FLAG_FULL(ftype, ctype, nam, def, cmt) 82 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 86 #define FLAG_ALIAS(ftype, ctype, alias, nam) 89 #ifndef DEFINE_VALUE_IMPLICATION 90 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) 93 #ifndef DEFINE_NEG_VALUE_IMPLICATION 94 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) 99 #ifdef FLAG_MODE_DECLARE 101 struct MaybeBoolFlag {
102 static MaybeBoolFlag Create(
bool has_value,
bool value) {
104 flag.has_value = has_value;
114 #define DEBUG_BOOL true 116 #define DEBUG_BOOL false 124 #if !defined(ARM_TEST_NO_FEATURE_PROBE) || \ 125 (defined(CAN_USE_ARMV8_INSTRUCTIONS) && \ 126 defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 127 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)) 128 #define ARM_ARCH_DEFAULT "armv8" 129 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 130 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS) 131 #define ARM_ARCH_DEFAULT "armv7+sudiv" 132 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_NEON) && \ 133 defined(CAN_USE_VFP3_INSTRUCTIONS) 134 #define ARM_ARCH_DEFAULT "armv7" 136 #define ARM_ARCH_DEFAULT "armv6" 140 # define ENABLE_LOG_COLOUR false 142 # define ENABLE_LOG_COLOUR true 145 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 146 #define DEFINE_BOOL_READONLY(nam, def, cmt) \ 147 FLAG_READONLY(BOOL, bool, nam, def, cmt) 148 #define DEFINE_MAYBE_BOOL(nam, cmt) \ 149 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt) 150 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 151 #define DEFINE_UINT(nam, def, cmt) FLAG(UINT, unsigned int, nam, def, cmt) 152 #define DEFINE_UINT64(nam, def, cmt) FLAG(UINT64, uint64_t, nam, def, cmt) 153 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 154 #define DEFINE_SIZE_T(nam, def, cmt) FLAG(SIZE_T, size_t, nam, def, cmt) 155 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 156 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) 157 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam) 158 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) 159 #define DEFINE_ALIAS_SIZE_T(alias, nam) FLAG_ALIAS(SIZE_T, size_t, alias, nam) 160 #define DEFINE_ALIAS_STRING(alias, nam) \ 161 FLAG_ALIAS(STRING, const char*, alias, nam) 164 #define DEFINE_DEBUG_BOOL DEFINE_BOOL 166 #define DEFINE_DEBUG_BOOL DEFINE_BOOL_READONLY 172 #define FLAG FLAG_FULL 174 DEFINE_BOOL(experimental_extras,
false,
175 "enable code compiled in via v8_experimental_extra_library_files")
178 DEFINE_BOOL(use_strict, false, "enforce strict mode")
180 DEFINE_BOOL(es_staging, false,
181 "enable test-worthy harmony features (for internal use only)")
182 DEFINE_BOOL(harmony, false, "enable all completed harmony features")
183 DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
184 DEFINE_IMPLICATION(es_staging, harmony)
186 DEFINE_IMPLICATION(harmony_import_meta, harmony_dynamic_import)
188 DEFINE_IMPLICATION(harmony_class_fields, harmony_public_fields)
189 DEFINE_IMPLICATION(harmony_class_fields, harmony_static_fields)
190 DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
192 DEFINE_IMPLICATION(harmony_private_methods, harmony_private_fields)
197 #define HARMONY_INPROGRESS_BASE(V) \ 198 V(harmony_class_fields, "harmony fields in class literals") \ 199 V(harmony_await_optimization, "harmony await taking 1 tick") \ 200 V(harmony_private_methods, "harmony private methods in class literals") \ 201 V(harmony_regexp_sequence, "RegExp Unicode sequence properties") \ 202 V(harmony_weak_refs, "harmony weak references") \ 203 V(harmony_object_from_entries, "harmony Object.fromEntries()") 205 #ifdef V8_INTL_SUPPORT 206 #define HARMONY_INPROGRESS(V) \ 207 HARMONY_INPROGRESS_BASE(V) \ 208 V(harmony_locale, "Intl.Locale") 210 #define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) 214 #define HARMONY_STAGED_BASE(V) \ 215 V(harmony_private_fields, "harmony private fields in class literals") \ 216 V(harmony_numeric_separator, "harmony numeric separator between digits") \ 217 V(harmony_string_matchall, "harmony String.prototype.matchAll") 219 #ifdef V8_INTL_SUPPORT 220 #define HARMONY_STAGED(V) \ 221 HARMONY_STAGED_BASE(V) \ 222 V(harmony_intl_segmenter, "Intl.Segmenter") 224 #define HARMONY_STAGED(V) HARMONY_STAGED_BASE(V) 228 #define HARMONY_SHIPPING_BASE(V) \ 229 V(harmony_namespace_exports, \ 230 "harmony namespace exports (export * as foo from 'bar')") \ 231 V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ 232 V(harmony_import_meta, "harmony import.meta property") \ 233 V(harmony_dynamic_import, "harmony dynamic import") \ 234 V(harmony_array_prototype_values, "harmony Array.prototype.values") \ 235 V(harmony_array_flat, "harmony Array.prototype.{flat,flatMap}") \ 236 V(harmony_symbol_description, "harmony Symbol.prototype.description") \ 237 V(harmony_global, "harmony global") \ 238 V(harmony_json_stringify, "well-formed JSON.stringify") \ 239 V(harmony_public_fields, "harmony public instance fields in class literals") \ 240 V(harmony_static_fields, "harmony static fields in class literals") 242 #ifdef V8_INTL_SUPPORT 243 #define HARMONY_SHIPPING(V) \ 244 HARMONY_SHIPPING_BASE(V) \ 245 V(harmony_intl_list_format, "Intl.ListFormat") \ 246 V(harmony_intl_relative_time_format, "Intl.RelativeTimeFormat") 248 #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) 257 #define FLAG_INPROGRESS_FEATURES(id, description) \ 258 DEFINE_BOOL(id, false, "enable " #description " (in progress)") 259 HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES)
260 #undef FLAG_INPROGRESS_FEATURES 262 #define FLAG_STAGED_FEATURES(id, description) \ 263 DEFINE_BOOL(id, false, "enable " #description) \ 264 DEFINE_IMPLICATION(harmony, id) 265 HARMONY_STAGED(FLAG_STAGED_FEATURES)
266 #undef FLAG_STAGED_FEATURES 268 #define FLAG_SHIPPING_FEATURES(id, description) \ 269 DEFINE_BOOL(id, true, "enable " #description) \ 270 DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id) 271 HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES)
272 #undef FLAG_SHIPPING_FEATURES 274 #ifdef V8_INTL_SUPPORT 275 DEFINE_BOOL(icu_timezone_data,
true,
"get information about timezones from ICU")
278 #ifdef V8_ENABLE_FUTURE 279 #define FUTURE_BOOL true 281 #define FUTURE_BOOL false 283 DEFINE_BOOL(future, FUTURE_BOOL,
284 "Implies all staged features that we want to ship in the " 285 "not-too-far future")
287 DEFINE_IMPLICATION(future, write_protect_code_memory)
290 DEFINE_BOOL(allocation_site_pretenuring, true,
291 "pretenure with allocation sites")
292 DEFINE_BOOL(page_promotion, true, "promote pages based on utilization")
293 DEFINE_INT(page_promotion_threshold, 70,
294 "min percentage of live bytes on a page to enable fast evacuation")
295 DEFINE_BOOL(trace_pretenuring, false,
296 "trace pretenuring decisions of HAllocate instructions")
297 DEFINE_BOOL(trace_pretenuring_statistics, false,
298 "trace allocation site pretenuring statistics")
299 DEFINE_BOOL(track_fields, true, "track fields with only smi values")
300 DEFINE_BOOL(track_double_fields, true, "track fields with
double values")
301 DEFINE_BOOL(track_heap_object_fields, true, "track fields with heap values")
302 DEFINE_BOOL(track_computed_fields, true, "track computed boilerplate fields")
303 DEFINE_IMPLICATION(track_double_fields, track_fields)
304 DEFINE_IMPLICATION(track_heap_object_fields, track_fields)
305 DEFINE_IMPLICATION(track_computed_fields, track_fields)
306 DEFINE_BOOL(track_field_types, true, "track field types")
307 DEFINE_IMPLICATION(track_field_types, track_fields)
308 DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
309 DEFINE_BOOL(trace_block_coverage, false,
310 "trace collected block coverage information")
311 DEFINE_BOOL(feedback_normalization, false,
312 "feed back normalization to constructors")
314 DEFINE_BOOL_READONLY(internalize_on_the_fly, true,
315 "internalize
string keys for generic keyed ICs on the fly")
318 DEFINE_BOOL(enable_one_shot_optimization, true,
319 "Enable size optimizations for the code that will "
320 "only be executed once")
324 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
325 DEFINE_BOOL_READONLY(string_slices, true, "use
string slices")
329 #ifndef V8_USE_SNAPSHOT 330 #define FLAG FLAG_FULL 332 #define FLAG FLAG_READONLY 334 DEFINE_INT(interrupt_budget, 144 * KB,
335 "interrupt budget which should be used for the profiler counter")
337 #define FLAG FLAG_FULL 340 DEFINE_BOOL(ignition_elide_noneffectful_bytecodes,
true,
341 "elide bytecodes which won't have any external effect")
342 DEFINE_BOOL(ignition_reo, true, "use ignition register equivalence optimizer")
343 DEFINE_BOOL(ignition_filter_expression_positions, true,
344 "filter expression positions before the bytecode pipeline")
345 DEFINE_BOOL(ignition_share_named_property_feedback, true,
346 "share feedback slots when loading the same named property from "
348 DEFINE_BOOL(print_bytecode, false,
349 "print bytecode generated by ignition interpreter")
350 DEFINE_STRING(print_bytecode_filter, "*",
351 "filter for selecting which functions to print bytecode")
352 #ifdef V8_TRACE_IGNITION 353 DEFINE_BOOL(trace_ignition,
false,
354 "trace the bytecodes executed by the ignition interpreter")
356 #ifdef V8_TRACE_FEEDBACK_UPDATES 358 trace_feedback_updates,
false,
359 "trace updates to feedback vectors during ignition interpreter execution.")
361 DEFINE_BOOL(trace_ignition_codegen,
false,
362 "trace the codegen of ignition interpreter bytecode handlers")
363 DEFINE_BOOL(trace_ignition_dispatches, false,
364 "traces the dispatches to bytecode handlers by the ignition "
366 DEFINE_STRING(trace_ignition_dispatches_output_file,
nullptr,
367 "the file to which the bytecode handler dispatch table is "
368 "written (by default, the table is not written to a file)")
370 DEFINE_BOOL(fast_math, true, "faster (but maybe less accurate) math functions")
371 DEFINE_BOOL(trace_track_allocation_sites, false,
372 "trace the tracking of allocation sites")
373 DEFINE_BOOL(trace_migration, false, "trace
object migration")
374 DEFINE_BOOL(trace_generalization, false, "trace map generalization")
377 DEFINE_BOOL(concurrent_recompilation, true,
378 "optimizing hot functions asynchronously on a separate thread")
379 DEFINE_BOOL(trace_concurrent_recompilation, false,
380 "track concurrent recompilation")
381 DEFINE_INT(concurrent_recompilation_queue_length, 8,
382 "the length of the concurrent compilation queue")
383 DEFINE_INT(concurrent_recompilation_delay, 0,
384 "artificial compilation delay in ms")
385 DEFINE_BOOL(block_concurrent_recompilation, false,
386 "block queued jobs until released")
387 DEFINE_BOOL(concurrent_inlining, false,
388 "run optimizing compiler's inlining phase on a separate thread")
389 DEFINE_IMPLICATION(future, concurrent_inlining)
390 DEFINE_BOOL(trace_heap_broker, false, "trace the heap broker")
393 DEFINE_INT(stress_runs, 0, "number of stress runs")
394 DEFINE_INT(deopt_every_n_times, 0,
395 "deoptimize every n times a deopt point is passed")
396 DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points")
399 DEFINE_BOOL(turbo_sp_frame_access, false,
400 "use stack pointer-relative access to frame wherever possible")
401 DEFINE_BOOL(turbo_preprocess_ranges, true,
402 "run pre-register allocation heuristics")
403 DEFINE_STRING(turbo_filter, "*", "optimization filter for TurboFan compiler")
404 DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR")
405 DEFINE_STRING(trace_turbo_path,
nullptr,
406 "directory to dump generated TurboFan IR to")
407 DEFINE_STRING(trace_turbo_filter, "*",
408 "filter for tracing turbofan compilation")
409 DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs")
410 DEFINE_BOOL(trace_turbo_scheduled, false, "trace TurboFan IR with schedule")
411 DEFINE_IMPLICATION(trace_turbo_scheduled, trace_turbo_graph)
412 DEFINE_STRING(trace_turbo_cfg_file,
nullptr,
413 "trace turbo cfg graph (for C1 visualizer) to a given file name")
414 DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types")
415 DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler")
416 DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers")
417 DEFINE_BOOL(trace_turbo_trimming, false, "trace TurboFan's graph trimmer")
418 DEFINE_BOOL(trace_turbo_jt, false, "trace TurboFan's jump threading")
419 DEFINE_BOOL(trace_turbo_ceq, false, "trace TurboFan's control equivalence")
420 DEFINE_BOOL(trace_turbo_loop, false, "trace TurboFan's loop optimizations")
421 DEFINE_BOOL(trace_alloc, false, "trace register allocator")
422 DEFINE_BOOL(trace_all_uses, false, "trace all use positions")
423 DEFINE_BOOL(trace_representation, false, "trace representation types")
424 DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase")
425 DEFINE_STRING(turbo_verify_machine_graph,
nullptr,
426 "verify TurboFan machine graph before instruction selection")
427 #ifdef ENABLE_VERIFY_CSA 428 DEFINE_BOOL(verify_csa, DEBUG_BOOL,
429 "verify TurboFan machine graph of code stubs")
433 DEFINE_BOOL_READONLY(verify_csa,
false,
434 "verify TurboFan machine graph of code stubs")
436 DEFINE_BOOL(trace_verify_csa,
false,
"trace code stubs verification")
437 DEFINE_STRING(csa_trap_on_node,
nullptr,
438 "trigger break point when a node with given
id is created in "
439 "given stub. The format is: StubName,NodeId")
440 DEFINE_BOOL_READONLY(optimize_csa, true,
441 "run the optimizing Turbofan backend in the CSA pipeline")
442 DEFINE_NEG_IMPLICATION(optimize_csa, turbo_rewrite_far_jumps)
443 DEFINE_BOOL_READONLY(fixed_array_bounds_checks, DEBUG_BOOL,
444 "enable FixedArray bounds checks")
445 DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
446 DEFINE_BOOL(turbo_stats_nvp, false,
447 "print TurboFan statistics in machine-readable format")
448 DEFINE_BOOL(turbo_stats_wasm, false,
449 "print TurboFan statistics of wasm compilations")
450 DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan")
451 DEFINE_BOOL(function_context_specialization, false,
452 "enable function context specialization in TurboFan")
453 DEFINE_BOOL(turbo_inlining, true, "enable inlining in TurboFan")
454 DEFINE_INT(max_inlined_bytecode_size, 500,
455 "maximum size of bytecode for a single inlining")
456 DEFINE_INT(max_inlined_bytecode_size_cumulative, 1000,
457 "maximum cumulative size of bytecode considered for inlining")
458 DEFINE_INT(max_inlined_bytecode_size_absolute, 5000,
459 "maximum cumulative size of bytecode considered for inlining")
460 DEFINE_FLOAT(reserve_inline_budget_scale_factor, 1.2,
461 "maximum cumulative size of bytecode considered for inlining")
462 DEFINE_INT(max_inlined_bytecode_size_small, 30,
463 "maximum size of bytecode considered for small function inlining")
464 DEFINE_FLOAT(min_inlining_frequency, 0.15, "minimum frequency for inlining")
465 DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining")
466 DEFINE_BOOL(stress_inline, false,
467 "set high thresholds for inlining to inline as much as possible")
468 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size, 999999)
469 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_cumulative,
471 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_absolute,
473 DEFINE_VALUE_IMPLICATION(stress_inline, min_inlining_frequency, 0)
474 DEFINE_VALUE_IMPLICATION(stress_inline, polymorphic_inlining, true)
475 DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
476 DEFINE_BOOL(inline_accessors, true, "inline JavaScript accessors")
477 DEFINE_BOOL(inline_into_try, true, "inline into try blocks")
478 DEFINE_BOOL(turbo_inline_array_builtins, true,
479 "inline array builtins in TurboFan code")
480 DEFINE_BOOL(use_osr, true, "use on-stack replacement")
481 DEFINE_BOOL(trace_osr, false, "trace on-stack replacement")
482 DEFINE_BOOL(analyze_environment_liveness, true,
483 "analyze liveness of environment slots and zap dead values")
484 DEFINE_BOOL(trace_environment_liveness, false,
485 "trace liveness of local variable slots")
486 DEFINE_BOOL(turbo_load_elimination, true, "enable load elimination in TurboFan")
487 DEFINE_BOOL(trace_turbo_load_elimination, false,
488 "trace TurboFan load elimination")
489 DEFINE_BOOL(turbo_profiling, false, "enable profiling in TurboFan")
490 DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL,
491 "verify register allocation in TurboFan")
492 DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan")
493 DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan")
494 DEFINE_BOOL(turbo_loop_peeling, true, "Turbofan loop peeling")
495 DEFINE_BOOL(turbo_loop_variable, true, "Turbofan loop variable optimization")
496 DEFINE_BOOL(turbo_loop_rotation, true, "Turbofan loop rotation")
497 DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan")
498 DEFINE_BOOL(turbo_escape, true, "enable escape analysis")
499 DEFINE_BOOL(turbo_allocation_folding, true, "Turbofan allocation folding")
500 DEFINE_BOOL(turbo_instruction_scheduling, false,
501 "enable instruction scheduling in TurboFan")
502 DEFINE_BOOL(turbo_stress_instruction_scheduling, false,
503 "randomly schedule instructions to stress dependency tracking")
504 DEFINE_BOOL(turbo_store_elimination, true,
505 "enable store-store elimination in TurboFan")
506 DEFINE_BOOL(trace_store_elimination, false, "trace store elimination")
507 DEFINE_BOOL(turbo_rewrite_far_jumps, true,
508 "rewrite far to near jumps (ia32,x64)")
509 DEFINE_BOOL(experimental_inline_promise_constructor, true,
510 "inline the Promise constructor in TurboFan")
512 #ifdef DISABLE_UNTRUSTED_CODE_MITIGATIONS 513 #define V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS false 515 #define V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS true 517 DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS,
518 "Enable mitigations for executing untrusted code")
519 #undef V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS 522 DEFINE_BOOL(expose_wasm,
true,
"expose wasm interface to JavaScript")
523 DEFINE_BOOL(assume_asmjs_origin, false,
524 "force wasm decoder to assume input is internal asm-wasm format")
525 DEFINE_BOOL(wasm_disable_structured_cloning, false,
526 "disable wasm structured cloning")
527 DEFINE_INT(wasm_num_compilation_tasks, 10,
528 "number of parallel compilation tasks for wasm")
529 DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
530 "trace wasm native heap events")
531 DEFINE_BOOL(wasm_write_protect_code_memory, false,
532 "write protect code memory on the wasm native heap")
533 DEFINE_BOOL(trace_wasm_serialization, false,
534 "trace serialization/deserialization")
535 DEFINE_BOOL(wasm_async_compilation, true,
536 "enable actual asynchronous compilation for WebAssembly.compile")
537 DEFINE_BOOL(wasm_test_streaming, false,
538 "use streaming compilation instead of async compilation for tests")
539 DEFINE_UINT(wasm_max_mem_pages,
v8::internal::wasm::kV8MaxWasmMemoryPages,
540 "maximum number of 64KiB memory pages of a wasm instance")
541 DEFINE_UINT(wasm_max_table_size,
v8::internal::wasm::kV8MaxWasmTableSize,
542 "maximum table size of a wasm instance")
545 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 548 "enable wasm baseline compilation and tier up to the optimizing compiler")
552 "enable wasm baseline compilation and tier up to the optimizing compiler")
553 DEFINE_IMPLICATION(future, wasm_tier_up)
555 DEFINE_IMPLICATION(wasm_tier_up, liftoff)
556 DEFINE_DEBUG_BOOL(trace_wasm_decoder,
false,
"trace decoding of wasm code")
557 DEFINE_DEBUG_BOOL(trace_wasm_decode_time, false,
558 "trace decoding time of wasm code")
559 DEFINE_DEBUG_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code")
560 DEFINE_DEBUG_BOOL(trace_wasm_interpreter, false,
561 "trace interpretation of wasm code")
562 DEFINE_DEBUG_BOOL(trace_wasm_streaming, false,
563 "trace streaming compilation of wasm code")
564 DEFINE_INT(trace_wasm_ast_start, 0,
565 "start function for wasm AST trace (inclusive)")
566 DEFINE_INT(trace_wasm_ast_end, 0, "end function for wasm AST trace (exclusive)")
567 DEFINE_BOOL(liftoff, false,
568 "enable Liftoff, the baseline compiler for WebAssembly")
569 DEFINE_DEBUG_BOOL(trace_liftoff, false,
570 "trace Liftoff, the baseline compiler for WebAssembly")
571 DEFINE_DEBUG_BOOL(wasm_break_on_decoder_error, false,
572 "debug break when wasm decoder encounters an error")
573 DEFINE_BOOL(trace_wasm_memory, false,
574 "print all memory updates performed in wasm code")
577 DEFINE_INT(wasm_tier_mask_for_testing, 0,
578 "bitmask of functions to compile with TurboFan instead of Liftoff")
580 DEFINE_BOOL(validate_asm, true, "validate asm.js modules before compiling")
581 DEFINE_BOOL(suppress_asm_messages, false,
582 "don't emit asm.js related messages (for golden file testing)")
583 DEFINE_BOOL(trace_asm_time, false, "log asm.js timing info to the console")
584 DEFINE_BOOL(trace_asm_scanner, false,
585 "log tokens encountered by asm.js scanner")
586 DEFINE_BOOL(trace_asm_parser, false, "verbose logging of asm.js parse failures")
587 DEFINE_BOOL(stress_validate_asm, false, "try to validate everything as asm.js")
589 DEFINE_DEBUG_BOOL(dump_wasm_module, false, "dump wasm module bytes")
590 DEFINE_STRING(dump_wasm_module_path,
nullptr,
591 "directory to dump wasm modules to")
596 #include "src/wasm/wasm-feature-flags.h" 599 #define DECL_WASM_FLAG(feat, desc, val) \ 600 DEFINE_BOOL(experimental_wasm_##feat, val, \ 601 "enable prototype " desc " for wasm") 602 FOREACH_WASM_FEATURE_FLAG(DECL_WASM_FLAG, SPACE)
603 #undef DECL_WASM_FLAG 606 DEFINE_BOOL(wasm_opt,
false,
"enable wasm optimization")
607 DEFINE_BOOL(wasm_no_bounds_checks, false,
608 "disable bounds checks (performance testing only)")
609 DEFINE_BOOL(wasm_no_stack_checks, false,
610 "disable stack checks (performance testing only)")
611 DEFINE_BOOL(wasm_math_intrinsics, true,
612 "intrinsify some Math imports into wasm")
614 DEFINE_BOOL(wasm_shared_engine, true,
615 "shares one wasm engine between all isolates within a process")
616 DEFINE_IMPLICATION(future, wasm_shared_engine)
617 DEFINE_BOOL(wasm_shared_code, true,
618 "shares code underlying a wasm module when it is transferred")
619 DEFINE_IMPLICATION(future, wasm_shared_code)
620 DEFINE_BOOL(wasm_trap_handler, true,
621 "use signal handlers to catch out of bounds memory access in wasm"
622 " (currently Linux x86_64 only)")
623 DEFINE_BOOL(wasm_trap_handler_fallback, false,
624 "Use bounds checks if guarded memory is not available")
625 DEFINE_BOOL(wasm_fuzzer_gen_test, false,
626 "Generate a test case when running a wasm fuzzer")
627 DEFINE_IMPLICATION(wasm_fuzzer_gen_test, single_threaded)
628 DEFINE_BOOL(print_wasm_code, false, "Print WebAssembly code")
629 DEFINE_BOOL(wasm_interpret_all, false,
630 "Execute all wasm code in the wasm interpreter")
631 DEFINE_BOOL(asm_wasm_lazy_compilation, false,
632 "enable lazy compilation for asm-wasm modules")
633 DEFINE_IMPLICATION(validate_asm, asm_wasm_lazy_compilation)
634 DEFINE_BOOL(wasm_lazy_compilation, false,
635 "enable lazy compilation for all wasm modules")
636 DEFINE_DEBUG_BOOL(trace_wasm_lazy_compilation, false,
637 "trace lazy compilation of wasm functions")
639 DEFINE_NEG_IMPLICATION(wasm_interpret_all, asm_wasm_lazy_compilation)
640 DEFINE_NEG_IMPLICATION(wasm_interpret_all, wasm_lazy_compilation)
643 DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
644 DEFINE_INT(type_info_threshold, 25,
645 "percentage of ICs that must have type info to allow optimization")
647 DEFINE_INT(stress_sampling_allocation_profiler, 0,
648 "Enables sampling allocation profiler with X as a sample interval")
651 DEFINE_SIZE_T(min_semi_space_size, 0,
652 "min size of a semi-space (in MBytes), the new space consists of "
654 DEFINE_SIZE_T(max_semi_space_size, 0,
655 "max size of a semi-space (in MBytes), the new space consists of "
657 DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
658 DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
659 "Grow the new space based on the percentage of survivors instead "
660 "of their absolute value.")
661 DEFINE_SIZE_T(max_old_space_size, 0, "max size of the old space (in Mbytes)")
662 DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)")
663 DEFINE_BOOL(gc_global, false, "always perform global GCs")
664 DEFINE_INT(random_gc_interval, 0,
665 "Collect garbage after random(0, X) allocations. It overrides "
667 DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
668 DEFINE_INT(retain_maps_for_n_gc, 2,
669 "keeps maps alive for <n> old space garbage collections")
670 DEFINE_BOOL(trace_gc, false,
671 "print one trace line following each garbage collection")
672 DEFINE_BOOL(trace_gc_nvp, false,
673 "print one detailed trace line in name=value format "
674 "after each garbage collection")
675 DEFINE_BOOL(trace_gc_ignore_scavenger, false,
676 "do not print trace line after scavenger collection")
677 DEFINE_BOOL(trace_idle_notification, false,
678 "print one trace line following each idle notification")
679 DEFINE_BOOL(trace_idle_notification_verbose, false,
680 "prints the heap state used by the idle notification")
681 DEFINE_BOOL(trace_gc_verbose, false,
682 "print more details following each garbage collection")
683 DEFINE_INT(trace_allocation_stack_interval, -1,
684 "print stack trace after <n> free-list allocations")
685 DEFINE_INT(trace_duplicate_threshold_kb, 0,
686 "print duplicate objects in the heap if their size is more than "
688 DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space")
689 DEFINE_BOOL(trace_fragmentation_verbose, false,
690 "report fragmentation for old space (detailed)")
691 DEFINE_BOOL(trace_evacuation, false, "report evacuation statistics")
692 DEFINE_BOOL(trace_mutator_utilization, false,
693 "print mutator utilization, allocation speed, gc speed")
694 DEFINE_BOOL(incremental_marking, true, "use incremental marking")
695 DEFINE_BOOL(incremental_marking_wrappers, true,
696 "use incremental marking for marking wrappers")
697 DEFINE_BOOL(trace_unmapper, false, "Trace the unmapping")
698 DEFINE_BOOL(parallel_scavenge, true, "parallel scavenge")
699 DEFINE_BOOL(trace_parallel_scavenge, false, "trace parallel scavenge")
700 #if defined(V8_TARGET_ARCH_ARM) 701 #define V8_WRITE_PROTECT_CODE_MEMORY_BOOL false 703 #define V8_WRITE_PROTECT_CODE_MEMORY_BOOL true 705 DEFINE_BOOL(write_protect_code_memory, V8_WRITE_PROTECT_CODE_MEMORY_BOOL,
706 "write protect code memory")
707 #ifdef V8_CONCURRENT_MARKING 708 #define V8_CONCURRENT_MARKING_BOOL true 710 #define V8_CONCURRENT_MARKING_BOOL false 712 DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING_BOOL,
713 "use concurrent marking")
714 DEFINE_BOOL(parallel_marking, true, "use parallel marking in atomic pause")
715 DEFINE_INT(ephemeron_fixpoint_iterations, 10,
716 "number of fixpoint iterations it takes to switch to linear "
717 "ephemeron algorithm")
718 DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking")
719 DEFINE_BOOL(black_allocation, true, "use black allocation")
720 DEFINE_BOOL(concurrent_store_buffer, true,
721 "use concurrent store buffer processing")
722 DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
723 DEFINE_BOOL(parallel_compaction, true, "use parallel compaction")
724 DEFINE_BOOL(parallel_pointer_update, true,
725 "use parallel pointer update during compaction")
726 DEFINE_BOOL(detect_ineffective_gcs_near_heap_limit, true,
727 "trigger out-of-memory failure to avoid GC storm near heap limit")
728 DEFINE_BOOL(trace_incremental_marking, false,
729 "trace progress of the incremental marking")
730 DEFINE_BOOL(trace_stress_marking, false, "trace stress marking progress")
731 DEFINE_BOOL(trace_stress_scavenge, false, "trace stress scavenge progress")
732 DEFINE_BOOL(track_gc_object_stats, false,
733 "track
object counts and memory usage")
734 DEFINE_BOOL(trace_gc_object_stats, false,
735 "trace
object counts and memory usage")
736 DEFINE_BOOL(trace_zone_stats, false, "trace zone memory usage")
737 DEFINE_BOOL(track_retaining_path, false,
738 "enable support for tracking retaining path")
739 DEFINE_BOOL(concurrent_array_buffer_freeing, true,
740 "free array buffer allocations on a background thread")
741 DEFINE_INT(gc_stats, 0, "Used by tracing internally to enable gc statistics")
742 DEFINE_IMPLICATION(trace_gc_object_stats, track_gc_object_stats)
743 DEFINE_VALUE_IMPLICATION(track_gc_object_stats, gc_stats, 1)
744 DEFINE_VALUE_IMPLICATION(trace_gc_object_stats, gc_stats, 1)
745 DEFINE_NEG_IMPLICATION(trace_gc_object_stats, incremental_marking)
746 DEFINE_NEG_IMPLICATION(track_retaining_path, incremental_marking)
747 DEFINE_NEG_IMPLICATION(track_retaining_path, parallel_marking)
748 DEFINE_NEG_IMPLICATION(track_retaining_path, concurrent_marking)
749 DEFINE_BOOL(track_detached_contexts, true,
750 "track native contexts that are expected to be garbage collected")
751 DEFINE_BOOL(trace_detached_contexts, false,
752 "trace native contexts that are expected to be garbage collected")
753 DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts)
755 DEFINE_BOOL(verify_heap,
false,
"verify heap pointers before and after GC")
756 DEFINE_BOOL(verify_heap_skip_remembered_set, false,
757 "disable remembered set verification")
759 DEFINE_BOOL(move_object_start,
true,
"enable moving of object starts")
760 DEFINE_BOOL(memory_reducer, true, "use memory reducer")
761 DEFINE_INT(heap_growing_percent, 0,
762 "specifies heap growing factor as (1 + heap_growing_percent/100)")
763 DEFINE_INT(v8_os_page_size, 0, "override OS page size (in KBytes)")
764 DEFINE_BOOL(always_compact, false, "Perform compaction on every full GC")
765 DEFINE_BOOL(never_compact, false,
766 "Never perform compaction on full GC - testing only")
767 DEFINE_BOOL(compact_code_space, true, "Compact code space on full collections")
768 DEFINE_BOOL(use_marking_progress_bar, true,
769 "Use a progress bar to scan large objects in increments when "
770 "incremental marking is active.")
771 DEFINE_BOOL(force_marking_deque_overflows, false,
772 "force overflows of marking deque by reducing it's size "
774 DEFINE_BOOL(stress_compaction, false,
775 "stress the GC compactor to flush out bugs (implies "
776 "--force_marking_deque_overflows)")
777 DEFINE_BOOL(stress_compaction_random, false,
778 "Stress GC compaction by selecting random percent of pages as "
779 "evacuation candidates. It overrides stress_compaction.")
780 DEFINE_BOOL(stress_incremental_marking, false,
781 "force incremental marking for small heaps and run it more often")
783 DEFINE_BOOL(fuzzer_gc_analysis, false,
784 "prints number of allocations and enables analysis mode for gc "
785 "fuzz testing, e.g. --stress-marking, --stress-scavenge")
786 DEFINE_INT(stress_marking, 0,
787 "force marking at random points between 0 and X (inclusive) percent "
788 "of the regular marking start limit")
789 DEFINE_INT(stress_scavenge, 0,
790 "force scavenge at random points between 0 and X (inclusive) "
791 "percent of the new space capacity")
792 DEFINE_IMPLICATION(fuzzer_gc_analysis, stress_marking)
793 DEFINE_IMPLICATION(fuzzer_gc_analysis, stress_scavenge)
795 DEFINE_BOOL(disable_abortjs, false, "disables AbortJS runtime function")
797 DEFINE_BOOL(manual_evacuation_candidates_selection, false,
798 "Test mode only flag. It allows an unit test to select evacuation "
799 "candidates pages (requires --stress_compaction).")
800 DEFINE_BOOL(fast_promotion_new_space, false,
801 "fast promote new space on high survival rates")
803 DEFINE_BOOL(clear_free_memory, false, "initialize free memory with 0")
805 DEFINE_BOOL(young_generation_large_objects, false,
806 "allocates large objects by default in the young generation large "
809 DEFINE_BOOL(idle_time_scavenge, true, "Perform scavenges in idle time.")
812 DEFINE_BOOL(debug_code, DEBUG_BOOL,
813 "generate extra code (assertions) for debugging")
814 DEFINE_BOOL(code_comments, false,
815 "emit comments in code disassembly; for more readable source "
816 "positions you should add --no-concurrent_recompilation")
817 DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available")
818 DEFINE_BOOL(enable_ssse3, true, "enable use of SSSE3 instructions if available")
819 DEFINE_BOOL(enable_sse4_1, true,
820 "enable use of SSE4.1 instructions if available")
821 DEFINE_BOOL(enable_sahf, true,
822 "enable use of SAHF instruction if available (X64 only)")
823 DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available")
824 DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available")
825 DEFINE_BOOL(enable_bmi1, true, "enable use of BMI1 instructions if available")
826 DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available")
827 DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available")
828 DEFINE_BOOL(enable_popcnt, true,
829 "enable use of POPCNT instruction if available")
830 DEFINE_STRING(arm_arch, ARM_ARCH_DEFAULT,
831 "generate instructions for the selected ARM architecture if "
832 "available: armv6, armv7, armv7+sudiv or armv8")
833 DEFINE_BOOL(force_long_branches, false,
834 "force all emitted branches to be in
long mode (MIPS/PPC only)")
835 DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu")
836 DEFINE_BOOL(partial_constant_pool, true,
837 "enable use of partial constant pools (X64 only)")
840 DEFINE_MAYBE_BOOL(enable_armv7, "deprecated (use --arm_arch instead)")
841 DEFINE_MAYBE_BOOL(enable_vfp3, "deprecated (use --arm_arch instead)")
842 DEFINE_MAYBE_BOOL(enable_32dregs, "deprecated (use --arm_arch instead)")
843 DEFINE_MAYBE_BOOL(enable_neon, "deprecated (use --arm_arch instead)")
844 DEFINE_MAYBE_BOOL(enable_sudiv, "deprecated (use --arm_arch instead)")
845 DEFINE_MAYBE_BOOL(enable_armv8, "deprecated (use --arm_arch instead)")
848 DEFINE_BOOL(enable_regexp_unaligned_accesses, true,
849 "enable unaligned accesses for the regexp engine")
852 DEFINE_BOOL(script_streaming, true, "enable parsing on background")
853 DEFINE_BOOL(disable_old_api_accessors, false,
854 "Disable old-style API accessors whose setters trigger through the "
858 DEFINE_STRING(expose_natives_as,
nullptr, "expose natives in global
object")
859 DEFINE_BOOL(expose_free_buffer, false, "expose freeBuffer extension")
860 DEFINE_BOOL(expose_gc, false, "expose gc extension")
861 DEFINE_STRING(expose_gc_as,
nullptr,
862 "expose gc extension under the specified name")
863 DEFINE_IMPLICATION(expose_gc_as, expose_gc)
864 DEFINE_BOOL(expose_externalize_string, false,
865 "expose externalize
string extension")
866 DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension")
867 DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture")
868 DEFINE_BOOL(builtins_in_stack_traces, false,
869 "show built-in functions in stack traces")
870 DEFINE_BOOL(disallow_code_generation_from_strings, false,
871 "disallow eval and friends")
872 DEFINE_BOOL(expose_async_hooks, false, "expose async_hooks
object")
875 DEFINE_BOOL(allow_unsafe_function_constructor, false,
876 "allow invoking the function constructor without security checks")
877 DEFINE_BOOL(force_slow_path, false, "always take the slow path for builtins")
880 DEFINE_BOOL(inline_new, true, "use fast inline allocation")
883 DEFINE_BOOL(trace, false, "trace function calls")
886 DEFINE_BOOL(lazy, true, "use lazy compilation")
887 DEFINE_BOOL(trace_opt, false, "trace lazy optimization")
888 DEFINE_BOOL(trace_opt_verbose, false, "extra verbose compilation tracing")
889 DEFINE_IMPLICATION(trace_opt_verbose, trace_opt)
890 DEFINE_BOOL(trace_opt_stats, false, "trace lazy optimization statistics")
891 DEFINE_BOOL(trace_deopt, false, "trace optimize function deoptimization")
892 DEFINE_BOOL(trace_file_names, false,
893 "include file names in trace-opt/trace-deopt output")
894 DEFINE_BOOL(trace_interrupts, false, "trace interrupts when they are handled")
895 DEFINE_BOOL(always_opt, false, "always try to optimize functions")
896 DEFINE_BOOL(always_osr, false, "always try to OSR functions")
897 DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt")
899 DEFINE_BOOL(trace_serializer, false, "print code serializer trace")
901 DEFINE_BOOL(external_reference_stats,
false,
902 "print statistics on external references used during serialization")
906 DEFINE_BOOL(compilation_cache,
true,
"enable compilation cache")
908 DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions")
911 DEFINE_BOOL(parallel_compile_tasks, false, "enable parallel compile tasks")
912 DEFINE_BOOL(compiler_dispatcher, false, "enable compiler dispatcher")
913 DEFINE_IMPLICATION(parallel_compile_tasks, compiler_dispatcher)
914 DEFINE_BOOL(trace_compiler_dispatcher, false,
915 "trace compiler dispatcher activity")
918 DEFINE_INT(cpu_profiler_sampling_interval, 1000,
919 "CPU profiler sampling interval in microseconds")
922 DEFINE_BOOL(trace_js_array_abuse, false,
923 "trace out-of-bounds accesses to JS arrays")
924 DEFINE_BOOL(trace_external_array_abuse, false,
925 "trace out-of-bounds-accesses to external arrays")
926 DEFINE_BOOL(trace_array_abuse, false,
927 "trace out-of-bounds accesses to all arrays")
928 DEFINE_IMPLICATION(trace_array_abuse, trace_js_array_abuse)
929 DEFINE_IMPLICATION(trace_array_abuse, trace_external_array_abuse)
933 trace_side_effect_free_debug_evaluate, false,
934 "print debug messages for side-effect-free debug-evaluate for testing")
935 DEFINE_BOOL(hard_abort, true, "abort by crashing")
938 DEFINE_BOOL(expose_inspector_scripts, false,
939 "expose injected-script-source.js for debugging")
942 DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB,
943 "default size of stack region
v8 is allowed to use (in kBytes)")
946 DEFINE_INT(max_stack_trace_source_length, 300,
947 "maximum length of function source code printed in a stack trace.")
950 DEFINE_BOOL(clear_exceptions_on_js_entry, false,
951 "clear pending exceptions when entering JavaScript")
954 DEFINE_INT(histogram_interval, 600000,
955 "time interval in ms for aggregating memory histograms")
958 DEFINE_BOOL(heap_profiler_trace_objects, false,
959 "Dump heap
object allocations/movements/size_updates")
960 DEFINE_BOOL(heap_profiler_use_embedder_graph, true,
961 "Use the new EmbedderGraph API to get embedder nodes")
962 DEFINE_INT(heap_snapshot_string_limit, 1024,
963 "truncate strings to this length in the heap snapshot")
966 DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false,
967 "Use constant sample intervals to eliminate test flakiness")
970 DEFINE_BOOL(use_idle_notification, true,
971 "Use idle notification to reduce memory footprint.")
973 DEFINE_BOOL(trace_ic, false,
974 "trace inline cache state transitions for tools/ic-processor")
975 DEFINE_IMPLICATION(trace_ic, log_code)
976 DEFINE_INT(ic_stats, 0, "inline cache state transitions statistics")
977 DEFINE_VALUE_IMPLICATION(trace_ic, ic_stats, 1)
978 DEFINE_BOOL_READONLY(track_constant_fields, false,
979 "enable constant field tracking")
980 DEFINE_BOOL_READONLY(modify_map_inplace, false, "enable in-place map updates")
981 DEFINE_BOOL_READONLY(fast_map_update, false,
982 "enable fast map update by caching the migration target")
985 DEFINE_BOOL(native_code_counters, false,
986 "generate extra code for manipulating stats counters")
989 DEFINE_BOOL(thin_strings, true, "Enable ThinString support")
990 DEFINE_BOOL(trace_prototype_users, false,
991 "Trace updates to prototype user tracking")
992 DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
993 DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths")
994 DEFINE_BOOL(trace_maps, false, "trace map creation")
995 DEFINE_BOOL(trace_maps_details, true, "also log map details")
996 DEFINE_IMPLICATION(trace_maps, log_code)
999 DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
1002 DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
1003 DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator")
1004 DEFINE_BOOL(check_icache, false,
1005 "Check icache flushes in ARM and MIPS simulator")
1006 DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions")
1007 #if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \ 1008 defined(V8_TARGET_ARCH_PPC64) 1009 DEFINE_INT(sim_stack_alignment, 16,
1010 "Stack alignment in bytes in simulator. This must be a power of two " 1011 "and it must be at least 16. 16 is default.")
1013 DEFINE_INT(sim_stack_alignment, 8,
1014 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
1016 DEFINE_INT(sim_stack_size, 2 * MB / KB,
1017 "Stack size of the ARM64, MIPS64 and PPC64 simulator " 1018 "in kBytes (default is 2 MB)")
1019 DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR,
1020 "When logging, try to use coloured output.")
1021 DEFINE_BOOL(ignore_asm_unimplemented_break, false,
1022 "Don't break for ASM_UNIMPLEMENTED_BREAK
macros.")
1023 DEFINE_BOOL(trace_sim_messages, false,
1024 "Trace simulator debug messages. Implied by --trace-sim.")
1027 DEFINE_BOOL(async_stack_traces, false,
1028 "include async stack traces in Error.stack")
1029 DEFINE_IMPLICATION(async_stack_traces, harmony_await_optimization)
1030 DEFINE_BOOL(stack_trace_on_illegal, false,
1031 "print stack trace when an illegal exception is thrown")
1032 DEFINE_BOOL(abort_on_uncaught_exception, false,
1033 "abort program (dump core) when an uncaught exception is thrown")
1034 DEFINE_BOOL(abort_on_stack_or_string_length_overflow, false,
1035 "Abort program when the stack overflows or a
string exceeds "
1036 "maximum length (as opposed to throwing RangeError). This is "
1037 "useful for fuzzing where the spec behaviour would introduce "
1039 DEFINE_BOOL(randomize_hashes, true,
1040 "randomize hashes to avoid predictable hash collisions "
1041 "(with snapshots this option cannot override the baked-in seed)")
1042 DEFINE_BOOL(rehash_snapshot, true,
1043 "rehash strings from the snapshot to override the baked-in seed")
1044 DEFINE_UINT64(hash_seed, 0,
1045 "Fixed seed to use to hash property keys (0 means random)"
1046 "(with snapshots this option cannot override the baked-in seed)")
1047 DEFINE_INT(random_seed, 0,
1048 "Default seed for initializing random generator "
1049 "(0, the default, means to use system random).")
1050 DEFINE_INT(fuzzer_random_seed, 0,
1051 "Default seed for initializing fuzzer random generator "
1052 "(0, the default, means to use
v8's random number generator seed).")
1053 DEFINE_BOOL(trace_rail, false, "trace RAIL mode")
1054 DEFINE_BOOL(print_all_exceptions, false,
1055 "print exception
object and stack trace on each thrown exception")
1058 DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times")
1059 DEFINE_INT(runtime_stats, 0,
1060 "internal usage only for controlling runtime statistics")
1061 DEFINE_VALUE_IMPLICATION(runtime_call_stats, runtime_stats, 1)
1064 #ifdef V8_EMBEDDED_BUILTINS 1065 #define V8_EMBEDDED_BUILTINS_BOOL true 1067 #define V8_EMBEDDED_BUILTINS_BOOL false 1069 DEFINE_BOOL_READONLY(embedded_builtins, V8_EMBEDDED_BUILTINS_BOOL,
1070 "Embed builtin code into the binary.")
1071 DEFINE_BOOL(profile_deserialization, false,
1072 "Print the time it takes to deserialize the snapshot.")
1073 DEFINE_BOOL(serialization_statistics, false,
1074 "Collect statistics on serialized objects.")
1075 DEFINE_UINT(serialization_chunk_size, 4096,
1076 "Custom size for serialization chunks")
1079 #ifdef V8_JITLESS_MODE 1080 DEFINE_BOOL(jitless,
false,
"Disable runtime allocation of executable memory.")
1082 DEFINE_BOOL_READONLY(jitless,
false,
1083 "Disable runtime allocation of executable memory.")
1087 DEFINE_BOOL(regexp_optimization,
true,
"generate optimized regexp code")
1088 DEFINE_BOOL(regexp_mode_modifiers, false, "enable inline flags in regexp.")
1091 DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag")
1092 DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag")
1093 DEFINE_INT(testing_int_flag, 13, "testing_int_flag")
1094 DEFINE_FLOAT(testing_float_flag, 2.5, "
float-flag")
1095 DEFINE_STRING(testing_string_flag, "Hello, world!", "
string-flag")
1096 DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness")
1099 DEFINE_STRING(embedded_src,
nullptr,
1100 "Path for the generated embedded data file. (mksnapshot only)")
1102 embedded_variant,
nullptr,
1103 "Label to disambiguate symbols in embedded data file. (mksnapshot only)")
1104 DEFINE_STRING(startup_src,
nullptr,
1105 "Write V8 startup as C++ src. (mksnapshot only)")
1106 DEFINE_STRING(startup_blob,
nullptr,
1107 "Write V8 startup blob file. (mksnapshot only)")
1112 #ifdef ENABLE_MINOR_MC 1113 DEFINE_BOOL(minor_mc_parallel_marking,
true,
1114 "use parallel marking for the young generation")
1115 DEFINE_BOOL(trace_minor_mc_parallel_marking, false,
1116 "trace parallel marking for the young generation")
1117 DEFINE_BOOL(minor_mc, false, "perform young generation mark compact GCs")
1118 #endif // ENABLE_MINOR_MC 1124 DEFINE_BOOL(help,
false,
"Print usage message, including flags, on console")
1125 DEFINE_BOOL(dump_counters, false, "Dump counters on exit")
1126 DEFINE_BOOL(dump_counters_nvp, false,
1127 "Dump counters as name-value pairs on exit")
1128 DEFINE_BOOL(use_external_strings, false, "Use external strings for source code")
1130 DEFINE_STRING(map_counters, "", "Map counters to a file")
1131 DEFINE_BOOL(mock_arraybuffer_allocator, false,
1132 "Use a mock ArrayBuffer allocator for testing.")
1133 DEFINE_SIZE_T(mock_arraybuffer_allocator_limit, 0,
1134 "Memory limit for mock ArrayBuffer allocator used to simulate "
1142 #define FLAG FLAG_READONLY 1143 #define V8_LITE_BOOL true 1145 #define FLAG FLAG_FULL 1146 #define V8_LITE_BOOL false 1150 DEFINE_BOOL(opt, !V8_LITE_BOOL,
"use adaptive optimizations")
1153 DEFINE_BOOL(use_ic, !V8_LITE_BOOL, "use inline caching")
1156 DEFINE_BOOL(optimize_for_size, V8_LITE_BOOL,
1157 "Enables optimizations which favor memory size over execution "
1159 DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
1165 #ifdef ENABLE_GDB_JIT_INTERFACE 1166 #define FLAG FLAG_FULL 1168 #define FLAG FLAG_READONLY 1171 DEFINE_BOOL(gdbjit,
false,
"enable GDBJIT interface")
1172 DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects")
1173 DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk")
1174 DEFINE_STRING(gdbjit_dump_filter, "",
1175 "dump only objects containing this substring")
1177 #ifdef ENABLE_GDB_JIT_INTERFACE 1178 DEFINE_IMPLICATION(gdbjit_full, gdbjit)
1179 DEFINE_IMPLICATION(gdbjit_dump, gdbjit)
1181 DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space)
1188 #define FLAG FLAG_FULL 1190 #define FLAG FLAG_READONLY 1194 #ifdef ENABLE_SLOW_DCHECKS 1195 DEFINE_BOOL(enable_slow_asserts,
true,
1196 "enable asserts that are slow to execute")
1200 DEFINE_BOOL(print_ast,
false,
"print source AST")
1201 DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints")
1204 DEFINE_BOOL(print_builtin_scopes, false, "print scopes for builtins")
1205 DEFINE_BOOL(print_scopes, false, "print scopes")
1208 DEFINE_BOOL(trace_contexts, false, "trace contexts operations")
1211 DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection")
1212 DEFINE_BOOL(code_stats, false, "report code statistics after GC")
1213 DEFINE_BOOL(print_handles, false, "report handles after GC")
1214 DEFINE_BOOL(check_handle_count, false,
1215 "Check that there are not too many handles at GC")
1216 DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
1219 DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
1222 DEFINE_BOOL(trace_module_status, false,
1223 "Trace status transitions of ECMAScript modules")
1224 DEFINE_BOOL(trace_normalization, false,
1225 "prints when objects are turned into dictionaries.")
1228 DEFINE_BOOL(trace_lazy, false, "trace lazy compilation")
1231 DEFINE_BOOL(collect_heap_spill_statistics, false,
1232 "report heap spill statistics along with heap_stats "
1233 "(requires heap_stats)")
1234 DEFINE_BOOL(trace_isolates, false, "trace isolate state changes")
1237 DEFINE_BOOL(regexp_possessive_quantifier, false,
1238 "enable possessive quantifier syntax for testing")
1239 DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
1240 DEFINE_BOOL(trace_regexp_assembler, false,
1241 "trace regexp macro assembler calls.")
1242 DEFINE_BOOL(trace_regexp_parser, false, "trace regexp parsing")
1245 DEFINE_BOOL(print_break_location, false, "print source location on debug break")
1248 DEFINE_DEBUG_BOOL(trace_wasm_instances, false,
1249 "trace creation and collection of wasm instances")
1255 #define FLAG FLAG_FULL 1258 DEFINE_BOOL(log,
false,
1259 "Minimal logging (no API, code, GC, suspect, or handles samples).")
1260 DEFINE_BOOL(log_all, false, "Log all events to the log file.")
1261 DEFINE_BOOL(log_api, false, "Log API events to the log file.")
1262 DEFINE_BOOL(log_code, false,
1263 "Log code events to the log file without profiling.")
1264 DEFINE_BOOL(log_handles, false, "Log global handle events.")
1265 DEFINE_BOOL(log_suspect, false, "Log suspect operations.")
1266 DEFINE_BOOL(log_source_code, false, "Log source code.")
1267 DEFINE_BOOL(log_function_events, false,
1268 "Log function events "
1269 "(parse, compile, execute) separately.")
1270 DEFINE_BOOL(prof, false,
1271 "Log statistical profiling information (implies --log-code).")
1273 DEFINE_BOOL(detailed_line_info, false,
1274 "Always generate detailed line information for CPU profiling.")
1276 #if defined(ANDROID) 1279 #define DEFAULT_PROF_SAMPLING_INTERVAL 5000 1281 #define DEFAULT_PROF_SAMPLING_INTERVAL 1000 1283 DEFINE_INT(prof_sampling_interval, DEFAULT_PROF_SAMPLING_INTERVAL,
1284 "Interval for --prof samples (in microseconds).")
1285 #undef DEFAULT_PROF_SAMPLING_INTERVAL 1287 DEFINE_BOOL(prof_cpp,
false,
"Like --prof, but ignore generated code.")
1288 DEFINE_IMPLICATION(prof, prof_cpp)
1289 DEFINE_BOOL(prof_browser_mode, true,
1290 "Used with --prof, turns on browser-compatible mode for profiling.")
1291 DEFINE_STRING(logfile, "
v8.log", "Specify the name of the log file.")
1292 DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
1293 DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
1294 DEFINE_BOOL(interpreted_frames_native_stack, false,
1295 "Show interpreted frames on the native stack (useful for external "
1297 DEFINE_BOOL(perf_basic_prof, false,
1298 "Enable perf linux profiler (basic support).")
1299 DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
1300 DEFINE_BOOL(perf_basic_prof_only_functions, false,
1301 "Only report function code ranges to perf (
i.e. no stubs).")
1302 DEFINE_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof)
1303 DEFINE_BOOL(perf_prof, false,
1304 "Enable perf linux profiler (experimental annotate support).")
1305 DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space)
1307 DEFINE_NEG_IMPLICATION(perf_prof, write_protect_code_memory)
1308 DEFINE_NEG_IMPLICATION(perf_prof, wasm_write_protect_code_memory)
1309 DEFINE_BOOL(perf_prof_unwinding_info, false,
1310 "Enable unwinding info for perf linux profiler (experimental).")
1311 DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info)
1312 DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
1313 "Specify the name of the file for fake gc mmap used in ll_prof")
1314 DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")
1315 DEFINE_BOOL(log_timer_events, false,
1316 "Time events including external callbacks.")
1317 DEFINE_IMPLICATION(log_timer_events, log_internal_timer_events)
1318 DEFINE_IMPLICATION(log_internal_timer_events, prof)
1319 DEFINE_BOOL(log_instruction_stats, false, "Log AArch64 instruction statistics.")
1320 DEFINE_STRING(log_instruction_file, "arm64_inst.csv",
1321 "AArch64 instruction statistics log file.")
1322 DEFINE_INT(log_instruction_period, 1 << 22,
1323 "AArch64 instruction statistics logging period.")
1325 DEFINE_BOOL(redirect_code_traces, false,
1326 "output deopt information and disassembly into file "
1327 "code-<pid>-<isolate
id>.asm")
1328 DEFINE_STRING(redirect_code_traces_to,
nullptr,
1329 "output deopt information and disassembly into the given file")
1331 DEFINE_BOOL(print_opt_source, false,
1332 "print source code of optimized and inlined functions")
1338 #ifdef ENABLE_DISASSEMBLER 1339 #define FLAG FLAG_FULL 1341 #define FLAG FLAG_READONLY 1345 DEFINE_BOOL(trace_elements_transitions,
false,
"trace elements transitions")
1347 DEFINE_BOOL(trace_creation_allocation_sites, false,
1348 "trace the creation of allocation sites")
1351 DEFINE_BOOL(print_code_stubs, false, "print code stubs")
1352 DEFINE_BOOL(test_secondary_stub_cache, false,
1353 "test secondary stub cache by disabling the primary one")
1355 DEFINE_BOOL(test_primary_stub_cache, false,
1356 "test primary stub cache by disabling the secondary one")
1358 DEFINE_BOOL(test_small_max_function_context_stub_size, false,
1359 "enable testing the function context size overflow path "
1360 "by making the maximum size smaller")
1363 DEFINE_BOOL(print_code, false, "print generated code")
1364 DEFINE_BOOL(print_opt_code, false, "print optimized code")
1365 DEFINE_STRING(print_opt_code_filter, "*", "filter for printing optimized code")
1366 DEFINE_BOOL(print_code_verbose, false, "print more information for code")
1367 DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins")
1368 DEFINE_STRING(print_builtin_code_filter, "*",
1369 "filter for printing builtin code")
1370 DEFINE_BOOL(print_builtin_size, false, "print code size for builtins")
1372 #ifdef ENABLE_DISASSEMBLER 1373 DEFINE_BOOL(sodium,
false,
1374 "print generated code output suitable for use with " 1375 "the Sodium code viewer")
1377 DEFINE_IMPLICATION(sodium, print_code_stubs)
1378 DEFINE_IMPLICATION(sodium, print_code)
1379 DEFINE_IMPLICATION(sodium, print_opt_code)
1380 DEFINE_IMPLICATION(sodium, code_comments)
1382 DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code")
1383 DEFINE_IMPLICATION(print_all_code, print_code)
1384 DEFINE_IMPLICATION(print_all_code, print_opt_code)
1385 DEFINE_IMPLICATION(print_all_code, print_code_verbose)
1386 DEFINE_IMPLICATION(print_all_code, print_builtin_code)
1387 DEFINE_IMPLICATION(print_all_code, print_code_stubs)
1388 DEFINE_IMPLICATION(print_all_code, code_comments)
1392 #define FLAG FLAG_FULL 1398 DEFINE_BOOL(predictable,
false,
"enable predictable mode")
1399 DEFINE_IMPLICATION(predictable, single_threaded)
1400 DEFINE_NEG_IMPLICATION(predictable, memory_reducer)
1401 DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0)
1402 DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation)
1404 DEFINE_BOOL(predictable_gc_schedule, false,
1405 "Predictable garbage collection schedule. Fixes heap growing, "
1406 "idle, and memory reducing behavior.")
1407 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, min_semi_space_size, 4)
1408 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, max_semi_space_size, 4)
1409 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, heap_growing_percent, 30)
1410 DEFINE_NEG_IMPLICATION(predictable_gc_schedule, idle_time_scavenge)
1411 DEFINE_NEG_IMPLICATION(predictable_gc_schedule, memory_reducer)
1417 DEFINE_BOOL(single_threaded, false, "disable the use of background tasks")
1418 DEFINE_IMPLICATION(single_threaded, single_threaded_gc)
1419 DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation)
1420 DEFINE_NEG_IMPLICATION(single_threaded, compiler_dispatcher)
1425 DEFINE_BOOL(single_threaded_gc, false, "disable the use of background gc tasks")
1426 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_marking)
1427 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_sweeping)
1428 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_compaction)
1429 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_marking)
1430 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_pointer_update)
1431 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_scavenge)
1432 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_store_buffer)
1433 #ifdef ENABLE_MINOR_MC 1434 DEFINE_NEG_IMPLICATION(single_threaded_gc, minor_mc_parallel_marking)
1435 #endif // ENABLE_MINOR_MC 1436 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_array_buffer_freeing)
1440 #ifdef VERIFY_PREDICTABLE 1441 #define FLAG FLAG_FULL 1443 #define FLAG FLAG_READONLY 1446 DEFINE_BOOL(verify_predictable,
false,
1447 "this mode is used for checking that V8 behaves predictably")
1448 DEFINE_INT(dump_allocations_digest_at_alloc, -1,
1449 "dump allocations digest each n-th allocation")
1455 #define FLAG FLAG_READONLY 1458 DEFINE_BOOL(enable_embedded_constant_pool, V8_EMBEDDED_CONSTANT_POOL,
1459 "enable use of embedded constant pools (PPC only)")
1461 DEFINE_BOOL(unbox_double_fields, V8_DOUBLE_FIELDS_UNBOXING,
1462 "enable in-
object double fields unboxing (64-bit only)")
1463 DEFINE_IMPLICATION(unbox_double_fields, track_double_fields)
1465 DEFINE_BOOL(lite_mode, V8_LITE_BOOL,
1466 "enables trade-off of performance for memory savings "
1471 #undef FLAG_READONLY 1476 #undef DEFINE_MAYBE_BOOL 1477 #undef DEFINE_DEBUG_BOOL 1479 #undef DEFINE_STRING 1481 #undef DEFINE_IMPLICATION 1482 #undef DEFINE_NEG_IMPLICATION 1483 #undef DEFINE_NEG_VALUE_IMPLICATION 1484 #undef DEFINE_VALUE_IMPLICATION 1485 #undef DEFINE_ALIAS_BOOL 1486 #undef DEFINE_ALIAS_INT 1487 #undef DEFINE_ALIAS_STRING 1488 #undef DEFINE_ALIAS_FLOAT 1490 #undef FLAG_MODE_DECLARE 1491 #undef FLAG_MODE_DEFINE 1492 #undef FLAG_MODE_DEFINE_DEFAULTS 1493 #undef FLAG_MODE_META 1494 #undef FLAG_MODE_DEFINE_IMPLICATIONS