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_NEG_IMPLICATION(whenflag, thenflag) \ 24 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false) 25 26 #define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \ 27 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false) 28 29 // We want to declare the names of the variables for the header file. Normally 30 // this will just be an extern declaration, but for a readonly flag we let the 31 // compiler make better optimizations by giving it the value. 32 #if defined(FLAG_MODE_DECLARE) 33 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 34 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; 35 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 36 static constexpr ctype FLAG_##nam = def; 37 38 // We want to supply the actual storage and value for the flag variable in the 39 // .cc file. We only do this for writable flags. 40 #elif defined(FLAG_MODE_DEFINE) 41 #ifdef USING_V8_SHARED 42 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 43 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; 44 #else 45 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 46 V8_EXPORT_PRIVATE ctype FLAG_##nam = def; 47 #endif 48 49 // We need to define all of our default values so that the Flag structure can 50 // access them by pointer. These are just used internally inside of one .cc, 51 // for MODE_META, so there is no impact on the flags interface. 52 #elif defined(FLAG_MODE_DEFINE_DEFAULTS) 53 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 54 static constexpr ctype FLAGDEFAULT_##nam = def; 55 56 // We want to write entries into our meta data table, for internal parsing and 57 // printing / etc in the flag parser code. We only do this for writable flags. 58 #elif defined(FLAG_MODE_META) 59 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 60 {Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false}, 61 #define FLAG_ALIAS(ftype, ctype, alias, nam) \ 62 {Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \ 63 "alias for --" #nam, false}, 64 65 // We produce the code to set flags when it is implied by another flag. 66 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 67 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \ 68 changed |= TriggerImplication(FLAG_##whenflag, #whenflag, &FLAG_##thenflag, \ 69 value, false); 70 71 // A weak implication will be overwritten by a normal implication or by an 72 // explicit flag. 73 #define DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, value) \ 74 changed |= TriggerImplication(FLAG_##whenflag, #whenflag, &FLAG_##thenflag, \ 75 value, true); 76 77 #define DEFINE_GENERIC_IMPLICATION(whenflag, statement) \ 78 if (FLAG_##whenflag) statement; 79 80 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \ 81 changed |= TriggerImplication(!FLAG_##whenflag, #whenflag, &FLAG_##thenflag, \ 82 value, false); 83 84 // We apply a generic macro to the flags. 85 #elif defined(FLAG_MODE_APPLY) 86 87 #define FLAG_FULL FLAG_MODE_APPLY 88 89 #else 90 #error No mode supplied when including flags.defs 91 #endif 92 93 // Dummy defines for modes where it is not relevant. 94 #ifndef FLAG_FULL 95 #define FLAG_FULL(ftype, ctype, nam, def, cmt) 96 #endif 97 98 #ifndef FLAG_READONLY 99 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 100 #endif 101 102 #ifndef FLAG_ALIAS 103 #define FLAG_ALIAS(ftype, ctype, alias, nam) 104 #endif 105 106 #ifndef DEFINE_VALUE_IMPLICATION 107 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) 108 #endif 109 110 #ifndef DEFINE_WEAK_VALUE_IMPLICATION 111 #define DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, value) 112 #endif 113 114 #ifndef DEFINE_GENERIC_IMPLICATION 115 #define DEFINE_GENERIC_IMPLICATION(whenflag, statement) 116 #endif 117 118 #ifndef DEFINE_NEG_VALUE_IMPLICATION 119 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) 120 #endif 121 122 #define COMMA , 123 124 #ifdef FLAG_MODE_DECLARE 125 126 struct MaybeBoolFlag { CreateMaybeBoolFlag127 static MaybeBoolFlag Create(bool has_value, bool value) { 128 MaybeBoolFlag flag; 129 flag.has_value = has_value; 130 flag.value = value; 131 return flag; 132 } 133 bool has_value; 134 bool value; 135 136 bool operator!=(const MaybeBoolFlag& other) const { 137 return has_value != other.has_value || value != other.value; 138 } 139 }; 140 #endif 141 142 #ifdef DEBUG 143 #define DEBUG_BOOL true 144 #else 145 #define DEBUG_BOOL false 146 #endif 147 148 #ifdef V8_COMPRESS_POINTERS 149 #define COMPRESS_POINTERS_BOOL true 150 #else 151 #define COMPRESS_POINTERS_BOOL false 152 #endif 153 154 #ifdef V8_MAP_PACKING 155 #define V8_MAP_PACKING_BOOL true 156 #else 157 #define V8_MAP_PACKING_BOOL false 158 #endif 159 160 #ifdef V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE 161 #define COMPRESS_POINTERS_IN_ISOLATE_CAGE_BOOL true 162 #else 163 #define COMPRESS_POINTERS_IN_ISOLATE_CAGE_BOOL false 164 #endif 165 166 #ifdef V8_COMPRESS_POINTERS_IN_SHARED_CAGE 167 #define COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL true 168 #else 169 #define COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL false 170 #endif 171 172 #ifdef V8_SANDBOXED_EXTERNAL_POINTERS 173 #define V8_SANDBOXED_EXTERNAL_POINTERS_BOOL true 174 #else 175 #define V8_SANDBOXED_EXTERNAL_POINTERS_BOOL false 176 #endif 177 178 #ifdef V8_SANDBOX 179 #define V8_SANDBOX_BOOL true 180 #else 181 #define V8_SANDBOX_BOOL false 182 #endif 183 184 // D8's MultiMappedAllocator is only available on Linux, and only if the sandbox 185 // is not enabled. 186 #if V8_OS_LINUX && !V8_SANDBOX_BOOL 187 #define MULTI_MAPPED_ALLOCATOR_AVAILABLE true 188 #else 189 #define MULTI_MAPPED_ALLOCATOR_AVAILABLE false 190 #endif 191 192 #ifdef V8_ENABLE_CONTROL_FLOW_INTEGRITY 193 #define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL true 194 #else 195 #define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL false 196 #endif 197 198 #if V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 || \ 199 (V8_TARGET_ARCH_S390X && COMPRESS_POINTERS_BOOL) 200 // TODO(v8:11421): Enable Sparkplug for these architectures. 201 #define ENABLE_SPARKPLUG false 202 #else 203 #define ENABLE_SPARKPLUG true 204 #endif 205 206 #if ENABLE_SPARKPLUG && !defined(ANDROID) 207 // Enable Sparkplug by default on desktop-only. 208 #define ENABLE_SPARKPLUG_BY_DEFAULT true 209 #else 210 #define ENABLE_SPARKPLUG_BY_DEFAULT false 211 #endif 212 213 #if defined(V8_OS_DARWIN) && defined(V8_HOST_ARCH_ARM64) 214 // Must be enabled on M1. 215 #define MUST_WRITE_PROTECT_CODE_MEMORY true 216 #else 217 #define MUST_WRITE_PROTECT_CODE_MEMORY false 218 #endif 219 220 // Supported ARM configurations are: 221 // "armv6": ARMv6 + VFPv2 222 // "armv7": ARMv7 + VFPv3-D32 + NEON 223 // "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV 224 // "armv8": ARMv8 (including all of the above) 225 #if !defined(ARM_TEST_NO_FEATURE_PROBE) || \ 226 (defined(CAN_USE_ARMV8_INSTRUCTIONS) && \ 227 defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 228 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)) 229 #define ARM_ARCH_DEFAULT "armv8" 230 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 231 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS) 232 #define ARM_ARCH_DEFAULT "armv7+sudiv" 233 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_NEON) && \ 234 defined(CAN_USE_VFP3_INSTRUCTIONS) 235 #define ARM_ARCH_DEFAULT "armv7" 236 #else 237 #define ARM_ARCH_DEFAULT "armv6" 238 #endif 239 240 #ifdef V8_OS_WIN 241 #define ENABLE_LOG_COLOUR false 242 #else 243 #define ENABLE_LOG_COLOUR true 244 #endif 245 246 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 247 #define DEFINE_BOOL_READONLY(nam, def, cmt) \ 248 FLAG_READONLY(BOOL, bool, nam, def, cmt) 249 #define DEFINE_MAYBE_BOOL(nam, cmt) \ 250 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt) 251 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 252 #define DEFINE_UINT(nam, def, cmt) FLAG(UINT, unsigned int, nam, def, cmt) 253 #define DEFINE_UINT_READONLY(nam, def, cmt) \ 254 FLAG_READONLY(UINT, unsigned int, nam, def, cmt) 255 #define DEFINE_UINT64(nam, def, cmt) FLAG(UINT64, uint64_t, nam, def, cmt) 256 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 257 #define DEFINE_SIZE_T(nam, def, cmt) FLAG(SIZE_T, size_t, nam, def, cmt) 258 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 259 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) 260 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam) 261 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) 262 #define DEFINE_ALIAS_SIZE_T(alias, nam) FLAG_ALIAS(SIZE_T, size_t, alias, nam) 263 #define DEFINE_ALIAS_STRING(alias, nam) \ 264 FLAG_ALIAS(STRING, const char*, alias, nam) 265 266 #ifdef DEBUG 267 #define DEFINE_DEBUG_BOOL DEFINE_BOOL 268 #else 269 #define DEFINE_DEBUG_BOOL DEFINE_BOOL_READONLY 270 #endif 271 272 // 273 // Flags in all modes. 274 // 275 #define FLAG FLAG_FULL 276 277 // ATTENTION: This is set to true by default in d8. But for API compatibility, 278 // it generally defaults to false. 279 DEFINE_BOOL(abort_on_contradictory_flags, false, 280 "Disallow flags or implications overriding each other.") 281 // This implication is also hard-coded into the flags processing to make sure it 282 // becomes active before we even process subsequent flags. 283 DEFINE_NEG_IMPLICATION(fuzzing, abort_on_contradictory_flags) 284 // This is not really a flag, it affects the interpretation of the next flag but 285 // doesn't become permanently true when specified. This only works for flags 286 // defined in this file, but not for d8 flags defined in src/d8/d8.cc. 287 DEFINE_BOOL(allow_overwriting_for_next_flag, false, 288 "temporary disable flag contradiction to allow overwriting just " 289 "the next flag") 290 291 // Flags for language modes and experimental language features. 292 DEFINE_BOOL(use_strict, false, "enforce strict mode") 293 294 DEFINE_BOOL(trace_temporal, false, "trace temporal code") 295 296 DEFINE_BOOL(harmony, false, "enable all completed harmony features") 297 DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features") 298 299 // Update bootstrapper.cc whenever adding a new feature flag. 300 301 // Features that are still work in progress (behind individual flags). 302 #define HARMONY_INPROGRESS_BASE(V) \ 303 V(harmony_weak_refs_with_cleanup_some, \ 304 "harmony weak references with FinalizationRegistry.prototype.cleanupSome") \ 305 V(harmony_import_assertions, "harmony import assertions") \ 306 V(harmony_rab_gsab, \ 307 "harmony ResizableArrayBuffer / GrowableSharedArrayBuffer") \ 308 V(harmony_temporal, "Temporal") \ 309 V(harmony_shadow_realm, "harmony ShadowRealm") \ 310 V(harmony_struct, "harmony structs and shared structs") 311 312 #ifdef V8_INTL_SUPPORT 313 #define HARMONY_INPROGRESS(V) \ 314 HARMONY_INPROGRESS_BASE(V) \ 315 V(harmony_intl_number_format_v3, "Intl.NumberFormat v3") 316 #else 317 #define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) 318 #endif 319 320 // Features that are complete (but still behind the --harmony flag). 321 #define HARMONY_STAGED_BASE(V) \ 322 V(harmony_array_grouping, "harmony array grouping") 323 324 #ifdef V8_INTL_SUPPORT 325 #define HARMONY_STAGED(V) \ 326 HARMONY_STAGED_BASE(V) \ 327 V(harmony_intl_best_fit_matcher, "Intl BestFitMatcher") 328 #else 329 #define HARMONY_STAGED(V) HARMONY_STAGED_BASE(V) 330 #endif 331 332 // Features that are shipping (turned on by default, but internal flag remains). 333 #define HARMONY_SHIPPING_BASE(V) \ 334 V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ 335 V(harmony_atomics, "harmony atomics") \ 336 V(harmony_private_brand_checks, "harmony private brand checks") \ 337 V(harmony_relative_indexing_methods, "harmony relative indexing methods") \ 338 V(harmony_error_cause, "harmony error cause property") \ 339 V(harmony_object_has_own, "harmony Object.hasOwn") \ 340 V(harmony_class_static_blocks, "harmony static initializer blocks") \ 341 V(harmony_array_find_last, "harmony array find last helpers") 342 343 #ifdef V8_INTL_SUPPORT 344 #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) 345 #else 346 #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) 347 #endif 348 349 // Once a shipping feature has proved stable in the wild, it will be dropped 350 // from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed, 351 // and associated tests are moved from the harmony directory to the appropriate 352 // esN directory. 353 354 #define FLAG_INPROGRESS_FEATURES(id, description) \ 355 DEFINE_BOOL(id, false, "enable " #description " (in progress)") 356 HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES) 357 #undef FLAG_INPROGRESS_FEATURES 358 359 #define FLAG_STAGED_FEATURES(id, description) \ 360 DEFINE_BOOL(id, false, "enable " #description) \ 361 DEFINE_IMPLICATION(harmony, id) 362 HARMONY_STAGED(FLAG_STAGED_FEATURES) 363 #undef FLAG_STAGED_FEATURES 364 365 #define FLAG_SHIPPING_FEATURES(id, description) \ 366 DEFINE_BOOL(id, true, "enable " #description) \ 367 DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id) 368 HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES) 369 #undef FLAG_SHIPPING_FEATURES 370 371 DEFINE_BOOL(builtin_subclassing, true, 372 "subclassing support in built-in methods") 373 374 // If the following flag is set to `true`, the SharedArrayBuffer constructor is 375 // enabled per context depending on the callback set via 376 // `SetSharedArrayBufferConstructorEnabledCallback`. If no callback is set, the 377 // SharedArrayBuffer constructor is disabled. 378 DEFINE_BOOL(enable_sharedarraybuffer_per_context, false, 379 "enable the SharedArrayBuffer constructor per context") 380 381 #ifdef V8_INTL_SUPPORT 382 DEFINE_BOOL(icu_timezone_data, true, "get information about timezones from ICU") 383 #endif 384 385 #ifdef V8_ENABLE_DOUBLE_CONST_STORE_CHECK 386 #define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL true 387 #else 388 #define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL false 389 #endif 390 391 #ifdef V8_LITE_MODE 392 #define V8_LITE_BOOL true 393 #else 394 #define V8_LITE_BOOL false 395 #endif 396 397 #ifdef V8_ENABLE_LAZY_SOURCE_POSITIONS 398 #define V8_LAZY_SOURCE_POSITIONS_BOOL true 399 #else 400 #define V8_LAZY_SOURCE_POSITIONS_BOOL false 401 #endif 402 403 #ifdef V8_SHARED_RO_HEAP 404 #define V8_SHARED_RO_HEAP_BOOL true 405 #else 406 #define V8_SHARED_RO_HEAP_BOOL false 407 #endif 408 409 DEFINE_BOOL(stress_snapshot, false, 410 "disables sharing of the read-only heap for testing") 411 // Incremental marking is incompatible with the stress_snapshot mode; 412 // specifically, serialization may clear bytecode arrays from shared function 413 // infos which the MarkCompactCollector (running concurrently) may still need. 414 // See also https://crbug.com/v8/10882. 415 // 416 // Note: This is not an issue in production because we don't clear SFI's 417 // there (that only happens in mksnapshot and in --stress-snapshot mode). 418 DEFINE_NEG_IMPLICATION(stress_snapshot, incremental_marking) 419 420 DEFINE_BOOL(lite_mode, V8_LITE_BOOL, 421 "enables trade-off of performance for memory savings") 422 423 // Lite mode implies other flags to trade-off performance for memory. 424 DEFINE_IMPLICATION(lite_mode, jitless) 425 DEFINE_IMPLICATION(lite_mode, lazy_feedback_allocation) 426 DEFINE_IMPLICATION(lite_mode, optimize_for_size) 427 428 #ifdef V8_ENABLE_THIRD_PARTY_HEAP 429 #define V8_ENABLE_THIRD_PARTY_HEAP_BOOL true 430 #else 431 #define V8_ENABLE_THIRD_PARTY_HEAP_BOOL false 432 #endif 433 434 DEFINE_NEG_IMPLICATION(enable_third_party_heap, inline_new) 435 DEFINE_NEG_IMPLICATION(enable_third_party_heap, allocation_site_pretenuring) 436 DEFINE_NEG_IMPLICATION(enable_third_party_heap, turbo_allocation_folding) 437 DEFINE_NEG_IMPLICATION(enable_third_party_heap, concurrent_recompilation) 438 DEFINE_NEG_IMPLICATION(enable_third_party_heap, script_streaming) 439 DEFINE_NEG_IMPLICATION(enable_third_party_heap, 440 parallel_compile_tasks_for_eager_toplevel) 441 DEFINE_NEG_IMPLICATION(enable_third_party_heap, use_marking_progress_bar) 442 DEFINE_NEG_IMPLICATION(enable_third_party_heap, move_object_start) 443 DEFINE_NEG_IMPLICATION(enable_third_party_heap, concurrent_marking) 444 445 DEFINE_BOOL_READONLY(enable_third_party_heap, V8_ENABLE_THIRD_PARTY_HEAP_BOOL, 446 "Use third-party heap") 447 448 #ifdef V8_ALLOCATION_FOLDING 449 #define V8_ALLOCATION_FOLDING_BOOL true 450 #else 451 #define V8_ALLOCATION_FOLDING_BOOL false 452 #endif 453 454 DEFINE_BOOL_READONLY(enable_allocation_folding, V8_ALLOCATION_FOLDING_BOOL, 455 "Use allocation folding globally") 456 DEFINE_NEG_NEG_IMPLICATION(enable_allocation_folding, turbo_allocation_folding) 457 458 #ifdef V8_DISABLE_WRITE_BARRIERS 459 #define V8_DISABLE_WRITE_BARRIERS_BOOL true 460 #else 461 #define V8_DISABLE_WRITE_BARRIERS_BOOL false 462 #endif 463 464 DEFINE_BOOL_READONLY(disable_write_barriers, V8_DISABLE_WRITE_BARRIERS_BOOL, 465 "disable write barriers when GC is non-incremental " 466 "and heap contains single generation.") 467 468 // Disable incremental marking barriers 469 DEFINE_NEG_IMPLICATION(disable_write_barriers, incremental_marking) 470 471 #ifdef V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS 472 #define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL true 473 #else 474 #define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL false 475 #endif 476 477 DEFINE_BOOL_READONLY(enable_unconditional_write_barriers, 478 V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL, 479 "always use full write barriers") 480 481 DEFINE_BOOL(use_full_record_write_builtin, true, 482 "Force use of full version of RecordWrite builtin.") 483 484 #ifdef V8_ENABLE_SINGLE_GENERATION 485 #define V8_SINGLE_GENERATION_BOOL true 486 #else 487 #define V8_SINGLE_GENERATION_BOOL false 488 #endif 489 490 DEFINE_BOOL_READONLY( 491 single_generation, V8_SINGLE_GENERATION_BOOL, 492 "allocate all objects from young generation to old generation") 493 494 #ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING 495 #define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL true 496 #else 497 #define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL false 498 #endif 499 DEFINE_BOOL_READONLY(conservative_stack_scanning, 500 V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL, 501 "use conservative stack scanning") 502 503 #ifdef V8_ENABLE_FUTURE 504 #define FUTURE_BOOL true 505 #else 506 #define FUTURE_BOOL false 507 #endif 508 DEFINE_BOOL(future, FUTURE_BOOL, 509 "Implies all staged features that we want to ship in the " 510 "not-too-far future") 511 512 #ifdef V8_ENABLE_MAGLEV 513 #define V8_ENABLE_MAGLEV_BOOL true 514 DEFINE_BOOL(maglev, false, "enable the maglev optimizing compiler") 515 #else 516 #define V8_ENABLE_MAGLEV_BOOL false 517 DEFINE_BOOL_READONLY(maglev, false, "enable the maglev optimizing compiler") 518 #endif // V8_ENABLE_MAGLEV 519 520 DEFINE_STRING(maglev_filter, "*", "optimization filter for the maglev compiler") 521 DEFINE_BOOL(maglev_break_on_entry, false, "insert an int3 on maglev entries") 522 DEFINE_BOOL(print_maglev_graph, false, "print maglev graph") 523 DEFINE_BOOL(print_maglev_code, false, "print maglev code") 524 DEFINE_BOOL(trace_maglev_regalloc, false, "trace maglev register allocation") 525 526 #if ENABLE_SPARKPLUG 527 DEFINE_WEAK_IMPLICATION(future, sparkplug) 528 DEFINE_WEAK_IMPLICATION(future, flush_baseline_code) 529 #endif 530 #if V8_SHORT_BUILTIN_CALLS 531 DEFINE_WEAK_IMPLICATION(future, short_builtin_calls) 532 #endif 533 #if !MUST_WRITE_PROTECT_CODE_MEMORY 534 DEFINE_WEAK_VALUE_IMPLICATION(future, write_protect_code_memory, false) 535 #endif 536 DEFINE_WEAK_IMPLICATION(future, compact_maps) 537 538 DEFINE_BOOL_READONLY(dict_property_const_tracking, 539 V8_DICT_PROPERTY_CONST_TRACKING_BOOL, 540 "Use const tracking on dictionary properties") 541 542 // Flags for jitless 543 DEFINE_BOOL(jitless, V8_LITE_BOOL, 544 "Disable runtime allocation of executable memory.") 545 546 // Jitless V8 has a few implications: 547 DEFINE_NEG_IMPLICATION(jitless, opt) 548 // Field type tracking is only used by TurboFan. 549 DEFINE_NEG_IMPLICATION(jitless, track_field_types) 550 // Regexps are interpreted. 551 DEFINE_IMPLICATION(jitless, regexp_interpret_all) 552 #if ENABLE_SPARKPLUG 553 // No Sparkplug compilation. 554 DEFINE_NEG_IMPLICATION(jitless, sparkplug) 555 DEFINE_NEG_IMPLICATION(jitless, always_sparkplug) 556 #endif // ENABLE_SPARKPLUG 557 #ifdef V8_ENABLE_MAGLEV 558 // No Maglev compilation. 559 DEFINE_NEG_IMPLICATION(jitless, maglev) 560 #endif // V8_ENABLE_MAGLEV 561 562 #ifndef V8_TARGET_ARCH_ARM 563 // Unsupported on arm. See https://crbug.com/v8/8713. 564 DEFINE_NEG_IMPLICATION(jitless, interpreted_frames_native_stack) 565 #endif 566 567 DEFINE_BOOL(assert_types, false, 568 "generate runtime type assertions to test the typer") 569 // TODO(tebbi): Support allocating types from background thread. 570 DEFINE_NEG_IMPLICATION(assert_types, concurrent_recompilation) 571 572 // Enable verification of SimplifiedLowering in debug builds. 573 DEFINE_BOOL(verify_simplified_lowering, DEBUG_BOOL, 574 "verify graph generated by simplified lowering") 575 576 DEFINE_BOOL(trace_compilation_dependencies, false, "trace code dependencies") 577 // Depend on --trace-deopt-verbose for reporting dependency invalidations. 578 DEFINE_IMPLICATION(trace_compilation_dependencies, trace_deopt_verbose) 579 580 #ifdef V8_ALLOCATION_SITE_TRACKING 581 #define V8_ALLOCATION_SITE_TRACKING_BOOL true 582 #else 583 #define V8_ALLOCATION_SITE_TRACKING_BOOL false 584 #endif 585 586 DEFINE_BOOL_READONLY(allocation_site_tracking, V8_ALLOCATION_SITE_TRACKING_BOOL, 587 "Enable allocation site tracking") 588 DEFINE_NEG_NEG_IMPLICATION(allocation_site_tracking, 589 allocation_site_pretenuring) 590 591 // Flags for experimental implementation features. 592 DEFINE_BOOL(allocation_site_pretenuring, true, 593 "pretenure with allocation sites") 594 DEFINE_BOOL(page_promotion, true, "promote pages based on utilization") 595 DEFINE_INT(page_promotion_threshold, 70, 596 "min percentage of live bytes on a page to enable fast evacuation") 597 DEFINE_BOOL(trace_pretenuring, false, 598 "trace pretenuring decisions of HAllocate instructions") 599 DEFINE_BOOL(trace_pretenuring_statistics, false, 600 "trace allocation site pretenuring statistics") 601 DEFINE_BOOL(track_field_types, true, "track field types") 602 DEFINE_BOOL(trace_block_coverage, false, 603 "trace collected block coverage information") 604 DEFINE_BOOL(trace_protector_invalidation, false, 605 "trace protector cell invalidations") 606 DEFINE_BOOL(trace_web_snapshot, false, "trace web snapshot deserialization") 607 608 DEFINE_BOOL(feedback_normalization, false, 609 "feed back normalization to constructors") 610 // TODO(jkummerow): This currently adds too much load on the stub cache. 611 DEFINE_BOOL_READONLY(internalize_on_the_fly, true, 612 "internalize string keys for generic keyed ICs on the fly") 613 614 // Flag for sealed, frozen elements kind instead of dictionary elements kind 615 DEFINE_BOOL_READONLY(enable_sealed_frozen_elements_kind, true, 616 "Enable sealed, frozen elements kind") 617 618 // Flags for data representation optimizations 619 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles") 620 DEFINE_BOOL_READONLY(string_slices, true, "use string slices") 621 622 // Tiering: Sparkplug / feedback vector allocation. 623 DEFINE_INT(interrupt_budget_for_feedback_allocation, 940, 624 "The fixed interrupt budget (in bytecode size) for allocating " 625 "feedback vectors") 626 DEFINE_INT(interrupt_budget_factor_for_feedback_allocation, 8, 627 "The interrupt budget factor (applied to bytecode size) for " 628 "allocating feedback vectors, used when bytecode size is known") 629 630 // Tiering: Maglev. 631 // The Maglev interrupt budget is chosen to be roughly 1/10th of Turbofan's 632 // overall budget (including the multiple required ticks). 633 DEFINE_INT(interrupt_budget_for_maglev, 40 * KB, 634 "interrupt budget which should be used for the profiler counter") 635 636 // Tiering: Turbofan. 637 DEFINE_INT(interrupt_budget, 132 * KB, 638 "interrupt budget which should be used for the profiler counter") 639 DEFINE_INT(ticks_before_optimization, 3, 640 "the number of times we have to go through the interrupt budget " 641 "before considering this function for optimization") 642 DEFINE_INT(bytecode_size_allowance_per_tick, 1100, 643 "increases the number of ticks required for optimization by " 644 "bytecode.length/X") 645 DEFINE_INT( 646 max_bytecode_size_for_early_opt, 81, 647 "Maximum bytecode length for a function to be optimized on the first tick") 648 649 // Flags for inline caching and feedback vectors. 650 DEFINE_BOOL(use_ic, true, "use inline caching") 651 DEFINE_BOOL(lazy_feedback_allocation, true, "Allocate feedback vectors lazily") 652 653 // Flags for Ignition. 654 DEFINE_BOOL(ignition_elide_noneffectful_bytecodes, true, 655 "elide bytecodes which won't have any external effect") 656 DEFINE_BOOL(ignition_reo, true, "use ignition register equivalence optimizer") 657 DEFINE_BOOL(ignition_filter_expression_positions, true, 658 "filter expression positions before the bytecode pipeline") 659 DEFINE_BOOL(ignition_share_named_property_feedback, true, 660 "share feedback slots when loading the same named property from " 661 "the same object") 662 DEFINE_BOOL(print_bytecode, false, 663 "print bytecode generated by ignition interpreter") 664 DEFINE_BOOL(enable_lazy_source_positions, V8_LAZY_SOURCE_POSITIONS_BOOL, 665 "skip generating source positions during initial compile but " 666 "regenerate when actually required") 667 DEFINE_BOOL(stress_lazy_source_positions, false, 668 "collect lazy source positions immediately after lazy compile") 669 DEFINE_STRING(print_bytecode_filter, "*", 670 "filter for selecting which functions to print bytecode") 671 #ifdef V8_TRACE_UNOPTIMIZED 672 DEFINE_BOOL(trace_unoptimized, false, 673 "trace the bytecodes executed by all unoptimized execution") 674 DEFINE_BOOL(trace_ignition, false, 675 "trace the bytecodes executed by the ignition interpreter") 676 DEFINE_BOOL(trace_baseline_exec, false, 677 "trace the bytecodes executed by the baseline code") 678 DEFINE_WEAK_IMPLICATION(trace_unoptimized, trace_ignition) 679 DEFINE_WEAK_IMPLICATION(trace_unoptimized, trace_baseline_exec) 680 #endif 681 #ifdef V8_TRACE_FEEDBACK_UPDATES 682 DEFINE_BOOL( 683 trace_feedback_updates, false, 684 "trace updates to feedback vectors during ignition interpreter execution.") 685 #endif 686 DEFINE_BOOL(trace_ignition_codegen, false, 687 "trace the codegen of ignition interpreter bytecode handlers") 688 DEFINE_STRING( 689 trace_ignition_dispatches_output_file, nullptr, 690 "write the bytecode handler dispatch table to the specified file (d8 only) " 691 "(requires building with v8_enable_ignition_dispatch_counting)") 692 693 DEFINE_BOOL(trace_track_allocation_sites, false, 694 "trace the tracking of allocation sites") 695 DEFINE_BOOL(trace_migration, false, "trace object migration") 696 DEFINE_BOOL(trace_generalization, false, "trace map generalization") 697 698 // Flags for Sparkplug 699 #undef FLAG 700 #if ENABLE_SPARKPLUG 701 #define FLAG FLAG_FULL 702 #else 703 #define FLAG FLAG_READONLY 704 #endif 705 DEFINE_BOOL(sparkplug, ENABLE_SPARKPLUG_BY_DEFAULT, 706 "enable Sparkplug baseline compiler") 707 DEFINE_BOOL(always_sparkplug, false, "directly tier up to Sparkplug code") 708 #if ENABLE_SPARKPLUG 709 DEFINE_IMPLICATION(always_sparkplug, sparkplug) 710 DEFINE_BOOL(baseline_batch_compilation, true, "batch compile Sparkplug code") 711 #if defined(V8_OS_DARWIN) && defined(V8_HOST_ARCH_ARM64) 712 // M1 requires W^X. 713 DEFINE_BOOL_READONLY(concurrent_sparkplug, false, 714 "compile Sparkplug code in a background thread") 715 #else 716 DEFINE_BOOL(concurrent_sparkplug, false, 717 "compile Sparkplug code in a background thread") 718 DEFINE_WEAK_IMPLICATION(future, concurrent_sparkplug) 719 DEFINE_NEG_IMPLICATION(predictable, concurrent_sparkplug) 720 DEFINE_NEG_IMPLICATION(single_threaded, concurrent_sparkplug) 721 DEFINE_NEG_IMPLICATION(jitless, concurrent_sparkplug) 722 #endif 723 DEFINE_UINT( 724 concurrent_sparkplug_max_threads, 0, 725 "max number of threads that concurrent Sparkplug can use (0 for unbounded)") 726 #else 727 DEFINE_BOOL(baseline_batch_compilation, false, "batch compile Sparkplug code") 728 DEFINE_BOOL_READONLY(concurrent_sparkplug, false, 729 "compile Sparkplug code in a background thread") 730 #endif 731 DEFINE_STRING(sparkplug_filter, "*", "filter for Sparkplug baseline compiler") 732 DEFINE_BOOL(sparkplug_needs_short_builtins, false, 733 "only enable Sparkplug baseline compiler when " 734 "--short-builtin-calls are also enabled") 735 DEFINE_INT(baseline_batch_compilation_threshold, 4 * KB, 736 "the estimated instruction size of a batch to trigger compilation") 737 DEFINE_BOOL(trace_baseline, false, "trace baseline compilation") 738 DEFINE_BOOL(trace_baseline_batch_compilation, false, 739 "trace baseline batch compilation") 740 DEFINE_BOOL(trace_baseline_concurrent_compilation, false, 741 "trace baseline concurrent compilation") 742 #undef FLAG 743 #define FLAG FLAG_FULL 744 745 // Internalize into a shared string table in the shared isolate 746 DEFINE_BOOL(shared_string_table, false, "internalize strings into shared table") 747 DEFINE_IMPLICATION(harmony_struct, shared_string_table) 748 749 #if !defined(V8_OS_DARWIN) || !defined(V8_HOST_ARCH_ARM64) 750 DEFINE_BOOL(write_code_using_rwx, true, 751 "flip permissions to rwx to write page instead of rw") 752 DEFINE_NEG_IMPLICATION(jitless, write_code_using_rwx) 753 #else 754 DEFINE_BOOL_READONLY(write_code_using_rwx, false, 755 "flip permissions to rwx to write page instead of rw") 756 #endif 757 758 // Flags for concurrent recompilation. 759 DEFINE_BOOL(concurrent_recompilation, true, 760 "optimizing hot functions asynchronously on a separate thread") 761 DEFINE_BOOL(trace_concurrent_recompilation, false, 762 "track concurrent recompilation") 763 DEFINE_INT(concurrent_recompilation_queue_length, 8, 764 "the length of the concurrent compilation queue") 765 DEFINE_INT(concurrent_recompilation_delay, 0, 766 "artificial compilation delay in ms") 767 DEFINE_BOOL( 768 stress_concurrent_inlining, false, 769 "create additional concurrent optimization jobs but throw away result") 770 DEFINE_IMPLICATION(stress_concurrent_inlining, concurrent_recompilation) 771 DEFINE_NEG_IMPLICATION(stress_concurrent_inlining, lazy_feedback_allocation) 772 DEFINE_WEAK_VALUE_IMPLICATION(stress_concurrent_inlining, interrupt_budget, 773 15 * KB) 774 DEFINE_BOOL(stress_concurrent_inlining_attach_code, false, 775 "create additional concurrent optimization jobs") 776 DEFINE_IMPLICATION(stress_concurrent_inlining_attach_code, 777 stress_concurrent_inlining) 778 DEFINE_INT(max_serializer_nesting, 25, 779 "maximum levels for nesting child serializers") 780 DEFINE_BOOL(trace_heap_broker_verbose, false, 781 "trace the heap broker verbosely (all reports)") 782 DEFINE_BOOL(trace_heap_broker_memory, false, 783 "trace the heap broker memory (refs analysis and zone numbers)") 784 DEFINE_BOOL(trace_heap_broker, false, 785 "trace the heap broker (reports on missing data only)") 786 DEFINE_IMPLICATION(trace_heap_broker_verbose, trace_heap_broker) 787 DEFINE_IMPLICATION(trace_heap_broker_memory, trace_heap_broker) 788 DEFINE_IMPLICATION(trace_heap_broker, trace_pending_allocations) 789 790 // Flags for stress-testing the compiler. 791 DEFINE_INT(stress_runs, 0, "number of stress runs") 792 DEFINE_INT(deopt_every_n_times, 0, 793 "deoptimize every n times a deopt point is passed") 794 DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points") 795 796 // Flags for TurboFan. 797 DEFINE_BOOL(opt, true, "use adaptive optimizations") 798 DEFINE_BOOL(turbo_sp_frame_access, false, 799 "use stack pointer-relative access to frame wherever possible") 800 DEFINE_BOOL( 801 stress_turbo_late_spilling, false, 802 "optimize placement of all spill instructions, not just loop-top phis") 803 804 DEFINE_STRING(turbo_filter, "*", "optimization filter for TurboFan compiler") 805 DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR") 806 DEFINE_STRING(trace_turbo_path, nullptr, 807 "directory to dump generated TurboFan IR to") 808 DEFINE_STRING(trace_turbo_filter, "*", 809 "filter for tracing turbofan compilation") 810 DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs") 811 DEFINE_BOOL(trace_turbo_scheduled, false, "trace TurboFan IR with schedule") 812 DEFINE_IMPLICATION(trace_turbo_scheduled, trace_turbo_graph) 813 DEFINE_STRING(trace_turbo_cfg_file, nullptr, 814 "trace turbo cfg graph (for C1 visualizer) to a given file name") 815 DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types") 816 DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler") 817 DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers") 818 DEFINE_BOOL(trace_turbo_trimming, false, "trace TurboFan's graph trimmer") 819 DEFINE_BOOL(trace_turbo_jt, false, "trace TurboFan's jump threading") 820 DEFINE_BOOL(trace_turbo_ceq, false, "trace TurboFan's control equivalence") 821 DEFINE_BOOL(trace_turbo_loop, false, "trace TurboFan's loop optimizations") 822 DEFINE_BOOL(trace_turbo_alloc, false, "trace TurboFan's register allocator") 823 DEFINE_BOOL(trace_all_uses, false, "trace all use positions") 824 DEFINE_BOOL(trace_representation, false, "trace representation types") 825 DEFINE_BOOL( 826 trace_turbo_stack_accesses, false, 827 "trace stack load/store counters for optimized code in run-time (x64 only)") 828 DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase") 829 DEFINE_STRING(turbo_verify_machine_graph, nullptr, 830 "verify TurboFan machine graph before instruction selection") 831 #ifdef ENABLE_VERIFY_CSA 832 DEFINE_BOOL(verify_csa, DEBUG_BOOL, 833 "verify TurboFan machine graph of code stubs") 834 #else 835 // Define the flag as read-only-false so that code still compiles even in the 836 // non-ENABLE_VERIFY_CSA configuration. 837 DEFINE_BOOL_READONLY(verify_csa, false, 838 "verify TurboFan machine graph of code stubs") 839 #endif 840 DEFINE_BOOL(trace_verify_csa, false, "trace code stubs verification") 841 DEFINE_STRING(csa_trap_on_node, nullptr, 842 "trigger break point when a node with given id is created in " 843 "given stub. The format is: StubName,NodeId") 844 DEFINE_BOOL_READONLY(fixed_array_bounds_checks, true, 845 "enable FixedArray bounds checks") 846 DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics") 847 DEFINE_BOOL(turbo_stats_nvp, false, 848 "print TurboFan statistics in machine-readable format") 849 DEFINE_BOOL(turbo_stats_wasm, false, 850 "print TurboFan statistics of wasm compilations") 851 DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan") 852 DEFINE_BOOL(turbo_inlining, true, "enable inlining in TurboFan") 853 DEFINE_INT(max_inlined_bytecode_size, 460, 854 "maximum size of bytecode for a single inlining") 855 DEFINE_INT(max_inlined_bytecode_size_cumulative, 920, 856 "maximum cumulative size of bytecode considered for inlining") 857 DEFINE_INT(max_inlined_bytecode_size_absolute, 4600, 858 "maximum absolute size of bytecode considered for inlining") 859 DEFINE_FLOAT( 860 reserve_inline_budget_scale_factor, 1.2, 861 "scale factor of bytecode size used to calculate the inlining budget") 862 DEFINE_INT(max_inlined_bytecode_size_small, 27, 863 "maximum size of bytecode considered for small function inlining") 864 DEFINE_INT(max_optimized_bytecode_size, 60 * KB, 865 "maximum bytecode size to " 866 "be considered for optimization; too high values may cause " 867 "the compiler to hit (release) assertions") 868 DEFINE_FLOAT(min_inlining_frequency, 0.15, "minimum frequency for inlining") 869 DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining") 870 DEFINE_BOOL(stress_inline, false, 871 "set high thresholds for inlining to inline as much as possible") 872 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size, 999999) 873 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_cumulative, 874 999999) 875 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_absolute, 876 999999) 877 DEFINE_VALUE_IMPLICATION(stress_inline, min_inlining_frequency, 0) 878 DEFINE_IMPLICATION(stress_inline, polymorphic_inlining) 879 DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining") 880 DEFINE_BOOL(turbo_inline_array_builtins, true, 881 "inline array builtins in TurboFan code") 882 DEFINE_BOOL(use_osr, true, "use on-stack replacement") 883 DEFINE_BOOL(concurrent_osr, false, "enable concurrent OSR") 884 DEFINE_WEAK_IMPLICATION(future, concurrent_osr) 885 DEFINE_BOOL(trace_osr, false, "trace on-stack replacement") 886 DEFINE_BOOL(analyze_environment_liveness, true, 887 "analyze liveness of environment slots and zap dead values") 888 DEFINE_BOOL(trace_environment_liveness, false, 889 "trace liveness of local variable slots") 890 DEFINE_BOOL(turbo_load_elimination, true, "enable load elimination in TurboFan") 891 DEFINE_BOOL(trace_turbo_load_elimination, false, 892 "trace TurboFan load elimination") 893 DEFINE_BOOL(turbo_profiling, false, "enable basic block profiling in TurboFan") 894 DEFINE_BOOL(turbo_profiling_verbose, false, 895 "enable basic block profiling in TurboFan, and include each " 896 "function's schedule and disassembly in the output") 897 DEFINE_IMPLICATION(turbo_profiling_verbose, turbo_profiling) 898 DEFINE_BOOL(turbo_profiling_log_builtins, false, 899 "emit data about basic block usage in builtins to v8.log (requires " 900 "that V8 was built with v8_enable_builtins_profiling=true)") 901 DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL, 902 "verify register allocation in TurboFan") 903 DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan") 904 DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan") 905 DEFINE_BOOL(turbo_loop_peeling, true, "TurboFan loop peeling") 906 DEFINE_BOOL(turbo_loop_variable, true, "TurboFan loop variable optimization") 907 DEFINE_BOOL(turbo_loop_rotation, true, "TurboFan loop rotation") 908 DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan") 909 DEFINE_BOOL(turbo_escape, true, "enable escape analysis") 910 DEFINE_BOOL(turbo_allocation_folding, true, "TurboFan allocation folding") 911 DEFINE_BOOL(turbo_instruction_scheduling, false, 912 "enable instruction scheduling in TurboFan") 913 DEFINE_BOOL(turbo_stress_instruction_scheduling, false, 914 "randomly schedule instructions to stress dependency tracking") 915 DEFINE_IMPLICATION(turbo_stress_instruction_scheduling, 916 turbo_instruction_scheduling) 917 DEFINE_BOOL(turbo_store_elimination, true, 918 "enable store-store elimination in TurboFan") 919 DEFINE_BOOL(trace_store_elimination, false, "trace store elimination") 920 DEFINE_BOOL(turbo_rewrite_far_jumps, true, 921 "rewrite far to near jumps (ia32,x64)") 922 DEFINE_BOOL( 923 stress_gc_during_compilation, false, 924 "simulate GC/compiler thread race related to https://crbug.com/v8/8520") 925 DEFINE_BOOL(turbo_fast_api_calls, false, "enable fast API calls from TurboFan") 926 DEFINE_BOOL(turbo_compress_translation_arrays, false, 927 "compress translation arrays (experimental)") 928 DEFINE_WEAK_IMPLICATION(future, turbo_inline_js_wasm_calls) 929 DEFINE_BOOL(turbo_inline_js_wasm_calls, false, "inline JS->Wasm calls") 930 DEFINE_BOOL(turbo_use_mid_tier_regalloc_for_huge_functions, true, 931 "fall back to the mid-tier register allocator for huge functions") 932 DEFINE_BOOL(turbo_force_mid_tier_regalloc, false, 933 "always use the mid-tier register allocator (for testing)") 934 935 DEFINE_BOOL(turbo_optimize_apply, true, "optimize Function.prototype.apply") 936 937 DEFINE_BOOL(turbo_collect_feedback_in_generic_lowering, true, 938 "enable experimental feedback collection in generic lowering.") 939 DEFINE_BOOL(isolate_script_cache_ageing, true, 940 "enable ageing of the isolate script cache.") 941 942 DEFINE_FLOAT(script_delay, 0, "busy wait [ms] on every Script::Run") 943 DEFINE_FLOAT(script_delay_once, 0, "busy wait [ms] on the first Script::Run") 944 DEFINE_FLOAT(script_delay_fraction, 0.0, 945 "busy wait after each Script::Run by the given fraction of the " 946 "run's duration") 947 948 // Favor memory over execution speed. 949 DEFINE_BOOL(optimize_for_size, false, 950 "Enables optimizations which favor memory size over execution " 951 "speed") 952 DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1) 953 954 // Flags for WebAssembly. 955 #if V8_ENABLE_WEBASSEMBLY 956 957 DEFINE_BOOL(wasm_generic_wrapper, true, 958 "allow use of the generic js-to-wasm wrapper instead of " 959 "per-signature wrappers") 960 DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript") 961 DEFINE_INT(wasm_num_compilation_tasks, 128, 962 "maximum number of parallel compilation tasks for wasm") 963 DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0) 964 DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false, 965 "trace wasm native heap events") 966 DEFINE_BOOL(wasm_write_protect_code_memory, true, 967 "write protect code memory on the wasm native heap with mprotect") 968 DEFINE_BOOL(wasm_memory_protection_keys, true, 969 "protect wasm code memory with PKU if available (takes precedence " 970 "over --wasm-write-protect-code-memory)") 971 DEFINE_DEBUG_BOOL(trace_wasm_serialization, false, 972 "trace serialization/deserialization") 973 DEFINE_BOOL(wasm_async_compilation, true, 974 "enable actual asynchronous compilation for WebAssembly.compile") 975 DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation) 976 DEFINE_BOOL(wasm_test_streaming, false, 977 "use streaming compilation instead of async compilation for tests") 978 DEFINE_UINT(wasm_max_mem_pages, v8::internal::wasm::kV8MaxWasmMemoryPages, 979 "maximum number of 64KiB memory pages per wasm memory") 980 DEFINE_UINT(wasm_max_table_size, v8::internal::wasm::kV8MaxWasmTableSize, 981 "maximum table size of a wasm instance") 982 DEFINE_UINT(wasm_max_code_space, v8::internal::kMaxWasmCodeMB, 983 "maximum committed code space for wasm (in MB)") 984 DEFINE_BOOL(wasm_tier_up, true, 985 "enable tier up to the optimizing compiler (requires --liftoff to " 986 "have an effect)") 987 DEFINE_BOOL(wasm_dynamic_tiering, true, 988 "enable dynamic tier up to the optimizing compiler") 989 DEFINE_NEG_NEG_IMPLICATION(liftoff, wasm_dynamic_tiering) 990 DEFINE_INT(wasm_tiering_budget, 1800000, 991 "budget for dynamic tiering (rough approximation of bytes executed") 992 DEFINE_INT( 993 wasm_caching_threshold, 1000000, 994 "the amount of wasm top tier code that triggers the next caching event") 995 DEFINE_BOOL(trace_wasm_compilation_times, false, 996 "print how long it took to compile each wasm function") 997 DEFINE_INT(wasm_tier_up_filter, -1, "only tier-up function with this index") 998 DEFINE_DEBUG_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code") 999 DEFINE_DEBUG_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code") 1000 DEFINE_DEBUG_BOOL(trace_wasm_interpreter, false, 1001 "trace interpretation of wasm code") 1002 DEFINE_DEBUG_BOOL(trace_wasm_streaming, false, 1003 "trace streaming compilation of wasm code") 1004 DEFINE_DEBUG_BOOL(trace_wasm_stack_switching, false, 1005 "trace wasm stack switching") 1006 DEFINE_BOOL(liftoff, true, 1007 "enable Liftoff, the baseline compiler for WebAssembly") 1008 DEFINE_BOOL(liftoff_only, false, 1009 "disallow TurboFan compilation for WebAssembly (for testing)") 1010 DEFINE_IMPLICATION(liftoff_only, liftoff) 1011 DEFINE_NEG_IMPLICATION(liftoff_only, wasm_tier_up) 1012 DEFINE_NEG_IMPLICATION(liftoff_only, wasm_dynamic_tiering) 1013 DEFINE_NEG_IMPLICATION(fuzzing, liftoff_only) 1014 DEFINE_DEBUG_BOOL( 1015 enable_testing_opcode_in_wasm, false, 1016 "enables a testing opcode in wasm that is only implemented in TurboFan") 1017 // We can't tier up (from Liftoff to TurboFan) in single-threaded mode, hence 1018 // disable tier up in that configuration for now. 1019 DEFINE_NEG_IMPLICATION(single_threaded, wasm_tier_up) 1020 DEFINE_DEBUG_BOOL(trace_liftoff, false, 1021 "trace Liftoff, the baseline compiler for WebAssembly") 1022 DEFINE_BOOL(trace_wasm_memory, false, 1023 "print all memory updates performed in wasm code") 1024 // Fuzzers use {wasm_tier_mask_for_testing} and {wasm_debug_mask_for_testing} 1025 // together with {liftoff} and {no_wasm_tier_up} to force some functions to be 1026 // compiled with TurboFan or for debug. 1027 DEFINE_INT(wasm_tier_mask_for_testing, 0, 1028 "bitmask of functions to compile with TurboFan instead of Liftoff") 1029 DEFINE_INT(wasm_debug_mask_for_testing, 0, 1030 "bitmask of functions to compile for debugging, only applies if the " 1031 "tier is Liftoff") 1032 1033 DEFINE_BOOL(validate_asm, true, "validate asm.js modules before compiling") 1034 // asm.js validation is disabled since it triggers wasm code generation. 1035 // --jitless also implies --no-expose-wasm, see InitializeOncePerProcessImpl. 1036 DEFINE_NEG_IMPLICATION(jitless, validate_asm) 1037 DEFINE_BOOL(suppress_asm_messages, false, 1038 "don't emit asm.js related messages (for golden file testing)") 1039 DEFINE_BOOL(trace_asm_time, false, "print asm.js timing info to the console") 1040 DEFINE_BOOL(trace_asm_scanner, false, 1041 "print tokens encountered by asm.js scanner") 1042 DEFINE_BOOL(trace_asm_parser, false, "verbose logging of asm.js parse failures") 1043 DEFINE_BOOL(stress_validate_asm, false, "try to validate everything as asm.js") 1044 1045 DEFINE_DEBUG_BOOL(dump_wasm_module, false, "dump wasm module bytes") 1046 DEFINE_STRING(dump_wasm_module_path, nullptr, 1047 "directory to dump wasm modules to") 1048 1049 // Declare command-line flags for Wasm features. Warning: avoid using these 1050 // flags directly in the implementation. Instead accept wasm::WasmFeatures 1051 // for configurability. 1052 #include "src/wasm/wasm-feature-flags.h" 1053 1054 #define DECL_WASM_FLAG(feat, desc, val) \ 1055 DEFINE_BOOL(experimental_wasm_##feat, val, \ 1056 "enable prototype " desc " for wasm") 1057 FOREACH_WASM_FEATURE_FLAG(DECL_WASM_FLAG) 1058 #undef DECL_WASM_FLAG 1059 1060 DEFINE_IMPLICATION(experimental_wasm_gc, experimental_wasm_typed_funcref) 1061 1062 DEFINE_BOOL(wasm_gc_js_interop, false, "experimental WasmGC-JS interop") 1063 1064 DEFINE_BOOL(wasm_staging, false, "enable staged wasm features") 1065 1066 #define WASM_STAGING_IMPLICATION(feat, desc, val) \ 1067 DEFINE_IMPLICATION(wasm_staging, experimental_wasm_##feat) 1068 FOREACH_WASM_STAGING_FEATURE_FLAG(WASM_STAGING_IMPLICATION) 1069 #undef WASM_STAGING_IMPLICATION 1070 1071 DEFINE_BOOL(wasm_opt, true, "enable wasm optimization") 1072 DEFINE_BOOL( 1073 wasm_bounds_checks, true, 1074 "enable bounds checks (disable for performance testing only)") 1075 DEFINE_BOOL(wasm_stack_checks, true, 1076 "enable stack checks (disable for performance testing only)") 1077 DEFINE_BOOL( 1078 wasm_enforce_bounds_checks, false, 1079 "enforce explicit bounds check even if the trap handler is available") 1080 // "no bounds checks" implies "no enforced bounds checks". 1081 DEFINE_NEG_NEG_IMPLICATION(wasm_bounds_checks, wasm_enforce_bounds_checks) 1082 DEFINE_BOOL(wasm_math_intrinsics, true, 1083 "intrinsify some Math imports into wasm") 1084 1085 DEFINE_BOOL( 1086 wasm_inlining, false, 1087 "enable inlining of wasm functions into wasm functions (experimental)") 1088 DEFINE_SIZE_T( 1089 wasm_inlining_budget_factor, 75000, 1090 "maximum allowed size to inline a function is given by {n / caller size}") 1091 DEFINE_SIZE_T(wasm_inlining_max_size, 1000, 1092 "maximum size of a function that can be inlined, in TF nodes") 1093 DEFINE_BOOL(wasm_speculative_inlining, false, 1094 "enable speculative inlining of call_ref targets (experimental)") 1095 DEFINE_BOOL(trace_wasm_inlining, false, "trace wasm inlining") 1096 DEFINE_BOOL(trace_wasm_speculative_inlining, false, 1097 "trace wasm speculative inlining") 1098 DEFINE_BOOL(wasm_type_canonicalization, false, 1099 "apply isorecursive canonicalization on wasm types") 1100 DEFINE_IMPLICATION(wasm_speculative_inlining, wasm_dynamic_tiering) 1101 DEFINE_IMPLICATION(wasm_speculative_inlining, wasm_inlining) 1102 DEFINE_WEAK_IMPLICATION(experimental_wasm_gc, wasm_speculative_inlining) 1103 DEFINE_WEAK_IMPLICATION(experimental_wasm_typed_funcref, 1104 wasm_type_canonicalization) 1105 // Speculative inlining needs type feedback from Liftoff and compilation in 1106 // Turbofan. 1107 DEFINE_NEG_NEG_IMPLICATION(liftoff, wasm_speculative_inlining) 1108 DEFINE_NEG_IMPLICATION(liftoff_only, wasm_speculative_inlining) 1109 1110 DEFINE_BOOL(wasm_loop_unrolling, true, 1111 "enable loop unrolling for wasm functions") 1112 DEFINE_BOOL(wasm_loop_peeling, false, "enable loop peeling for wasm functions") 1113 DEFINE_BOOL(wasm_fuzzer_gen_test, false, 1114 "generate a test case when running a wasm fuzzer") 1115 DEFINE_IMPLICATION(wasm_fuzzer_gen_test, single_threaded) 1116 DEFINE_BOOL(print_wasm_code, false, "print WebAssembly code") 1117 DEFINE_INT(print_wasm_code_function_index, -1, 1118 "print WebAssembly code for function at index") 1119 DEFINE_BOOL(print_wasm_stub_code, false, "print WebAssembly stub code") 1120 DEFINE_BOOL(asm_wasm_lazy_compilation, false, 1121 "enable lazy compilation for asm-wasm modules") 1122 DEFINE_IMPLICATION(validate_asm, asm_wasm_lazy_compilation) 1123 DEFINE_BOOL(wasm_lazy_compilation, false, 1124 "enable lazy compilation for all wasm modules") 1125 DEFINE_DEBUG_BOOL(trace_wasm_lazy_compilation, false, 1126 "trace lazy compilation of wasm functions") 1127 DEFINE_BOOL(wasm_lazy_validation, false, 1128 "enable lazy validation for lazily compiled wasm functions") 1129 DEFINE_BOOL(wasm_simd_ssse3_codegen, false, "allow wasm SIMD SSSE3 codegen") 1130 1131 DEFINE_BOOL(wasm_code_gc, true, "enable garbage collection of wasm code") 1132 DEFINE_BOOL(trace_wasm_code_gc, false, "trace garbage collection of wasm code") 1133 DEFINE_BOOL(stress_wasm_code_gc, false, 1134 "stress test garbage collection of wasm code") 1135 DEFINE_INT(wasm_max_initial_code_space_reservation, 0, 1136 "maximum size of the initial wasm code space reservation (in MB)") 1137 1138 DEFINE_BOOL(experimental_wasm_allow_huge_modules, false, 1139 "allow wasm modules bigger than 1GB, but below ~2GB") 1140 1141 DEFINE_BOOL(trace_wasm, false, "trace wasm function calls") 1142 1143 // Flags for Wasm GDB remote debugging. 1144 #ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING 1145 #define DEFAULT_WASM_GDB_REMOTE_PORT 8765 1146 DEFINE_BOOL(wasm_gdb_remote, false, 1147 "enable GDB-remote for WebAssembly debugging") 1148 DEFINE_NEG_IMPLICATION(wasm_gdb_remote, wasm_tier_up) 1149 DEFINE_INT(wasm_gdb_remote_port, DEFAULT_WASM_GDB_REMOTE_PORT, 1150 "default port for WebAssembly debugging with LLDB.") 1151 DEFINE_BOOL(wasm_pause_waiting_for_debugger, false, 1152 "pause at the first Webassembly instruction waiting for a debugger " 1153 "to attach") 1154 DEFINE_BOOL(trace_wasm_gdb_remote, false, "trace Webassembly GDB-remote server") 1155 #endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING 1156 1157 // wasm instance management 1158 DEFINE_DEBUG_BOOL(trace_wasm_instances, false, 1159 "trace creation and collection of wasm instances") 1160 1161 #endif // V8_ENABLE_WEBASSEMBLY 1162 1163 DEFINE_INT(stress_sampling_allocation_profiler, 0, 1164 "Enables sampling allocation profiler with X as a sample interval") 1165 1166 // Garbage collections flags. 1167 DEFINE_BOOL(lazy_new_space_shrinking, false, 1168 "Enables the lazy new space shrinking strategy") 1169 DEFINE_SIZE_T(min_semi_space_size, 0, 1170 "min size of a semi-space (in MBytes), the new space consists of " 1171 "two semi-spaces") 1172 DEFINE_SIZE_T(max_semi_space_size, 0, 1173 "max size of a semi-space (in MBytes), the new space consists of " 1174 "two semi-spaces") 1175 DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space") 1176 DEFINE_SIZE_T(max_old_space_size, 0, "max size of the old space (in Mbytes)") 1177 DEFINE_SIZE_T( 1178 max_heap_size, 0, 1179 "max size of the heap (in Mbytes) " 1180 "both max_semi_space_size and max_old_space_size take precedence. " 1181 "All three flags cannot be specified at the same time.") 1182 DEFINE_SIZE_T(initial_heap_size, 0, "initial size of the heap (in Mbytes)") 1183 DEFINE_BOOL(huge_max_old_generation_size, true, 1184 "Increase max size of the old space to 4 GB for x64 systems with" 1185 "the physical memory bigger than 16 GB") 1186 DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)") 1187 DEFINE_BOOL(separate_gc_phases, false, 1188 "yound and full garbage collection phases are not overlapping") 1189 DEFINE_BOOL(global_gc_scheduling, true, 1190 "enable GC scheduling based on global memory") 1191 DEFINE_BOOL(gc_global, false, "always perform global GCs") 1192 DEFINE_INT(random_gc_interval, 0, 1193 "Collect garbage after random(0, X) allocations. It overrides " 1194 "gc_interval.") 1195 DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations") 1196 DEFINE_INT(retain_maps_for_n_gc, 2, 1197 "keeps maps alive for <n> old space garbage collections") 1198 DEFINE_BOOL(trace_gc, false, 1199 "print one trace line following each garbage collection") 1200 DEFINE_BOOL(trace_gc_nvp, false, 1201 "print one detailed trace line in name=value format " 1202 "after each garbage collection") 1203 DEFINE_BOOL(trace_gc_ignore_scavenger, false, 1204 "do not print trace line after scavenger collection") 1205 DEFINE_BOOL(trace_idle_notification, false, 1206 "print one trace line following each idle notification") 1207 DEFINE_BOOL(trace_idle_notification_verbose, false, 1208 "prints the heap state used by the idle notification") 1209 DEFINE_BOOL(trace_gc_verbose, false, 1210 "print more details following each garbage collection") 1211 DEFINE_IMPLICATION(trace_gc_verbose, trace_gc) 1212 DEFINE_BOOL(trace_gc_freelists, false, 1213 "prints details of each freelist before and after " 1214 "each major garbage collection") 1215 DEFINE_BOOL(trace_gc_freelists_verbose, false, 1216 "prints details of freelists of each page before and after " 1217 "each major garbage collection") 1218 DEFINE_IMPLICATION(trace_gc_freelists_verbose, trace_gc_freelists) 1219 DEFINE_BOOL(trace_gc_heap_layout, false, 1220 "print layout of pages in heap before and after gc") 1221 DEFINE_BOOL(trace_gc_heap_layout_ignore_minor_gc, true, 1222 "do not print trace line before and after minor-gc") 1223 DEFINE_BOOL(trace_evacuation_candidates, false, 1224 "Show statistics about the pages evacuation by the compaction") 1225 DEFINE_BOOL( 1226 trace_allocations_origins, false, 1227 "Show statistics about the origins of allocations. " 1228 "Combine with --no-inline-new to track allocations from generated code") 1229 DEFINE_BOOL(trace_pending_allocations, false, 1230 "trace calls to Heap::IsAllocationPending that return true") 1231 1232 DEFINE_INT(trace_allocation_stack_interval, -1, 1233 "print stack trace after <n> free-list allocations") 1234 DEFINE_INT(trace_duplicate_threshold_kb, 0, 1235 "print duplicate objects in the heap if their size is more than " 1236 "given threshold") 1237 DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space") 1238 DEFINE_BOOL(trace_fragmentation_verbose, false, 1239 "report fragmentation for old space (detailed)") 1240 DEFINE_BOOL(minor_mc_trace_fragmentation, false, 1241 "trace fragmentation after marking") 1242 DEFINE_BOOL(trace_evacuation, false, "report evacuation statistics") 1243 DEFINE_BOOL(trace_mutator_utilization, false, 1244 "print mutator utilization, allocation speed, gc speed") 1245 DEFINE_BOOL(incremental_marking, true, "use incremental marking") 1246 DEFINE_BOOL(incremental_marking_wrappers, true, 1247 "use incremental marking for marking wrappers") 1248 DEFINE_BOOL(incremental_marking_task, true, "use tasks for incremental marking") 1249 DEFINE_INT(incremental_marking_soft_trigger, 0, 1250 "threshold for starting incremental marking via a task in percent " 1251 "of available space: limit - size") 1252 DEFINE_INT(incremental_marking_hard_trigger, 0, 1253 "threshold for starting incremental marking immediately in percent " 1254 "of available space: limit - size") 1255 DEFINE_BOOL(trace_unmapper, false, "Trace the unmapping") 1256 DEFINE_BOOL(parallel_scavenge, true, "parallel scavenge") 1257 DEFINE_BOOL(scavenge_task, true, "schedule scavenge tasks") 1258 DEFINE_INT(scavenge_task_trigger, 80, 1259 "scavenge task trigger in percent of the current heap limit") 1260 DEFINE_BOOL(scavenge_separate_stack_scanning, false, 1261 "use a separate phase for stack scanning in scavenge") 1262 DEFINE_BOOL(trace_parallel_scavenge, false, "trace parallel scavenge") 1263 #if MUST_WRITE_PROTECT_CODE_MEMORY 1264 DEFINE_BOOL_READONLY(write_protect_code_memory, true, 1265 "write protect code memory") 1266 #else 1267 DEFINE_BOOL(write_protect_code_memory, true, "write protect code memory") 1268 #endif 1269 #if defined(V8_ATOMIC_OBJECT_FIELD_WRITES) 1270 #define V8_CONCURRENT_MARKING_BOOL true 1271 #else 1272 #define V8_CONCURRENT_MARKING_BOOL false 1273 #endif 1274 DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING_BOOL, 1275 "use concurrent marking") 1276 DEFINE_BOOL(concurrent_array_buffer_sweeping, true, 1277 "concurrently sweep array buffers") 1278 DEFINE_BOOL(stress_concurrent_allocation, false, 1279 "start background threads that allocate memory") 1280 DEFINE_BOOL(parallel_marking, V8_CONCURRENT_MARKING_BOOL, 1281 "use parallel marking in atomic pause") 1282 DEFINE_INT(ephemeron_fixpoint_iterations, 10, 1283 "number of fixpoint iterations it takes to switch to linear " 1284 "ephemeron algorithm") 1285 DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking") 1286 DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping") 1287 DEFINE_BOOL(parallel_compaction, true, "use parallel compaction") 1288 DEFINE_BOOL(parallel_pointer_update, true, 1289 "use parallel pointer update during compaction") 1290 DEFINE_BOOL(detect_ineffective_gcs_near_heap_limit, true, 1291 "trigger out-of-memory failure to avoid GC storm near heap limit") 1292 DEFINE_BOOL(trace_incremental_marking, false, 1293 "trace progress of the incremental marking") 1294 DEFINE_BOOL(trace_stress_marking, false, "trace stress marking progress") 1295 DEFINE_BOOL(trace_stress_scavenge, false, "trace stress scavenge progress") 1296 DEFINE_BOOL(track_gc_object_stats, false, 1297 "track object counts and memory usage") 1298 DEFINE_BOOL(trace_gc_object_stats, false, 1299 "trace object counts and memory usage") 1300 DEFINE_BOOL(trace_zone_stats, false, "trace zone memory usage") 1301 DEFINE_GENERIC_IMPLICATION( 1302 trace_zone_stats, 1303 TracingFlags::zone_stats.store( 1304 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1305 DEFINE_SIZE_T( 1306 zone_stats_tolerance, 1 * MB, 1307 "report a tick only when allocated zone memory changes by this amount") 1308 DEFINE_BOOL(trace_zone_type_stats, false, "trace per-type zone memory usage") 1309 DEFINE_GENERIC_IMPLICATION( 1310 trace_zone_type_stats, 1311 TracingFlags::zone_stats.store( 1312 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1313 DEFINE_BOOL(track_retaining_path, false, 1314 "enable support for tracking retaining path") 1315 DEFINE_DEBUG_BOOL(trace_backing_store, false, "trace backing store events") 1316 DEFINE_INT(gc_stats, 0, "Used by tracing internally to enable gc statistics") 1317 DEFINE_IMPLICATION(trace_gc_object_stats, track_gc_object_stats) 1318 DEFINE_GENERIC_IMPLICATION( 1319 track_gc_object_stats, 1320 TracingFlags::gc_stats.store( 1321 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1322 DEFINE_GENERIC_IMPLICATION( 1323 trace_gc_object_stats, 1324 TracingFlags::gc_stats.store( 1325 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1326 DEFINE_NEG_IMPLICATION(trace_gc_object_stats, incremental_marking) 1327 DEFINE_NEG_IMPLICATION(track_retaining_path, parallel_marking) 1328 DEFINE_NEG_IMPLICATION(track_retaining_path, concurrent_marking) 1329 DEFINE_BOOL(track_detached_contexts, true, 1330 "track native contexts that are expected to be garbage collected") 1331 DEFINE_BOOL(trace_detached_contexts, false, 1332 "trace native contexts that are expected to be garbage collected") 1333 DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts) 1334 #ifdef VERIFY_HEAP 1335 DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC") 1336 DEFINE_BOOL(verify_heap_skip_remembered_set, false, 1337 "disable remembered set verification") 1338 #endif 1339 DEFINE_BOOL(move_object_start, true, "enable moving of object starts") 1340 DEFINE_BOOL(memory_reducer, true, "use memory reducer") 1341 DEFINE_BOOL(memory_reducer_for_small_heaps, true, 1342 "use memory reducer for small heaps") 1343 DEFINE_INT(heap_growing_percent, 0, 1344 "specifies heap growing factor as (1 + heap_growing_percent/100)") 1345 DEFINE_INT(v8_os_page_size, 0, "override OS page size (in KBytes)") 1346 DEFINE_BOOL(allocation_buffer_parking, true, "allocation buffer parking") 1347 DEFINE_BOOL(compact, true, 1348 "Perform compaction on full GCs based on V8's default heuristics") 1349 DEFINE_BOOL(compact_code_space, true, 1350 "Perform code space compaction on full collections.") 1351 DEFINE_BOOL(compact_maps, false, 1352 "Perform compaction on maps on full collections.") 1353 DEFINE_BOOL(use_map_space, true, "Use separate space for maps.") 1354 // Without a map space we have to compact maps. 1355 DEFINE_NEG_VALUE_IMPLICATION(use_map_space, compact_maps, true) 1356 DEFINE_BOOL(compact_on_every_full_gc, false, 1357 "Perform compaction on every full GC") 1358 DEFINE_BOOL(compact_with_stack, true, 1359 "Perform compaction when finalizing a full GC with stack") 1360 DEFINE_BOOL( 1361 compact_code_space_with_stack, true, 1362 "Perform code space compaction when finalizing a full GC with stack") 1363 DEFINE_BOOL(stress_compaction, false, 1364 "Stress GC compaction to flush out bugs (implies " 1365 "--force_marking_deque_overflows)") 1366 DEFINE_BOOL(stress_compaction_random, false, 1367 "Stress GC compaction by selecting random percent of pages as " 1368 "evacuation candidates. Overrides stress_compaction.") 1369 DEFINE_BOOL(flush_baseline_code, false, 1370 "flush of baseline code when it has not been executed recently") 1371 DEFINE_BOOL(flush_bytecode, true, 1372 "flush of bytecode when it has not been executed recently") 1373 DEFINE_BOOL(stress_flush_code, false, "stress code flushing") 1374 DEFINE_BOOL(trace_flush_bytecode, false, "trace bytecode flushing") 1375 DEFINE_BOOL(use_marking_progress_bar, true, 1376 "Use a progress bar to scan large objects in increments when " 1377 "incremental marking is active.") 1378 DEFINE_BOOL(stress_per_context_marking_worklist, false, 1379 "Use per-context worklist for marking") 1380 DEFINE_BOOL(force_marking_deque_overflows, false, 1381 "force overflows of marking deque by reducing it's size " 1382 "to 64 words") 1383 DEFINE_BOOL(stress_incremental_marking, false, 1384 "force incremental marking for small heaps and run it more often") 1385 1386 DEFINE_BOOL(fuzzer_gc_analysis, false, 1387 "prints number of allocations and enables analysis mode for gc " 1388 "fuzz testing, e.g. --stress-marking, --stress-scavenge") 1389 DEFINE_INT(stress_marking, 0, 1390 "force marking at random points between 0 and X (inclusive) percent " 1391 "of the regular marking start limit") 1392 DEFINE_INT(stress_scavenge, 0, 1393 "force scavenge at random points between 0 and X (inclusive) " 1394 "percent of the new space capacity") 1395 DEFINE_VALUE_IMPLICATION(fuzzer_gc_analysis, stress_marking, 99) 1396 DEFINE_VALUE_IMPLICATION(fuzzer_gc_analysis, stress_scavenge, 99) 1397 DEFINE_BOOL( 1398 reclaim_unmodified_wrappers, true, 1399 "reclaim otherwise unreachable unmodified wrapper objects when possible") 1400 1401 // These flags will be removed after experiments. Do not rely on them. 1402 DEFINE_BOOL(gc_experiment_less_compaction, false, 1403 "less compaction in non-memory reducing mode") 1404 1405 DEFINE_BOOL(disable_abortjs, false, "disables AbortJS runtime function") 1406 1407 DEFINE_BOOL(randomize_all_allocations, false, 1408 "randomize virtual memory reservations by ignoring any hints " 1409 "passed when allocating pages") 1410 1411 DEFINE_BOOL(manual_evacuation_candidates_selection, false, 1412 "Test mode only flag. It allows an unit test to select evacuation " 1413 "candidates pages (requires --stress_compaction).") 1414 DEFINE_BOOL(fast_promotion_new_space, false, 1415 "fast promote new space on high survival rates") 1416 1417 DEFINE_BOOL(clear_free_memory, false, "initialize free memory with 0") 1418 1419 DEFINE_BOOL(crash_on_aborted_evacuation, false, 1420 "crash when evacuation of page fails") 1421 1422 // assembler-ia32.cc / assembler-arm.cc / assembler-arm64.cc / assembler-x64.cc 1423 #ifdef V8_ENABLE_DEBUG_CODE 1424 DEFINE_BOOL(debug_code, DEBUG_BOOL, 1425 "generate extra code (assertions) for debugging") 1426 #else 1427 DEFINE_BOOL_READONLY(debug_code, false, "") 1428 #endif 1429 #ifdef V8_CODE_COMMENTS 1430 DEFINE_BOOL(code_comments, false, 1431 "emit comments in code disassembly; for more readable source " 1432 "positions you should add --no-concurrent_recompilation") 1433 #else 1434 DEFINE_BOOL_READONLY(code_comments, false, "") 1435 #endif 1436 DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available") 1437 DEFINE_BOOL(enable_ssse3, true, "enable use of SSSE3 instructions if available") 1438 DEFINE_BOOL(enable_sse4_1, true, 1439 "enable use of SSE4.1 instructions if available") 1440 DEFINE_BOOL(enable_sse4_2, true, 1441 "enable use of SSE4.2 instructions if available") 1442 DEFINE_BOOL(enable_sahf, true, 1443 "enable use of SAHF instruction if available (X64 only)") 1444 DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available") 1445 DEFINE_BOOL(enable_avx2, true, "enable use of AVX2 instructions if available") 1446 DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available") 1447 DEFINE_BOOL(enable_bmi1, true, "enable use of BMI1 instructions if available") 1448 DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available") 1449 DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available") 1450 DEFINE_BOOL(enable_popcnt, true, 1451 "enable use of POPCNT instruction if available") 1452 DEFINE_STRING(arm_arch, ARM_ARCH_DEFAULT, 1453 "generate instructions for the selected ARM architecture if " 1454 "available: armv6, armv7, armv7+sudiv or armv8") 1455 DEFINE_BOOL(force_long_branches, false, 1456 "force all emitted branches to be in long mode (MIPS/PPC only)") 1457 DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu") 1458 DEFINE_BOOL(partial_constant_pool, true, 1459 "enable use of partial constant pools (X64 only)") 1460 DEFINE_STRING(sim_arm64_optional_features, "none", 1461 "enable optional features on the simulator for testing: none or " 1462 "all") 1463 1464 #if defined(V8_TARGET_ARCH_RISCV64) 1465 DEFINE_BOOL(riscv_trap_to_simulator_debugger, false, 1466 "enable simulator trap to debugger") 1467 DEFINE_BOOL(riscv_debug, false, "enable debug prints") 1468 1469 DEFINE_BOOL(riscv_constant_pool, true, 1470 "enable constant pool (RISCV only)") 1471 1472 DEFINE_BOOL(riscv_c_extension, false, 1473 "enable compressed extension isa variant (RISCV only)") 1474 #endif 1475 1476 // Controlling source positions for Torque/CSA code. 1477 DEFINE_BOOL(enable_source_at_csa_bind, false, 1478 "Include source information in the binary at CSA bind locations.") 1479 1480 // Deprecated ARM flags (replaced by arm_arch). 1481 DEFINE_MAYBE_BOOL(enable_armv7, "deprecated (use --arm_arch instead)") 1482 DEFINE_MAYBE_BOOL(enable_vfp3, "deprecated (use --arm_arch instead)") 1483 DEFINE_MAYBE_BOOL(enable_32dregs, "deprecated (use --arm_arch instead)") 1484 DEFINE_MAYBE_BOOL(enable_neon, "deprecated (use --arm_arch instead)") 1485 DEFINE_MAYBE_BOOL(enable_sudiv, "deprecated (use --arm_arch instead)") 1486 DEFINE_MAYBE_BOOL(enable_armv8, "deprecated (use --arm_arch instead)") 1487 1488 // regexp-macro-assembler-*.cc 1489 DEFINE_BOOL(enable_regexp_unaligned_accesses, true, 1490 "enable unaligned accesses for the regexp engine") 1491 1492 // api.cc 1493 DEFINE_BOOL(script_streaming, true, "enable parsing on background") 1494 DEFINE_BOOL(stress_background_compile, false, 1495 "stress test parsing on background") 1496 DEFINE_BOOL(concurrent_cache_deserialization, true, 1497 "enable deserializing code caches on background") 1498 DEFINE_BOOL(disable_old_api_accessors, false, 1499 "Disable old-style API accessors whose setters trigger through the " 1500 "prototype chain") 1501 DEFINE_BOOL( 1502 embedder_instance_types, false, 1503 "enable type checks based on instance types provided by the embedder") 1504 1505 // bootstrapper.cc 1506 DEFINE_BOOL(expose_gc, false, "expose gc extension") 1507 DEFINE_STRING(expose_gc_as, nullptr, 1508 "expose gc extension under the specified name") 1509 DEFINE_IMPLICATION(expose_gc_as, expose_gc) 1510 DEFINE_BOOL(expose_externalize_string, false, 1511 "expose externalize string extension") 1512 DEFINE_BOOL(expose_statistics, false, "expose statistics extension") 1513 DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension") 1514 DEFINE_BOOL(expose_ignition_statistics, false, 1515 "expose ignition-statistics extension (requires building with " 1516 "v8_enable_ignition_dispatch_counting)") 1517 DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture") 1518 DEFINE_BOOL(builtins_in_stack_traces, false, 1519 "show built-in functions in stack traces") 1520 DEFINE_BOOL(experimental_stack_trace_frames, false, 1521 "enable experimental frames (API/Builtins) and stack trace layout") 1522 DEFINE_BOOL(disallow_code_generation_from_strings, false, 1523 "disallow eval and friends") 1524 DEFINE_BOOL(expose_async_hooks, false, "expose async_hooks object") 1525 DEFINE_STRING(expose_cputracemark_as, nullptr, 1526 "expose cputracemark extension under the specified name") 1527 #ifdef ENABLE_VTUNE_TRACEMARK 1528 DEFINE_BOOL(enable_vtune_domain_support, true, "enable vtune domain support") 1529 #endif // ENABLE_VTUNE_TRACEMARK 1530 1531 // builtins.cc 1532 DEFINE_BOOL(allow_unsafe_function_constructor, false, 1533 "allow invoking the function constructor without security checks") 1534 DEFINE_BOOL(force_slow_path, false, "always take the slow path for builtins") 1535 DEFINE_BOOL(test_small_max_function_context_stub_size, false, 1536 "enable testing the function context size overflow path " 1537 "by making the maximum size smaller") 1538 1539 DEFINE_BOOL(inline_new, true, "use fast inline allocation") 1540 DEFINE_NEG_NEG_IMPLICATION(inline_new, turbo_allocation_folding) 1541 1542 // bytecode-generator.cc 1543 DEFINE_INT(switch_table_spread_threshold, 3, 1544 "allow the jump table used for switch statements to span a range " 1545 "of integers roughly equal to this number times the number of " 1546 "clauses in the switch") 1547 DEFINE_INT(switch_table_min_cases, 6, 1548 "the number of Smi integer cases present in the switch statement " 1549 "before using the jump table optimization") 1550 1551 // codegen-ia32.cc / codegen-arm.cc 1552 DEFINE_BOOL(trace, false, "trace javascript function calls") 1553 1554 // codegen.cc 1555 DEFINE_BOOL(lazy, true, "use lazy compilation") 1556 DEFINE_BOOL(lazy_eval, true, "use lazy compilation during eval") 1557 DEFINE_BOOL(lazy_streaming, true, 1558 "use lazy compilation during streaming compilation") 1559 DEFINE_BOOL(max_lazy, false, "ignore eager compilation hints") 1560 DEFINE_IMPLICATION(max_lazy, lazy) 1561 DEFINE_BOOL(trace_opt, false, "trace optimized compilation") 1562 DEFINE_BOOL(trace_opt_verbose, false, 1563 "extra verbose optimized compilation tracing") 1564 DEFINE_IMPLICATION(trace_opt_verbose, trace_opt) 1565 DEFINE_BOOL(trace_opt_stats, false, "trace optimized compilation statistics") 1566 DEFINE_BOOL(trace_deopt, false, "trace deoptimization") 1567 DEFINE_BOOL(log_deopt, false, "log deoptimization") 1568 DEFINE_BOOL(trace_deopt_verbose, false, "extra verbose deoptimization tracing") 1569 DEFINE_IMPLICATION(trace_deopt_verbose, trace_deopt) 1570 DEFINE_BOOL(trace_file_names, false, 1571 "include file names in trace-opt/trace-deopt output") 1572 DEFINE_BOOL(always_opt, false, "always try to optimize functions") 1573 DEFINE_IMPLICATION(always_opt, opt) 1574 DEFINE_BOOL(always_osr, false, "always try to OSR functions") 1575 DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt") 1576 1577 DEFINE_BOOL(trace_serializer, false, "print code serializer trace") 1578 #ifdef DEBUG 1579 DEFINE_BOOL(external_reference_stats, false, 1580 "print statistics on external references used during serialization") 1581 #endif // DEBUG 1582 1583 // compilation-cache.cc 1584 DEFINE_BOOL(compilation_cache, true, "enable compilation cache") 1585 1586 DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions") 1587 1588 // lazy-compile-dispatcher.cc 1589 DEFINE_BOOL(lazy_compile_dispatcher, false, "enable compiler dispatcher") 1590 DEFINE_UINT(lazy_compile_dispatcher_max_threads, 0, 1591 "max threads for compiler dispatcher (0 for unbounded)") 1592 DEFINE_BOOL(trace_compiler_dispatcher, false, 1593 "trace compiler dispatcher activity") 1594 DEFINE_BOOL( 1595 parallel_compile_tasks_for_eager_toplevel, false, 1596 "spawn parallel compile tasks for eagerly compiled, top-level functions") 1597 DEFINE_IMPLICATION(parallel_compile_tasks_for_eager_toplevel, 1598 lazy_compile_dispatcher) 1599 DEFINE_BOOL(parallel_compile_tasks_for_lazy, false, 1600 "spawn parallel compile tasks for all lazily compiled functions") 1601 DEFINE_IMPLICATION(parallel_compile_tasks_for_lazy, lazy_compile_dispatcher) 1602 1603 // cpu-profiler.cc 1604 DEFINE_INT(cpu_profiler_sampling_interval, 1000, 1605 "CPU profiler sampling interval in microseconds") 1606 1607 // debugger 1608 DEFINE_BOOL( 1609 trace_side_effect_free_debug_evaluate, false, 1610 "print debug messages for side-effect-free debug-evaluate for testing") 1611 DEFINE_BOOL(hard_abort, true, "abort by crashing") 1612 1613 DEFINE_BOOL(experimental_async_stack_tagging_api, false, 1614 "enable experimental async stacks tagging API") 1615 1616 // disassembler 1617 DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR, 1618 "When logging, try to use coloured output.") 1619 1620 // inspector 1621 DEFINE_BOOL(expose_inspector_scripts, false, 1622 "expose injected-script-source.js for debugging") 1623 1624 // execution.cc 1625 DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB, 1626 "default size of stack region v8 is allowed to use (in kBytes)") 1627 1628 // frames.cc 1629 DEFINE_INT(max_stack_trace_source_length, 300, 1630 "maximum length of function source code printed in a stack trace.") 1631 1632 // execution.cc, messages.cc 1633 DEFINE_BOOL(clear_exceptions_on_js_entry, false, 1634 "clear pending exceptions when entering JavaScript") 1635 1636 // counters.cc 1637 DEFINE_INT(histogram_interval, 600000, 1638 "time interval in ms for aggregating memory histograms") 1639 1640 // heap-snapshot-generator.cc 1641 DEFINE_BOOL(heap_profiler_trace_objects, false, 1642 "Dump heap object allocations/movements/size_updates") 1643 DEFINE_BOOL(heap_profiler_use_embedder_graph, true, 1644 "Use the new EmbedderGraph API to get embedder nodes") 1645 DEFINE_INT(heap_snapshot_string_limit, 1024, 1646 "truncate strings to this length in the heap snapshot") 1647 DEFINE_BOOL(heap_profiler_show_hidden_objects, false, 1648 "use 'native' rather than 'hidden' node type in snapshot") 1649 #ifdef V8_ENABLE_HEAP_SNAPSHOT_VERIFY 1650 DEFINE_BOOL(heap_snapshot_verify, false, 1651 "verify that heap snapshot matches marking visitor behavior") 1652 DEFINE_IMPLICATION(enable_slow_asserts, heap_snapshot_verify) 1653 #endif 1654 1655 // sampling-heap-profiler.cc 1656 DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false, 1657 "Use constant sample intervals to eliminate test flakiness") 1658 1659 // v8.cc 1660 DEFINE_BOOL(use_idle_notification, true, 1661 "Use idle notification to reduce memory footprint.") 1662 // ic.cc 1663 DEFINE_BOOL(log_ic, false, 1664 "Log inline cache state transitions for tools/ic-processor") 1665 DEFINE_IMPLICATION(log_ic, log_code) 1666 DEFINE_GENERIC_IMPLICATION( 1667 log_ic, TracingFlags::ic_stats.store( 1668 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1669 DEFINE_BOOL_READONLY(fast_map_update, false, 1670 "enable fast map update by caching the migration target") 1671 DEFINE_INT(max_valid_polymorphic_map_count, 4, 1672 "maximum number of valid maps to track in POLYMORPHIC state") 1673 1674 DEFINE_BOOL(native_code_counters, DEBUG_BOOL, 1675 "generate extra code for manipulating stats counters") 1676 1677 DEFINE_BOOL(super_ic, true, "use an IC for super property loads") 1678 1679 DEFINE_BOOL(enable_mega_dom_ic, false, "use MegaDOM IC state for API objects") 1680 1681 // objects.cc 1682 DEFINE_BOOL(trace_prototype_users, false, 1683 "Trace updates to prototype user tracking") 1684 DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths") 1685 DEFINE_BOOL(log_maps, false, "Log map creation") 1686 DEFINE_BOOL(log_maps_details, true, "Also log map details") 1687 DEFINE_IMPLICATION(log_maps, log_code) 1688 1689 // parser.cc 1690 DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax") 1691 DEFINE_BOOL(allow_natives_for_differential_fuzzing, false, 1692 "allow only natives explicitly allowlisted for differential " 1693 "fuzzers") 1694 DEFINE_IMPLICATION(allow_natives_for_differential_fuzzing, allow_natives_syntax) 1695 DEFINE_IMPLICATION(allow_natives_for_differential_fuzzing, fuzzing) 1696 DEFINE_BOOL(parse_only, false, "only parse the sources") 1697 1698 // simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc 1699 #ifdef USE_SIMULATOR 1700 DEFINE_BOOL(trace_sim, false, "Trace simulator execution") 1701 DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator") 1702 DEFINE_BOOL(check_icache, false, 1703 "Check icache flushes in ARM and MIPS simulator") 1704 DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions") 1705 #if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \ 1706 defined(V8_TARGET_ARCH_PPC64) || defined(V8_TARGET_ARCH_RISCV64) || \ 1707 defined(V8_TARGET_ARCH_LOONG64) 1708 DEFINE_INT(sim_stack_alignment, 16, 1709 "Stack alignment in bytes in simulator. This must be a power of two " 1710 "and it must be at least 16. 16 is default.") 1711 #else 1712 DEFINE_INT(sim_stack_alignment, 8, 1713 "Stack alingment in bytes in simulator (4 or 8, 8 is default)") 1714 #endif 1715 DEFINE_INT(sim_stack_size, 2 * MB / KB, 1716 "Stack size of the ARM64, MIPS, MIPS64 and PPC64 simulator " 1717 "in kBytes (default is 2 MB)") 1718 DEFINE_BOOL(trace_sim_messages, false, 1719 "Trace simulator debug messages. Implied by --trace-sim.") 1720 #endif // USE_SIMULATOR 1721 1722 #if defined V8_TARGET_ARCH_ARM64 1723 // pointer-auth-arm64.cc 1724 DEFINE_BOOL(sim_abort_on_bad_auth, true, 1725 "Stop execution when a pointer authentication fails in the " 1726 "ARM64 simulator.") 1727 #endif 1728 1729 // isolate.cc 1730 DEFINE_BOOL(async_stack_traces, true, 1731 "include async stack traces in Error.stack") 1732 DEFINE_BOOL(stack_trace_on_illegal, false, 1733 "print stack trace when an illegal exception is thrown") 1734 DEFINE_BOOL(abort_on_uncaught_exception, false, 1735 "abort program (dump core) when an uncaught exception is thrown") 1736 DEFINE_BOOL(correctness_fuzzer_suppressions, false, 1737 "Suppress certain unspecified behaviors to ease correctness " 1738 "fuzzing: Abort program when the stack overflows or a string " 1739 "exceeds maximum length (as opposed to throwing RangeError). " 1740 "Use a fixed suppression string for error messages.") 1741 DEFINE_BOOL(rehash_snapshot, true, 1742 "rehash strings from the snapshot to override the baked-in seed") 1743 DEFINE_UINT64(hash_seed, 0, 1744 "Fixed seed to use to hash property keys (0 means random)" 1745 "(with snapshots this option cannot override the baked-in seed)") 1746 DEFINE_INT(random_seed, 0, 1747 "Default seed for initializing random generator " 1748 "(0, the default, means to use system random).") 1749 DEFINE_INT(fuzzer_random_seed, 0, 1750 "Default seed for initializing fuzzer random generator " 1751 "(0, the default, means to use v8's random number generator seed).") 1752 DEFINE_BOOL(trace_rail, false, "trace RAIL mode") 1753 DEFINE_BOOL(print_all_exceptions, false, 1754 "print exception object and stack trace on each thrown exception") 1755 DEFINE_BOOL( 1756 detailed_error_stack_trace, false, 1757 "includes arguments for each function call in the error stack frames array") 1758 DEFINE_BOOL(adjust_os_scheduling_parameters, true, 1759 "adjust OS specific scheduling params for the isolate") 1760 DEFINE_BOOL(experimental_flush_embedded_blob_icache, true, 1761 "Used in an experiment to evaluate icache flushing on certain CPUs") 1762 1763 // Flags for short builtin calls feature 1764 #if V8_SHORT_BUILTIN_CALLS 1765 #define V8_SHORT_BUILTIN_CALLS_BOOL true 1766 #else 1767 #define V8_SHORT_BUILTIN_CALLS_BOOL false 1768 #endif 1769 1770 DEFINE_BOOL(short_builtin_calls, V8_SHORT_BUILTIN_CALLS_BOOL, 1771 "Put embedded builtins code into the code range for shorter " 1772 "builtin calls/jumps if system has >=4GB memory") 1773 1774 // runtime.cc 1775 DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times") 1776 DEFINE_GENERIC_IMPLICATION( 1777 runtime_call_stats, 1778 TracingFlags::runtime_stats.store( 1779 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1780 DEFINE_BOOL(rcs, false, "report runtime call counts and times") 1781 DEFINE_IMPLICATION(rcs, runtime_call_stats) 1782 1783 DEFINE_BOOL(rcs_cpu_time, false, 1784 "report runtime times in cpu time (the default is wall time)") 1785 DEFINE_IMPLICATION(rcs_cpu_time, rcs) 1786 1787 // snapshot-common.cc 1788 DEFINE_BOOL(verify_snapshot_checksum, true, 1789 "Verify snapshot checksums when deserializing snapshots. Enable " 1790 "checksum creation and verification for code caches.") 1791 DEFINE_BOOL(profile_deserialization, false, 1792 "Print the time it takes to deserialize the snapshot.") 1793 DEFINE_BOOL(serialization_statistics, false, 1794 "Collect statistics on serialized objects.") 1795 // Regexp 1796 DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code") 1797 DEFINE_BOOL(regexp_interpret_all, false, "interpret all regexp code") 1798 #ifdef V8_TARGET_BIG_ENDIAN 1799 #define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL false 1800 #else 1801 #define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL true 1802 #endif 1803 DEFINE_BOOL(regexp_tier_up, true, 1804 "enable regexp interpreter and tier up to the compiler after the " 1805 "number of executions set by the tier up ticks flag") 1806 DEFINE_NEG_IMPLICATION(regexp_interpret_all, regexp_tier_up) 1807 DEFINE_INT(regexp_tier_up_ticks, 1, 1808 "set the number of executions for the regexp interpreter before " 1809 "tiering-up to the compiler") 1810 DEFINE_BOOL(regexp_peephole_optimization, REGEXP_PEEPHOLE_OPTIMIZATION_BOOL, 1811 "enable peephole optimization for regexp bytecode") 1812 DEFINE_BOOL(trace_regexp_peephole_optimization, false, 1813 "trace regexp bytecode peephole optimization") 1814 DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution") 1815 DEFINE_BOOL(trace_regexp_assembler, false, 1816 "trace regexp macro assembler calls.") 1817 DEFINE_BOOL(trace_regexp_parser, false, "trace regexp parsing") 1818 DEFINE_BOOL(trace_regexp_tier_up, false, "trace regexp tiering up execution") 1819 DEFINE_BOOL(trace_regexp_graph, false, "trace the regexp graph") 1820 1821 DEFINE_BOOL(enable_experimental_regexp_engine, false, 1822 "recognize regexps with 'l' flag, run them on experimental engine") 1823 DEFINE_BOOL(default_to_experimental_regexp_engine, false, 1824 "run regexps with the experimental engine where possible") 1825 DEFINE_IMPLICATION(default_to_experimental_regexp_engine, 1826 enable_experimental_regexp_engine) 1827 DEFINE_BOOL(trace_experimental_regexp_engine, false, 1828 "trace execution of experimental regexp engine") 1829 1830 DEFINE_BOOL(enable_experimental_regexp_engine_on_excessive_backtracks, false, 1831 "fall back to a breadth-first regexp engine on excessive " 1832 "backtracking") 1833 DEFINE_UINT(regexp_backtracks_before_fallback, 50000, 1834 "number of backtracks during regexp execution before fall back " 1835 "to experimental engine if " 1836 "enable_experimental_regexp_engine_on_excessive_backtracks is set") 1837 1838 // Testing flags test/cctest/test-{flags,api,serialization}.cc 1839 DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag") 1840 DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag") 1841 DEFINE_INT(testing_int_flag, 13, "testing_int_flag") 1842 DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag") 1843 DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag") 1844 DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness") 1845 1846 // Test flag for a check in %OptimizeFunctionOnNextCall 1847 DEFINE_BOOL( 1848 testing_d8_test_runner, false, 1849 "test runner turns on this flag to enable a check that the function was " 1850 "prepared for optimization before marking it for optimization") 1851 1852 DEFINE_BOOL( 1853 fuzzing, false, 1854 "Fuzzers use this flag to signal that they are ... fuzzing. This causes " 1855 "intrinsics to fail silently (e.g. return undefined) on invalid usage.") 1856 1857 // mksnapshot.cc 1858 DEFINE_STRING(embedded_src, nullptr, 1859 "Path for the generated embedded data file. (mksnapshot only)") 1860 DEFINE_STRING( 1861 embedded_variant, nullptr, 1862 "Label to disambiguate symbols in embedded data file. (mksnapshot only)") 1863 DEFINE_STRING(startup_src, nullptr, 1864 "Write V8 startup as C++ src. (mksnapshot only)") 1865 DEFINE_STRING(startup_blob, nullptr, 1866 "Write V8 startup blob file. (mksnapshot only)") 1867 DEFINE_STRING(target_arch, nullptr, 1868 "The mksnapshot target arch. (mksnapshot only)") 1869 DEFINE_STRING(target_os, nullptr, "The mksnapshot target os. (mksnapshot only)") 1870 DEFINE_BOOL(target_is_simulator, false, 1871 "Instruct mksnapshot that the target is meant to run in the " 1872 "simulator and it can generate simulator-specific instructions. " 1873 "(mksnapshot only)") 1874 DEFINE_STRING(turbo_profiling_log_file, nullptr, 1875 "Path of the input file containing basic block counters for " 1876 "builtins. (mksnapshot only)") 1877 1878 // On some platforms, the .text section only has execute permissions. 1879 DEFINE_BOOL(text_is_readable, true, 1880 "Whether the .text section of binary can be read") 1881 DEFINE_NEG_NEG_IMPLICATION(text_is_readable, partial_constant_pool) 1882 1883 // 1884 // Minor mark compact collector flags. 1885 // 1886 DEFINE_BOOL(trace_minor_mc_parallel_marking, false, 1887 "trace parallel marking for the young generation") 1888 DEFINE_BOOL(minor_mc, false, "perform young generation mark compact GCs") 1889 DEFINE_BOOL(minor_mc_sweeping, false, 1890 "perform sweeping in young generation mark compact GCs") 1891 1892 // 1893 // Dev shell flags 1894 // 1895 1896 DEFINE_BOOL(help, false, "Print usage message, including flags, on console") 1897 DEFINE_BOOL(print_flag_values, false, "Print all flag values of V8") 1898 1899 // Slow histograms are also enabled via --dump-counters in d8. 1900 DEFINE_BOOL(slow_histograms, false, 1901 "Enable slow histograms with more overhead.") 1902 1903 DEFINE_BOOL(use_external_strings, false, "Use external strings for source code") 1904 DEFINE_STRING(map_counters, "", "Map counters to a file") 1905 DEFINE_BOOL(mock_arraybuffer_allocator, false, 1906 "Use a mock ArrayBuffer allocator for testing.") 1907 DEFINE_SIZE_T(mock_arraybuffer_allocator_limit, 0, 1908 "Memory limit for mock ArrayBuffer allocator used to simulate " 1909 "OOM for testing.") 1910 #if MULTI_MAPPED_ALLOCATOR_AVAILABLE 1911 DEFINE_BOOL(multi_mapped_mock_allocator, false, 1912 "Use a multi-mapped mock ArrayBuffer allocator for testing.") 1913 #endif 1914 1915 // 1916 // GDB JIT integration flags. 1917 // 1918 #undef FLAG 1919 #ifdef ENABLE_GDB_JIT_INTERFACE 1920 #define FLAG FLAG_FULL 1921 #else 1922 #define FLAG FLAG_READONLY 1923 #endif 1924 1925 DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface") 1926 DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects") 1927 DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk") 1928 DEFINE_STRING(gdbjit_dump_filter, "", 1929 "dump only objects containing this substring") 1930 1931 #ifdef ENABLE_GDB_JIT_INTERFACE 1932 DEFINE_IMPLICATION(gdbjit_full, gdbjit) 1933 DEFINE_IMPLICATION(gdbjit_dump, gdbjit) 1934 #endif 1935 DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space) 1936 1937 // 1938 // Debug only flags 1939 // 1940 #undef FLAG 1941 #ifdef DEBUG 1942 #define FLAG FLAG_FULL 1943 #else 1944 #define FLAG FLAG_READONLY 1945 #endif 1946 1947 // checks.cc 1948 #ifdef ENABLE_SLOW_DCHECKS 1949 DEFINE_BOOL(enable_slow_asserts, true, 1950 "enable asserts that are slow to execute") 1951 #endif 1952 1953 // codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc 1954 DEFINE_BOOL(print_ast, false, "print source AST") 1955 DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints") 1956 1957 // compiler.cc 1958 DEFINE_BOOL(print_scopes, false, "print scopes") 1959 1960 // contexts.cc 1961 DEFINE_BOOL(trace_contexts, false, "trace contexts operations") 1962 1963 // heap.cc 1964 DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection") 1965 DEFINE_BOOL(code_stats, false, "report code statistics after GC") 1966 DEFINE_BOOL(print_handles, false, "report handles after GC") 1967 DEFINE_BOOL(check_handle_count, false, 1968 "Check that there are not too many handles at GC") 1969 DEFINE_BOOL(print_global_handles, false, "report global handles after GC") 1970 1971 // TurboFan debug-only flags. 1972 DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis") 1973 1974 // objects.cc 1975 DEFINE_BOOL(trace_module_status, false, 1976 "Trace status transitions of ECMAScript modules") 1977 DEFINE_BOOL(trace_normalization, false, 1978 "prints when objects are turned into dictionaries.") 1979 1980 // runtime.cc 1981 DEFINE_BOOL(trace_lazy, false, "trace lazy compilation") 1982 1983 // spaces.cc 1984 DEFINE_BOOL(trace_isolates, false, "trace isolate state changes") 1985 1986 // Regexp 1987 DEFINE_BOOL(regexp_possessive_quantifier, false, 1988 "enable possessive quantifier syntax for testing") 1989 1990 // Debugger 1991 DEFINE_BOOL(print_break_location, false, "print source location on debug break") 1992 1993 // 1994 // Logging and profiling flags 1995 // 1996 // Logging flag dependencies are are also set separately in 1997 // V8::InitializeOncePerProcessImpl. Please add your flag to the log_all_flags 1998 // list in v8.cc to properly set FLAG_log and automatically enable it with 1999 // --log-all. 2000 #undef FLAG 2001 #define FLAG FLAG_FULL 2002 2003 // log.cc 2004 DEFINE_STRING(logfile, "v8.log", 2005 "Specify the name of the log file, use '-' for console, '+' for " 2006 "a temporary file.") 2007 DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.") 2008 2009 DEFINE_BOOL(log, false, 2010 "Minimal logging (no API, code, GC, suspect, or handles samples).") 2011 DEFINE_BOOL(log_all, false, "Log all events to the log file.") 2012 2013 DEFINE_BOOL(log_code, false, 2014 "Log code events to the log file without profiling.") 2015 DEFINE_BOOL(log_code_disassemble, false, 2016 "Log all disassembled code to the log file.") 2017 DEFINE_IMPLICATION(log_code_disassemble, log_code) 2018 DEFINE_BOOL(log_source_code, false, "Log source code.") 2019 DEFINE_BOOL(log_function_events, false, 2020 "Log function events " 2021 "(parse, compile, execute) separately.") 2022 2023 DEFINE_BOOL(detailed_line_info, false, 2024 "Always generate detailed line information for CPU profiling.") 2025 2026 #if defined(ANDROID) 2027 // Phones and tablets have processors that are much slower than desktop 2028 // and laptop computers for which current heuristics are tuned. 2029 #define DEFAULT_PROF_SAMPLING_INTERVAL 5000 2030 #else 2031 #define DEFAULT_PROF_SAMPLING_INTERVAL 1000 2032 #endif 2033 DEFINE_INT(prof_sampling_interval, DEFAULT_PROF_SAMPLING_INTERVAL, 2034 "Interval for --prof samples (in microseconds).") 2035 #undef DEFAULT_PROF_SAMPLING_INTERVAL 2036 2037 DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.") 2038 DEFINE_BOOL(prof_browser_mode, true, 2039 "Used with --prof, turns on browser-compatible mode for profiling.") 2040 2041 DEFINE_BOOL(prof, false, 2042 "Log statistical profiling information (implies --log-code).") 2043 DEFINE_IMPLICATION(prof, prof_cpp) 2044 DEFINE_IMPLICATION(prof, log_code) 2045 2046 DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.") 2047 2048 #if V8_OS_LINUX 2049 #define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL(nam, false, cmt) 2050 #define DEFINE_PERF_PROF_IMPLICATION DEFINE_IMPLICATION 2051 #else 2052 #define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL_READONLY(nam, false, cmt) 2053 #define DEFINE_PERF_PROF_IMPLICATION(...) 2054 #endif 2055 2056 DEFINE_PERF_PROF_BOOL(perf_basic_prof, 2057 "Enable perf linux profiler (basic support).") 2058 DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space) 2059 DEFINE_PERF_PROF_BOOL( 2060 perf_basic_prof_only_functions, 2061 "Only report function code ranges to perf (i.e. no stubs).") 2062 DEFINE_PERF_PROF_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof) 2063 DEFINE_PERF_PROF_BOOL( 2064 perf_prof, "Enable perf linux profiler (experimental annotate support).") 2065 DEFINE_PERF_PROF_BOOL( 2066 perf_prof_annotate_wasm, 2067 "Used with --perf-prof, load wasm source map and provide annotate " 2068 "support (experimental).") 2069 DEFINE_PERF_PROF_BOOL( 2070 perf_prof_delete_file, 2071 "Remove the perf file right after creating it (for testing only).") 2072 DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space) 2073 // TODO(v8:8462) Remove implication once perf supports remapping. 2074 #if !MUST_WRITE_PROTECT_CODE_MEMORY 2075 DEFINE_NEG_IMPLICATION(perf_prof, write_protect_code_memory) 2076 #endif 2077 #if V8_ENABLE_WEBASSEMBLY 2078 DEFINE_NEG_IMPLICATION(perf_prof, wasm_write_protect_code_memory) 2079 #endif // V8_ENABLE_WEBASSEMBLY 2080 2081 // --perf-prof-unwinding-info is available only on selected architectures. 2082 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \ 2083 !V8_TARGET_ARCH_S390X && !V8_TARGET_ARCH_PPC64 2084 #undef DEFINE_PERF_PROF_BOOL 2085 #define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL_READONLY(nam, false, cmt) 2086 #undef DEFINE_PERF_PROF_IMPLICATION 2087 #define DEFINE_PERF_PROF_IMPLICATION(...) 2088 #endif 2089 2090 DEFINE_PERF_PROF_BOOL( 2091 perf_prof_unwinding_info, 2092 "Enable unwinding info for perf linux profiler (experimental).") 2093 DEFINE_PERF_PROF_IMPLICATION(perf_prof, perf_prof_unwinding_info) 2094 2095 #undef DEFINE_PERF_PROF_BOOL 2096 #undef DEFINE_PERF_PROF_IMPLICATION 2097 2098 DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__", 2099 "Specify the name of the file for fake gc mmap used in ll_prof") 2100 DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.") 2101 DEFINE_IMPLICATION(log_internal_timer_events, prof) 2102 2103 DEFINE_BOOL(redirect_code_traces, false, 2104 "output deopt information and disassembly into file " 2105 "code-<pid>-<isolate id>.asm") 2106 DEFINE_STRING(redirect_code_traces_to, nullptr, 2107 "output deopt information and disassembly into the given file") 2108 2109 DEFINE_BOOL(print_opt_source, false, 2110 "print source code of optimized and inlined functions") 2111 2112 DEFINE_BOOL(vtune_prof_annotate_wasm, false, 2113 "Used when v8_enable_vtunejit is enabled, load wasm source map and " 2114 "provide annotate support (experimental).") 2115 2116 DEFINE_BOOL(win64_unwinding_info, true, "Enable unwinding info for Windows/x64") 2117 2118 #ifdef V8_TARGET_ARCH_ARM 2119 // Unsupported on arm. See https://crbug.com/v8/8713. 2120 DEFINE_BOOL_READONLY( 2121 interpreted_frames_native_stack, false, 2122 "Show interpreted frames on the native stack (useful for external " 2123 "profilers).") 2124 #else 2125 DEFINE_BOOL(interpreted_frames_native_stack, false, 2126 "Show interpreted frames on the native stack (useful for external " 2127 "profilers).") 2128 #endif 2129 2130 DEFINE_BOOL(enable_system_instrumentation, false, 2131 "Enable platform-specific profiling.") 2132 // Don't move code objects. 2133 DEFINE_NEG_IMPLICATION(enable_system_instrumentation, compact_code_space) 2134 #ifndef V8_TARGET_ARCH_ARM 2135 DEFINE_IMPLICATION(enable_system_instrumentation, 2136 interpreted_frames_native_stack) 2137 #endif 2138 2139 // 2140 // Disassembler only flags 2141 // 2142 #undef FLAG 2143 #ifdef ENABLE_DISASSEMBLER 2144 #define FLAG FLAG_FULL 2145 #else 2146 #define FLAG FLAG_READONLY 2147 #endif 2148 2149 // elements.cc 2150 DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions") 2151 2152 DEFINE_BOOL(trace_creation_allocation_sites, false, 2153 "trace the creation of allocation sites") 2154 2155 DEFINE_BOOL(print_code, false, "print generated code") 2156 DEFINE_BOOL(print_opt_code, false, "print optimized code") 2157 DEFINE_STRING(print_opt_code_filter, "*", "filter for printing optimized code") 2158 DEFINE_BOOL(print_code_verbose, false, "print more information for code") 2159 DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins") 2160 DEFINE_STRING(print_builtin_code_filter, "*", 2161 "filter for printing builtin code") 2162 DEFINE_BOOL(print_regexp_code, false, "print generated regexp code") 2163 DEFINE_BOOL(print_regexp_bytecode, false, "print generated regexp bytecode") 2164 DEFINE_BOOL(print_builtin_size, false, "print code size for builtins") 2165 2166 #ifdef ENABLE_DISASSEMBLER 2167 DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code") 2168 DEFINE_IMPLICATION(print_all_code, print_code) 2169 DEFINE_IMPLICATION(print_all_code, print_opt_code) 2170 DEFINE_IMPLICATION(print_all_code, print_code_verbose) 2171 DEFINE_IMPLICATION(print_all_code, print_builtin_code) 2172 DEFINE_IMPLICATION(print_all_code, print_regexp_code) 2173 #endif 2174 2175 #undef FLAG 2176 #define FLAG FLAG_FULL 2177 2178 // 2179 // Predictable mode related flags. 2180 // 2181 2182 DEFINE_BOOL(predictable, false, "enable predictable mode") 2183 DEFINE_NEG_IMPLICATION(predictable, memory_reducer) 2184 // TODO(v8:11848): These flags were recursively implied via --single-threaded 2185 // before. Audit them, and remove any unneeded implications. 2186 DEFINE_IMPLICATION(predictable, single_threaded_gc) 2187 DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation) 2188 DEFINE_NEG_IMPLICATION(predictable, stress_concurrent_inlining) 2189 DEFINE_NEG_IMPLICATION(predictable, lazy_compile_dispatcher) 2190 DEFINE_NEG_IMPLICATION(predictable, parallel_compile_tasks_for_eager_toplevel) 2191 DEFINE_NEG_IMPLICATION(predictable, parallel_compile_tasks_for_lazy) 2192 2193 DEFINE_BOOL(predictable_gc_schedule, false, 2194 "Predictable garbage collection schedule. Fixes heap growing, " 2195 "idle, and memory reducing behavior.") 2196 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, min_semi_space_size, 4) 2197 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, max_semi_space_size, 4) 2198 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, heap_growing_percent, 30) 2199 DEFINE_NEG_IMPLICATION(predictable_gc_schedule, memory_reducer) 2200 2201 // 2202 // Threading related flags. 2203 // 2204 2205 DEFINE_BOOL(single_threaded, false, "disable the use of background tasks") 2206 DEFINE_IMPLICATION(single_threaded, single_threaded_gc) 2207 DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation) 2208 DEFINE_NEG_IMPLICATION(single_threaded, stress_concurrent_inlining) 2209 DEFINE_NEG_IMPLICATION(single_threaded, lazy_compile_dispatcher) 2210 DEFINE_NEG_IMPLICATION(single_threaded, 2211 parallel_compile_tasks_for_eager_toplevel) 2212 DEFINE_NEG_IMPLICATION(single_threaded, parallel_compile_tasks_for_lazy) 2213 2214 // 2215 // Parallel and concurrent GC (Orinoco) related flags. 2216 // 2217 DEFINE_BOOL(single_threaded_gc, false, "disable the use of background gc tasks") 2218 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_marking) 2219 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_sweeping) 2220 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_compaction) 2221 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_marking) 2222 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_pointer_update) 2223 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_scavenge) 2224 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_array_buffer_sweeping) 2225 DEFINE_NEG_IMPLICATION(single_threaded_gc, stress_concurrent_allocation) 2226 2227 // Web snapshots 2228 // TODO(v8:11525): Remove this flag once proper embedder integration is done. 2229 DEFINE_BOOL( 2230 experimental_web_snapshots, false, 2231 "interpret scripts as web snapshots if they start with a magic number") 2232 DEFINE_NEG_IMPLICATION(experimental_web_snapshots, script_streaming) 2233 2234 #undef FLAG 2235 2236 #ifdef VERIFY_PREDICTABLE 2237 #define FLAG FLAG_FULL 2238 #else 2239 #define FLAG FLAG_READONLY 2240 #endif 2241 2242 DEFINE_BOOL(verify_predictable, false, 2243 "this mode is used for checking that V8 behaves predictably") 2244 DEFINE_IMPLICATION(verify_predictable, predictable) 2245 DEFINE_INT(dump_allocations_digest_at_alloc, -1, 2246 "dump allocations digest each n-th allocation") 2247 2248 // 2249 // Read-only flags 2250 // 2251 #undef FLAG 2252 #define FLAG FLAG_READONLY 2253 2254 // assembler.h 2255 DEFINE_BOOL(enable_embedded_constant_pool, V8_EMBEDDED_CONSTANT_POOL, 2256 "enable use of embedded constant pools (PPC only)") 2257 2258 // Cleanup... 2259 #undef FLAG_FULL 2260 #undef FLAG_READONLY 2261 #undef FLAG 2262 #undef FLAG_ALIAS 2263 2264 #undef DEFINE_BOOL 2265 #undef DEFINE_MAYBE_BOOL 2266 #undef DEFINE_DEBUG_BOOL 2267 #undef DEFINE_INT 2268 #undef DEFINE_STRING 2269 #undef DEFINE_FLOAT 2270 #undef DEFINE_IMPLICATION 2271 #undef DEFINE_WEAK_IMPLICATION 2272 #undef DEFINE_NEG_IMPLICATION 2273 #undef DEFINE_NEG_VALUE_IMPLICATION 2274 #undef DEFINE_VALUE_IMPLICATION 2275 #undef DEFINE_WEAK_VALUE_IMPLICATION 2276 #undef DEFINE_GENERIC_IMPLICATION 2277 #undef DEFINE_ALIAS_BOOL 2278 #undef DEFINE_ALIAS_INT 2279 #undef DEFINE_ALIAS_STRING 2280 #undef DEFINE_ALIAS_FLOAT 2281 2282 #undef FLAG_MODE_DECLARE 2283 #undef FLAG_MODE_DEFINE 2284 #undef FLAG_MODE_DEFINE_DEFAULTS 2285 #undef FLAG_MODE_META 2286 #undef FLAG_MODE_DEFINE_IMPLICATIONS 2287 #undef FLAG_MODE_APPLY 2288 2289 #undef COMMA 2290