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