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_HEAP_SANDBOX 155 #define V8_HEAP_SANDBOX_BOOL true 156 #else 157 #define V8_HEAP_SANDBOX_BOOL false 158 #endif 159 160 #ifdef V8_ENABLE_CONTROL_FLOW_INTEGRITY 161 #define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL true 162 #else 163 #define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL false 164 #endif 165 166 // Supported ARM configurations are: 167 // "armv6": ARMv6 + VFPv2 168 // "armv7": ARMv7 + VFPv3-D32 + NEON 169 // "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV 170 // "armv8": ARMv8 (including all of the above) 171 #if !defined(ARM_TEST_NO_FEATURE_PROBE) || \ 172 (defined(CAN_USE_ARMV8_INSTRUCTIONS) && \ 173 defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 174 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)) 175 #define ARM_ARCH_DEFAULT "armv8" 176 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 177 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS) 178 #define ARM_ARCH_DEFAULT "armv7+sudiv" 179 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_NEON) && \ 180 defined(CAN_USE_VFP3_INSTRUCTIONS) 181 #define ARM_ARCH_DEFAULT "armv7" 182 #else 183 #define ARM_ARCH_DEFAULT "armv6" 184 #endif 185 186 #ifdef V8_OS_WIN 187 #define ENABLE_LOG_COLOUR false 188 #else 189 #define ENABLE_LOG_COLOUR true 190 #endif 191 192 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 193 #define DEFINE_BOOL_READONLY(nam, def, cmt) \ 194 FLAG_READONLY(BOOL, bool, nam, def, cmt) 195 #define DEFINE_MAYBE_BOOL(nam, cmt) \ 196 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt) 197 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 198 #define DEFINE_UINT(nam, def, cmt) FLAG(UINT, unsigned int, nam, def, cmt) 199 #define DEFINE_UINT_READONLY(nam, def, cmt) \ 200 FLAG_READONLY(UINT, unsigned int, nam, def, cmt) 201 #define DEFINE_UINT64(nam, def, cmt) FLAG(UINT64, uint64_t, nam, def, cmt) 202 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 203 #define DEFINE_SIZE_T(nam, def, cmt) FLAG(SIZE_T, size_t, nam, def, cmt) 204 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 205 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) 206 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam) 207 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) 208 #define DEFINE_ALIAS_SIZE_T(alias, nam) FLAG_ALIAS(SIZE_T, size_t, alias, nam) 209 #define DEFINE_ALIAS_STRING(alias, nam) \ 210 FLAG_ALIAS(STRING, const char*, alias, nam) 211 212 #ifdef DEBUG 213 #define DEFINE_DEBUG_BOOL DEFINE_BOOL 214 #else 215 #define DEFINE_DEBUG_BOOL DEFINE_BOOL_READONLY 216 #endif 217 218 // 219 // Flags in all modes. 220 // 221 #define FLAG FLAG_FULL 222 223 // ATTENTION: This is set to true by default in d8. But for API compatibility, 224 // it generally defaults to false. 225 DEFINE_BOOL(abort_on_contradictory_flags, false, 226 "Disallow flags or implications overriding each other.") 227 // This implication is also hard-coded into the flags processing to make sure it 228 // becomes active before we even process subsequent flags. 229 DEFINE_NEG_IMPLICATION(fuzzing, abort_on_contradictory_flags) 230 // This is not really a flag, it affects the interpretation of the next flag but 231 // doesn't become permanently true when specified. This only works for flags 232 // defined in this file, but not for d8 flags defined in src/d8/d8.cc. 233 DEFINE_BOOL(allow_overwriting_for_next_flag, false, 234 "temporary disable flag contradiction to allow overwriting just " 235 "the next flag") 236 237 // Flags for language modes and experimental language features. 238 DEFINE_BOOL(use_strict, false, "enforce strict mode") 239 240 DEFINE_BOOL(es_staging, false, 241 "enable test-worthy harmony features (for internal use only)") 242 DEFINE_BOOL(harmony, false, "enable all completed harmony features") 243 DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features") 244 DEFINE_IMPLICATION(es_staging, harmony) 245 // Enabling FinalizationRegistry#cleanupSome also enables weak refs 246 DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) 247 248 // Update bootstrapper.cc whenever adding a new feature flag. 249 250 // Features that are still work in progress (behind individual flags). 251 #define HARMONY_INPROGRESS_BASE(V) \ 252 V(harmony_regexp_sequence, "RegExp Unicode sequence properties") \ 253 V(harmony_weak_refs_with_cleanup_some, \ 254 "harmony weak references with FinalizationRegistry.prototype.cleanupSome") \ 255 V(harmony_regexp_match_indices, "harmony regexp match indices") \ 256 V(harmony_import_assertions, "harmony import assertions") 257 258 #ifdef V8_INTL_SUPPORT 259 #define HARMONY_INPROGRESS(V) \ 260 HARMONY_INPROGRESS_BASE(V) \ 261 V(harmony_intl_displaynames_date_types, "Intl.DisplayNames date types") 262 #else 263 #define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) 264 #endif 265 266 // Features that are complete (but still behind --harmony/es-staging flag). 267 #define HARMONY_STAGED_BASE(V) \ 268 V(harmony_top_level_await, "harmony top level await") 269 270 #ifdef V8_INTL_SUPPORT 271 #define HARMONY_STAGED(V) \ 272 HARMONY_STAGED_BASE(V) \ 273 V(harmony_intl_dateformat_day_period, \ 274 "Add dayPeriod option to DateTimeFormat") 275 #else 276 #define HARMONY_STAGED(V) HARMONY_STAGED_BASE(V) 277 #endif 278 279 // Features that are shipping (turned on by default, but internal flag remains). 280 #define HARMONY_SHIPPING_BASE(V) \ 281 V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ 282 V(harmony_atomics, "harmony atomics") \ 283 V(harmony_promise_any, "harmony Promise.any") \ 284 V(harmony_private_methods, "harmony private methods in class literals") \ 285 V(harmony_weak_refs, "harmony weak references") \ 286 V(harmony_string_replaceall, "harmony String.prototype.replaceAll") \ 287 V(harmony_logical_assignment, "harmony logical assignment") \ 288 V(harmony_atomics_waitasync, "harmony Atomics.waitAsync") 289 290 #ifdef V8_INTL_SUPPORT 291 #define HARMONY_SHIPPING(V) \ 292 HARMONY_SHIPPING_BASE(V) \ 293 V(harmony_intl_segmenter, "Intl.Segmenter") 294 #else 295 #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) 296 #endif 297 298 // Once a shipping feature has proved stable in the wild, it will be dropped 299 // from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed, 300 // and associated tests are moved from the harmony directory to the appropriate 301 // esN directory. 302 303 #define FLAG_INPROGRESS_FEATURES(id, description) \ 304 DEFINE_BOOL(id, false, "enable " #description " (in progress)") 305 HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES) 306 #undef FLAG_INPROGRESS_FEATURES 307 308 #define FLAG_STAGED_FEATURES(id, description) \ 309 DEFINE_BOOL(id, false, "enable " #description) \ 310 DEFINE_IMPLICATION(harmony, id) 311 HARMONY_STAGED(FLAG_STAGED_FEATURES) 312 #undef FLAG_STAGED_FEATURES 313 314 #define FLAG_SHIPPING_FEATURES(id, description) \ 315 DEFINE_BOOL(id, true, "enable " #description) \ 316 DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id) 317 HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES) 318 #undef FLAG_SHIPPING_FEATURES 319 320 #ifdef V8_INTL_SUPPORT 321 DEFINE_BOOL(icu_timezone_data, true, "get information about timezones from ICU") 322 #endif 323 324 #ifdef V8_ENABLE_DOUBLE_CONST_STORE_CHECK 325 #define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL true 326 #else 327 #define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL false 328 #endif 329 330 #ifdef V8_LITE_MODE 331 #define V8_LITE_BOOL true 332 #else 333 #define V8_LITE_BOOL false 334 #endif 335 336 #ifdef V8_ENABLE_LAZY_SOURCE_POSITIONS 337 #define V8_LAZY_SOURCE_POSITIONS_BOOL true 338 #else 339 #define V8_LAZY_SOURCE_POSITIONS_BOOL false 340 #endif 341 342 #ifdef V8_SHARED_RO_HEAP 343 #define V8_SHARED_RO_HEAP_BOOL true 344 #else 345 #define V8_SHARED_RO_HEAP_BOOL false 346 #endif 347 348 DEFINE_BOOL(lite_mode, V8_LITE_BOOL, 349 "enables trade-off of performance for memory savings") 350 351 // Lite mode implies other flags to trade-off performance for memory. 352 DEFINE_IMPLICATION(lite_mode, jitless) 353 DEFINE_IMPLICATION(lite_mode, lazy_feedback_allocation) 354 DEFINE_IMPLICATION(lite_mode, optimize_for_size) 355 356 #ifdef V8_ENABLE_THIRD_PARTY_HEAP 357 #define V8_ENABLE_THIRD_PARTY_HEAP_BOOL true 358 #else 359 #define V8_ENABLE_THIRD_PARTY_HEAP_BOOL false 360 #endif 361 362 DEFINE_NEG_IMPLICATION(enable_third_party_heap, inline_new) 363 DEFINE_NEG_IMPLICATION(enable_third_party_heap, allocation_site_pretenuring) 364 DEFINE_NEG_IMPLICATION(enable_third_party_heap, turbo_allocation_folding) 365 366 DEFINE_BOOL_READONLY(enable_third_party_heap, V8_ENABLE_THIRD_PARTY_HEAP_BOOL, 367 "Use third-party heap") 368 369 #ifdef V8_DISABLE_WRITE_BARRIERS 370 #define V8_DISABLE_WRITE_BARRIERS_BOOL true 371 #else 372 #define V8_DISABLE_WRITE_BARRIERS_BOOL false 373 #endif 374 375 DEFINE_BOOL_READONLY(disable_write_barriers, V8_DISABLE_WRITE_BARRIERS_BOOL, 376 "disable write barriers when GC is non-incremental " 377 "and heap contains single generation.") 378 379 // Disable incremental marking barriers 380 DEFINE_NEG_IMPLICATION(disable_write_barriers, incremental_marking) 381 382 #ifdef V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS 383 #define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL true 384 #else 385 #define V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL false 386 #endif 387 388 DEFINE_BOOL_READONLY(enable_unconditional_write_barriers, 389 V8_ENABLE_UNCONDITIONAL_WRITE_BARRIERS_BOOL, 390 "always use full write barriers") 391 392 #ifdef V8_ENABLE_SINGLE_GENERATION 393 #define V8_GENERATION_BOOL true 394 #else 395 #define V8_GENERATION_BOOL false 396 #endif 397 398 DEFINE_BOOL_READONLY( 399 single_generation, V8_GENERATION_BOOL, 400 "allocate all objects from young generation to old generation") 401 402 // Prevent inline allocation into new space 403 DEFINE_NEG_IMPLICATION(single_generation, inline_new) 404 DEFINE_NEG_IMPLICATION(single_generation, turbo_allocation_folding) 405 406 #ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING 407 #define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL true 408 #else 409 #define V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL false 410 #endif 411 DEFINE_BOOL_READONLY(conservative_stack_scanning, 412 V8_ENABLE_CONSERVATIVE_STACK_SCANNING_BOOL, 413 "use conservative stack scanning") 414 415 #ifdef V8_ENABLE_FUTURE 416 #define FUTURE_BOOL true 417 #else 418 #define FUTURE_BOOL false 419 #endif 420 DEFINE_BOOL(future, FUTURE_BOOL, 421 "Implies all staged features that we want to ship in the " 422 "not-too-far future") 423 424 DEFINE_WEAK_IMPLICATION(future, write_protect_code_memory) 425 DEFINE_WEAK_IMPLICATION(future, finalize_streaming_on_background) 426 DEFINE_WEAK_IMPLICATION(future, super_ic) 427 428 // Flags for jitless 429 DEFINE_BOOL(jitless, V8_LITE_BOOL, 430 "Disable runtime allocation of executable memory.") 431 432 // Jitless V8 has a few implications: 433 DEFINE_NEG_IMPLICATION(jitless, opt) 434 // Field representation tracking is only used by TurboFan. 435 DEFINE_NEG_IMPLICATION(jitless, track_field_types) 436 DEFINE_NEG_IMPLICATION(jitless, track_heap_object_fields) 437 // Regexps are interpreted. 438 DEFINE_IMPLICATION(jitless, regexp_interpret_all) 439 // asm.js validation is disabled since it triggers wasm code generation. 440 DEFINE_NEG_IMPLICATION(jitless, validate_asm) 441 // --jitless also implies --no-expose-wasm, see InitializeOncePerProcessImpl. 442 443 #ifndef V8_TARGET_ARCH_ARM 444 // Unsupported on arm. See https://crbug.com/v8/8713. 445 DEFINE_NEG_IMPLICATION(jitless, interpreted_frames_native_stack) 446 #endif 447 448 DEFINE_BOOL(assert_types, false, 449 "generate runtime type assertions to test the typer") 450 451 DEFINE_BOOL(trace_code_dependencies, false, "trace code dependencies") 452 // Depend on --trace-deopt-verbose for reporting dependency invalidations. 453 DEFINE_IMPLICATION(trace_code_dependencies, trace_deopt_verbose) 454 455 // Flags for experimental implementation features. 456 DEFINE_BOOL(allocation_site_pretenuring, true, 457 "pretenure with allocation sites") 458 DEFINE_BOOL(page_promotion, true, "promote pages based on utilization") 459 DEFINE_BOOL_READONLY(always_promote_young_mc, true, 460 "always promote young objects during mark-compact") 461 DEFINE_INT(page_promotion_threshold, 70, 462 "min percentage of live bytes on a page to enable fast evacuation") 463 DEFINE_BOOL(trace_pretenuring, false, 464 "trace pretenuring decisions of HAllocate instructions") 465 DEFINE_BOOL(trace_pretenuring_statistics, false, 466 "trace allocation site pretenuring statistics") 467 DEFINE_BOOL(track_fields, true, "track fields with only smi values") 468 DEFINE_BOOL(track_double_fields, true, "track fields with double values") 469 DEFINE_BOOL(track_heap_object_fields, true, "track fields with heap values") 470 DEFINE_BOOL(track_computed_fields, true, "track computed boilerplate fields") 471 DEFINE_IMPLICATION(track_double_fields, track_fields) 472 DEFINE_IMPLICATION(track_heap_object_fields, track_fields) 473 DEFINE_IMPLICATION(track_computed_fields, track_fields) 474 DEFINE_BOOL(track_field_types, true, "track field types") 475 DEFINE_IMPLICATION(track_field_types, track_fields) 476 DEFINE_IMPLICATION(track_field_types, track_heap_object_fields) 477 DEFINE_BOOL(trace_block_coverage, false, 478 "trace collected block coverage information") 479 DEFINE_BOOL(trace_protector_invalidation, false, 480 "trace protector cell invalidations") 481 DEFINE_BOOL(feedback_normalization, false, 482 "feed back normalization to constructors") 483 // TODO(jkummerow): This currently adds too much load on the stub cache. 484 DEFINE_BOOL_READONLY(internalize_on_the_fly, true, 485 "internalize string keys for generic keyed ICs on the fly") 486 487 // Flag for one shot optimiztions. 488 DEFINE_BOOL(enable_one_shot_optimization, false, 489 "Enable size optimizations for the code that will " 490 "only be executed once") 491 492 // Flag for sealed, frozen elements kind instead of dictionary elements kind 493 DEFINE_BOOL_READONLY(enable_sealed_frozen_elements_kind, true, 494 "Enable sealed, frozen elements kind") 495 496 // Flags for data representation optimizations 497 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles") 498 DEFINE_BOOL_READONLY(string_slices, true, "use string slices") 499 500 DEFINE_INT(interrupt_budget, 144 * KB, 501 "interrupt budget which should be used for the profiler counter") 502 503 // Flags for inline caching and feedback vectors. 504 DEFINE_BOOL(use_ic, true, "use inline caching") 505 DEFINE_INT(budget_for_feedback_vector_allocation, 1 * KB, 506 "The budget in amount of bytecode executed by a function before we " 507 "decide to allocate feedback vectors") 508 DEFINE_BOOL(lazy_feedback_allocation, true, "Allocate feedback vectors lazily") 509 510 // Flags for Ignition. 511 DEFINE_BOOL(ignition_elide_noneffectful_bytecodes, true, 512 "elide bytecodes which won't have any external effect") 513 DEFINE_BOOL(ignition_reo, true, "use ignition register equivalence optimizer") 514 DEFINE_BOOL(ignition_filter_expression_positions, true, 515 "filter expression positions before the bytecode pipeline") 516 DEFINE_BOOL(ignition_share_named_property_feedback, true, 517 "share feedback slots when loading the same named property from " 518 "the same object") 519 DEFINE_BOOL(print_bytecode, false, 520 "print bytecode generated by ignition interpreter") 521 DEFINE_BOOL(enable_lazy_source_positions, V8_LAZY_SOURCE_POSITIONS_BOOL, 522 "skip generating source positions during initial compile but " 523 "regenerate when actually required") 524 DEFINE_BOOL(stress_lazy_source_positions, false, 525 "collect lazy source positions immediately after lazy compile") 526 DEFINE_STRING(print_bytecode_filter, "*", 527 "filter for selecting which functions to print bytecode") 528 #ifdef V8_TRACE_IGNITION 529 DEFINE_BOOL(trace_ignition, false, 530 "trace the bytecodes executed by the ignition interpreter") 531 #endif 532 #ifdef V8_TRACE_FEEDBACK_UPDATES 533 DEFINE_BOOL( 534 trace_feedback_updates, false, 535 "trace updates to feedback vectors during ignition interpreter execution.") 536 #endif 537 DEFINE_BOOL(trace_ignition_codegen, false, 538 "trace the codegen of ignition interpreter bytecode handlers") 539 DEFINE_BOOL(trace_ignition_dispatches, false, 540 "traces the dispatches to bytecode handlers by the ignition " 541 "interpreter") 542 DEFINE_STRING(trace_ignition_dispatches_output_file, nullptr, 543 "the file to which the bytecode handler dispatch table is " 544 "written (by default, the table is not written to a file)") 545 546 DEFINE_BOOL(fast_math, true, "faster (but maybe less accurate) math functions") 547 DEFINE_BOOL(trace_track_allocation_sites, false, 548 "trace the tracking of allocation sites") 549 DEFINE_BOOL(trace_migration, false, "trace object migration") 550 DEFINE_BOOL(trace_generalization, false, "trace map generalization") 551 552 // Flags for TurboProp. 553 DEFINE_BOOL(turboprop, false, "enable experimental turboprop mid-tier compiler") 554 DEFINE_BOOL(turboprop_mid_tier_reg_alloc, true, 555 "enable mid-tier register allocator for turboprop") 556 DEFINE_BOOL(turboprop_dynamic_map_checks, false, 557 "use dynamic map checks when generating code for property accesses " 558 "if all handlers in an IC are the same for turboprop") 559 DEFINE_BOOL(turboprop_as_midtier, false, 560 "enable experimental turboprop mid-tier compiler") 561 DEFINE_IMPLICATION(turboprop_as_midtier, turboprop) 562 DEFINE_IMPLICATION(turboprop, concurrent_inlining) 563 DEFINE_VALUE_IMPLICATION(turboprop, interrupt_budget, 15 * KB) 564 DEFINE_VALUE_IMPLICATION(turboprop, reuse_opt_code_count, 2) 565 DEFINE_UINT_READONLY(max_minimorphic_map_checks, 4, 566 "max number of map checks to perform in minimorphic state") 567 // Since Turboprop uses much lower value for interrupt budget, we need to wait 568 // for a higher number of ticks to tierup to Turbofan roughly match the default. 569 // The default of 10 is approximately the ration of TP to TF interrupt budget. 570 DEFINE_INT(ticks_scale_factor_for_top_tier, 10, 571 "scale factor for profiler ticks when tiering up from midtier") 572 573 // Flags for concurrent recompilation. 574 DEFINE_BOOL(concurrent_recompilation, true, 575 "optimizing hot functions asynchronously on a separate thread") 576 DEFINE_BOOL(trace_concurrent_recompilation, false, 577 "track concurrent recompilation") 578 DEFINE_INT(concurrent_recompilation_queue_length, 8, 579 "the length of the concurrent compilation queue") 580 DEFINE_INT(concurrent_recompilation_delay, 0, 581 "artificial compilation delay in ms") 582 DEFINE_BOOL(block_concurrent_recompilation, false, 583 "block queued jobs until released") 584 DEFINE_BOOL(concurrent_inlining, false, 585 "run optimizing compiler's inlining phase on a separate thread") 586 DEFINE_BOOL(turbo_direct_heap_access, false, 587 "access kNeverSerialized objects directly from the heap") 588 DEFINE_IMPLICATION(concurrent_inlining, turbo_direct_heap_access) 589 DEFINE_INT(max_serializer_nesting, 25, 590 "maximum levels for nesting child serializers") 591 DEFINE_WEAK_IMPLICATION(future, concurrent_inlining) 592 DEFINE_BOOL(trace_heap_broker_verbose, false, 593 "trace the heap broker verbosely (all reports)") 594 DEFINE_BOOL(trace_heap_broker_memory, false, 595 "trace the heap broker memory (refs analysis and zone numbers)") 596 DEFINE_BOOL(trace_heap_broker, false, 597 "trace the heap broker (reports on missing data only)") 598 DEFINE_IMPLICATION(trace_heap_broker_verbose, trace_heap_broker) 599 DEFINE_IMPLICATION(trace_heap_broker_memory, trace_heap_broker) 600 601 // Flags for stress-testing the compiler. 602 DEFINE_INT(stress_runs, 0, "number of stress runs") 603 DEFINE_INT(deopt_every_n_times, 0, 604 "deoptimize every n times a deopt point is passed") 605 DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points") 606 607 // Flags for TurboFan. 608 DEFINE_BOOL(opt, true, "use adaptive optimizations") 609 DEFINE_BOOL(turbo_sp_frame_access, false, 610 "use stack pointer-relative access to frame wherever possible") 611 DEFINE_BOOL( 612 stress_turbo_late_spilling, false, 613 "optimize placement of all spill instructions, not just loop-top phis") 614 615 DEFINE_STRING(turbo_filter, "*", "optimization filter for TurboFan compiler") 616 DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR") 617 DEFINE_STRING(trace_turbo_path, nullptr, 618 "directory to dump generated TurboFan IR to") 619 DEFINE_STRING(trace_turbo_filter, "*", 620 "filter for tracing turbofan compilation") 621 DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs") 622 DEFINE_BOOL(trace_turbo_scheduled, false, "trace TurboFan IR with schedule") 623 DEFINE_IMPLICATION(trace_turbo_scheduled, trace_turbo_graph) 624 DEFINE_STRING(trace_turbo_cfg_file, nullptr, 625 "trace turbo cfg graph (for C1 visualizer) to a given file name") 626 DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types") 627 DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler") 628 DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers") 629 DEFINE_BOOL(trace_turbo_trimming, false, "trace TurboFan's graph trimmer") 630 DEFINE_BOOL(trace_turbo_jt, false, "trace TurboFan's jump threading") 631 DEFINE_BOOL(trace_turbo_ceq, false, "trace TurboFan's control equivalence") 632 DEFINE_BOOL(trace_turbo_loop, false, "trace TurboFan's loop optimizations") 633 DEFINE_BOOL(trace_turbo_alloc, false, "trace TurboFan's register allocator") 634 DEFINE_BOOL(trace_all_uses, false, "trace all use positions") 635 DEFINE_BOOL(trace_representation, false, "trace representation types") 636 DEFINE_BOOL( 637 trace_turbo_stack_accesses, false, 638 "trace stack load/store counters for optimized code in run-time (x64 only)") 639 DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase") 640 DEFINE_STRING(turbo_verify_machine_graph, nullptr, 641 "verify TurboFan machine graph before instruction selection") 642 #ifdef ENABLE_VERIFY_CSA 643 DEFINE_BOOL(verify_csa, DEBUG_BOOL, 644 "verify TurboFan machine graph of code stubs") 645 #else 646 // Define the flag as read-only-false so that code still compiles even in the 647 // non-ENABLE_VERIFY_CSA configuration. 648 DEFINE_BOOL_READONLY(verify_csa, false, 649 "verify TurboFan machine graph of code stubs") 650 #endif 651 DEFINE_BOOL(trace_verify_csa, false, "trace code stubs verification") 652 DEFINE_STRING(csa_trap_on_node, nullptr, 653 "trigger break point when a node with given id is created in " 654 "given stub. The format is: StubName,NodeId") 655 DEFINE_BOOL_READONLY(fixed_array_bounds_checks, true, 656 "enable FixedArray bounds checks") 657 DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics") 658 DEFINE_BOOL(turbo_stats_nvp, false, 659 "print TurboFan statistics in machine-readable format") 660 DEFINE_BOOL(turbo_stats_wasm, false, 661 "print TurboFan statistics of wasm compilations") 662 DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan") 663 DEFINE_BOOL(function_context_specialization, false, 664 "enable function context specialization in TurboFan") 665 DEFINE_BOOL(turbo_inlining, true, "enable inlining in TurboFan") 666 DEFINE_INT(max_inlined_bytecode_size, 500, 667 "maximum size of bytecode for a single inlining") 668 DEFINE_INT(max_inlined_bytecode_size_cumulative, 1000, 669 "maximum cumulative size of bytecode considered for inlining") 670 DEFINE_INT(max_inlined_bytecode_size_absolute, 5000, 671 "maximum cumulative size of bytecode considered for inlining") 672 DEFINE_FLOAT(reserve_inline_budget_scale_factor, 1.2, 673 "maximum cumulative size of bytecode considered for inlining") 674 DEFINE_INT(max_inlined_bytecode_size_small, 30, 675 "maximum size of bytecode considered for small function inlining") 676 DEFINE_INT(max_optimized_bytecode_size, 60 * KB, 677 "maximum bytecode size to " 678 "be considered for optimization; too high values may cause " 679 "the compiler to hit (release) assertions") 680 DEFINE_FLOAT(min_inlining_frequency, 0.15, "minimum frequency for inlining") 681 DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining") 682 DEFINE_BOOL(stress_inline, false, 683 "set high thresholds for inlining to inline as much as possible") 684 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size, 999999) 685 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_cumulative, 686 999999) 687 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_absolute, 688 999999) 689 DEFINE_VALUE_IMPLICATION(stress_inline, min_inlining_frequency, 0) 690 DEFINE_IMPLICATION(stress_inline, polymorphic_inlining) 691 DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining") 692 DEFINE_BOOL(turbo_inline_array_builtins, true, 693 "inline array builtins in TurboFan code") 694 DEFINE_BOOL(use_osr, true, "use on-stack replacement") 695 DEFINE_BOOL(trace_osr, false, "trace on-stack replacement") 696 DEFINE_BOOL(analyze_environment_liveness, true, 697 "analyze liveness of environment slots and zap dead values") 698 DEFINE_BOOL(trace_environment_liveness, false, 699 "trace liveness of local variable slots") 700 DEFINE_BOOL(turbo_load_elimination, true, "enable load elimination in TurboFan") 701 DEFINE_BOOL(trace_turbo_load_elimination, false, 702 "trace TurboFan load elimination") 703 DEFINE_BOOL(turbo_profiling, false, "enable basic block profiling in TurboFan") 704 DEFINE_BOOL(turbo_profiling_verbose, false, 705 "enable basic block profiling in TurboFan, and include each " 706 "function's schedule and disassembly in the output") 707 DEFINE_IMPLICATION(turbo_profiling_verbose, turbo_profiling) 708 DEFINE_BOOL(turbo_profiling_log_builtins, false, 709 "emit data about basic block usage in builtins to v8.log (requires " 710 "that V8 was built with v8_enable_builtins_profiling=true)") 711 DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL, 712 "verify register allocation in TurboFan") 713 DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan") 714 DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan") 715 DEFINE_BOOL(turbo_loop_peeling, true, "Turbofan loop peeling") 716 DEFINE_BOOL(turbo_loop_variable, true, "Turbofan loop variable optimization") 717 DEFINE_BOOL(turbo_loop_rotation, true, "Turbofan loop rotation") 718 DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan") 719 DEFINE_BOOL(turbo_escape, true, "enable escape analysis") 720 DEFINE_BOOL(turbo_allocation_folding, true, "Turbofan allocation folding") 721 DEFINE_BOOL(turbo_instruction_scheduling, false, 722 "enable instruction scheduling in TurboFan") 723 DEFINE_BOOL(turbo_stress_instruction_scheduling, false, 724 "randomly schedule instructions to stress dependency tracking") 725 DEFINE_IMPLICATION(turbo_stress_instruction_scheduling, 726 turbo_instruction_scheduling) 727 DEFINE_BOOL(turbo_store_elimination, true, 728 "enable store-store elimination in TurboFan") 729 DEFINE_BOOL(trace_store_elimination, false, "trace store elimination") 730 DEFINE_BOOL(turbo_rewrite_far_jumps, true, 731 "rewrite far to near jumps (ia32,x64)") 732 DEFINE_BOOL( 733 stress_gc_during_compilation, false, 734 "simulate GC/compiler thread race related to https://crbug.com/v8/8520") 735 DEFINE_BOOL(turbo_fast_api_calls, false, "enable fast API calls from TurboFan") 736 DEFINE_INT(reuse_opt_code_count, 0, 737 "don't discard optimized code for the specified number of deopts.") 738 739 // Native context independent (NCI) code. 740 DEFINE_BOOL(turbo_nci, false, 741 "enable experimental native context independent code.") 742 // TODO(v8:8888): Temporary until NCI caching is implemented or 743 // feedback collection is made unconditional. 744 DEFINE_IMPLICATION(turbo_nci, turbo_collect_feedback_in_generic_lowering) 745 DEFINE_BOOL(turbo_nci_as_midtier, false, 746 "insert NCI as a midtier compiler for testing purposes.") 747 DEFINE_BOOL(print_nci_code, false, "print native context independent code.") 748 DEFINE_BOOL(trace_turbo_nci, false, "trace native context independent code.") 749 DEFINE_BOOL(turbo_collect_feedback_in_generic_lowering, true, 750 "enable experimental feedback collection in generic lowering.") 751 // TODO(jgruber,v8:8888): Remove this flag once we've settled on a codegen 752 // strategy. 753 DEFINE_BOOL(turbo_nci_delayed_codegen, true, 754 "delay NCI codegen to reduce useless compilation work.") 755 // TODO(jgruber,v8:8888): Remove this flag once we've settled on an ageing 756 // strategy. 757 DEFINE_BOOL(turbo_nci_cache_ageing, false, 758 "enable ageing of the NCI code cache.") 759 // TODO(jgruber,v8:8888): Remove this flag once we've settled on an ageing 760 // strategy. 761 DEFINE_BOOL(isolate_script_cache_ageing, true, 762 "enable ageing of the isolate script cache.") 763 764 // Favor memory over execution speed. 765 DEFINE_BOOL(optimize_for_size, false, 766 "Enables optimizations which favor memory size over execution " 767 "speed") 768 DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1) 769 770 #ifdef DISABLE_UNTRUSTED_CODE_MITIGATIONS 771 #define V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS false 772 #else 773 #define V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS true 774 #endif 775 DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS, 776 "Enable mitigations for executing untrusted code") 777 #undef V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS 778 779 // Flags for native WebAssembly. 780 DEFINE_BOOL(wasm_generic_wrapper, false, 781 "use generic js-to-wasm wrapper instead of per-signature wrappers") 782 DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript") 783 DEFINE_INT(wasm_num_compilation_tasks, 128, 784 "maximum number of parallel compilation tasks for wasm") 785 DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false, 786 "trace wasm native heap events") 787 DEFINE_BOOL(wasm_write_protect_code_memory, false, 788 "write protect code memory on the wasm native heap") 789 DEFINE_DEBUG_BOOL(trace_wasm_serialization, false, 790 "trace serialization/deserialization") 791 DEFINE_BOOL(wasm_async_compilation, true, 792 "enable actual asynchronous compilation for WebAssembly.compile") 793 DEFINE_BOOL(wasm_test_streaming, false, 794 "use streaming compilation instead of async compilation for tests") 795 DEFINE_UINT(wasm_max_mem_pages, v8::internal::wasm::kSpecMaxMemoryPages, 796 "maximum number of 64KiB memory pages per wasm memory") 797 DEFINE_UINT(wasm_max_table_size, v8::internal::wasm::kV8MaxWasmTableSize, 798 "maximum table size of a wasm instance") 799 DEFINE_UINT(wasm_max_code_space, v8::internal::kMaxWasmCodeMB, 800 "maximum committed code space for wasm (in MB)") 801 DEFINE_BOOL(wasm_tier_up, true, 802 "enable tier up to the optimizing compiler (requires --liftoff to " 803 "have an effect)") 804 DEFINE_BOOL(wasm_dynamic_tiering, false, 805 "enable dynamic tier up to the optimizing compiler") 806 DEFINE_DEBUG_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code") 807 DEFINE_DEBUG_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code") 808 DEFINE_DEBUG_BOOL(trace_wasm_interpreter, false, 809 "trace interpretation of wasm code") 810 DEFINE_DEBUG_BOOL(trace_wasm_streaming, false, 811 "trace streaming compilation of wasm code") 812 DEFINE_INT(trace_wasm_ast_start, 0, 813 "start function for wasm AST trace (inclusive)") 814 DEFINE_INT(trace_wasm_ast_end, 0, "end function for wasm AST trace (exclusive)") 815 DEFINE_BOOL(liftoff, true, 816 "enable Liftoff, the baseline compiler for WebAssembly") 817 DEFINE_BOOL(experimental_liftoff_extern_ref, false, 818 "enable support for externref in Liftoff") 819 // We can't tier up (from Liftoff to TurboFan) in single-threaded mode, hence 820 // disable Liftoff in that configuration for now. The alternative is disabling 821 // TurboFan, which would reduce peak performance considerably. 822 // Note that for debugging, Liftoff will still be used. 823 DEFINE_NEG_IMPLICATION(single_threaded, liftoff) 824 DEFINE_DEBUG_BOOL(trace_liftoff, false, 825 "trace Liftoff, the baseline compiler for WebAssembly") 826 DEFINE_BOOL(trace_wasm_memory, false, 827 "print all memory updates performed in wasm code") 828 // Fuzzers use {wasm_tier_mask_for_testing} together with {liftoff} and 829 // {no_wasm_tier_up} to force some functions to be compiled with Turbofan. 830 DEFINE_INT(wasm_tier_mask_for_testing, 0, 831 "bitmask of functions to compile with TurboFan instead of Liftoff") 832 833 DEFINE_BOOL(wasm_expose_debug_eval, true, 834 "Expose wasm evaluator support on the CDP") 835 836 DEFINE_BOOL(validate_asm, true, "validate asm.js modules before compiling") 837 DEFINE_BOOL(suppress_asm_messages, false, 838 "don't emit asm.js related messages (for golden file testing)") 839 DEFINE_BOOL(trace_asm_time, false, "log asm.js timing info to the console") 840 DEFINE_BOOL(trace_asm_scanner, false, 841 "log tokens encountered by asm.js scanner") 842 DEFINE_BOOL(trace_asm_parser, false, "verbose logging of asm.js parse failures") 843 DEFINE_BOOL(stress_validate_asm, false, "try to validate everything as asm.js") 844 845 DEFINE_DEBUG_BOOL(dump_wasm_module, false, "dump wasm module bytes") 846 DEFINE_STRING(dump_wasm_module_path, nullptr, 847 "directory to dump wasm modules to") 848 849 // Declare command-line flags for Wasm features. Warning: avoid using these 850 // flags directly in the implementation. Instead accept wasm::WasmFeatures 851 // for configurability. 852 #include "src/wasm/wasm-feature-flags.h" 853 854 #define DECL_WASM_FLAG(feat, desc, val) \ 855 DEFINE_BOOL(experimental_wasm_##feat, val, \ 856 "enable prototype " desc " for wasm") 857 FOREACH_WASM_FEATURE_FLAG(DECL_WASM_FLAG) 858 #undef DECL_WASM_FLAG 859 860 DEFINE_IMPLICATION(experimental_wasm_gc, experimental_wasm_typed_funcref) 861 DEFINE_IMPLICATION(experimental_wasm_typed_funcref, experimental_wasm_reftypes) 862 863 DEFINE_BOOL(wasm_staging, false, "enable staged wasm features") 864 865 #define WASM_STAGING_IMPLICATION(feat, desc, val) \ 866 DEFINE_IMPLICATION(wasm_staging, experimental_wasm_##feat) 867 FOREACH_WASM_STAGING_FEATURE_FLAG(WASM_STAGING_IMPLICATION) 868 #undef WASM_STAGING_IMPLICATION 869 870 DEFINE_BOOL(wasm_opt, true, "enable wasm optimization") 871 DEFINE_BOOL( 872 wasm_bounds_checks, true, 873 "enable bounds checks (disable for performance testing only)") 874 DEFINE_BOOL(wasm_stack_checks, true, 875 "enable stack checks (disable for performance testing only)") 876 DEFINE_BOOL(wasm_math_intrinsics, true, 877 "intrinsify some Math imports into wasm") 878 879 DEFINE_BOOL(wasm_trap_handler, true, 880 "use signal handlers to catch out of bounds memory access in wasm" 881 " (currently Linux x86_64 only)") 882 DEFINE_BOOL(wasm_fuzzer_gen_test, false, 883 "generate a test case when running a wasm fuzzer") 884 DEFINE_IMPLICATION(wasm_fuzzer_gen_test, single_threaded) 885 DEFINE_BOOL(print_wasm_code, false, "print WebAssembly code") 886 DEFINE_INT(print_wasm_code_function_index, -1, 887 "print WebAssembly code for function at index") 888 DEFINE_BOOL(print_wasm_stub_code, false, "print WebAssembly stub code") 889 DEFINE_BOOL(asm_wasm_lazy_compilation, false, 890 "enable lazy compilation for asm-wasm modules") 891 DEFINE_IMPLICATION(validate_asm, asm_wasm_lazy_compilation) 892 DEFINE_BOOL(wasm_lazy_compilation, false, 893 "enable lazy compilation for all wasm modules") 894 DEFINE_DEBUG_BOOL(trace_wasm_lazy_compilation, false, 895 "trace lazy compilation of wasm functions") 896 DEFINE_BOOL(wasm_lazy_validation, false, 897 "enable lazy validation for lazily compiled wasm functions") 898 899 DEFINE_BOOL(wasm_grow_shared_memory, true, 900 "allow growing shared WebAssembly memory objects") 901 DEFINE_BOOL(wasm_simd_post_mvp, false, 902 "allow experimental SIMD operations for prototyping that are not " 903 "included in the current proposal") 904 DEFINE_IMPLICATION(wasm_simd_post_mvp, experimental_wasm_simd) 905 906 DEFINE_BOOL(wasm_code_gc, true, "enable garbage collection of wasm code") 907 DEFINE_BOOL(trace_wasm_code_gc, false, "trace garbage collection of wasm code") 908 DEFINE_BOOL(stress_wasm_code_gc, false, 909 "stress test garbage collection of wasm code") 910 DEFINE_INT(wasm_max_initial_code_space_reservation, 0, 911 "maximum size of the initial wasm code space reservation (in MB)") 912 913 DEFINE_BOOL(experimental_wasm_allow_huge_modules, false, 914 "allow wasm modules bigger than 1GB, but below ~2GB") 915 916 // Profiler flags. 917 DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler") 918 919 DEFINE_INT(stress_sampling_allocation_profiler, 0, 920 "Enables sampling allocation profiler with X as a sample interval") 921 922 // Garbage collections flags. 923 DEFINE_BOOL(lazy_new_space_shrinking, false, 924 "Enables the lazy new space shrinking strategy") 925 DEFINE_SIZE_T(min_semi_space_size, 0, 926 "min size of a semi-space (in MBytes), the new space consists of " 927 "two semi-spaces") 928 DEFINE_SIZE_T(max_semi_space_size, 0, 929 "max size of a semi-space (in MBytes), the new space consists of " 930 "two semi-spaces") 931 DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space") 932 DEFINE_SIZE_T(max_old_space_size, 0, "max size of the old space (in Mbytes)") 933 DEFINE_SIZE_T( 934 max_heap_size, 0, 935 "max size of the heap (in Mbytes) " 936 "both max_semi_space_size and max_old_space_size take precedence. " 937 "All three flags cannot be specified at the same time.") 938 DEFINE_SIZE_T(initial_heap_size, 0, "initial size of the heap (in Mbytes)") 939 DEFINE_BOOL(huge_max_old_generation_size, true, 940 "Increase max size of the old space to 4 GB for x64 systems with" 941 "the physical memory bigger than 16 GB") 942 DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)") 943 DEFINE_BOOL(global_gc_scheduling, true, 944 "enable GC scheduling based on global memory") 945 DEFINE_BOOL(gc_global, false, "always perform global GCs") 946 DEFINE_INT(random_gc_interval, 0, 947 "Collect garbage after random(0, X) allocations. It overrides " 948 "gc_interval.") 949 DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations") 950 DEFINE_INT(retain_maps_for_n_gc, 2, 951 "keeps maps alive for <n> old space garbage collections") 952 DEFINE_BOOL(trace_gc, false, 953 "print one trace line following each garbage collection") 954 DEFINE_BOOL(trace_gc_nvp, false, 955 "print one detailed trace line in name=value format " 956 "after each garbage collection") 957 DEFINE_BOOL(trace_gc_ignore_scavenger, false, 958 "do not print trace line after scavenger collection") 959 DEFINE_BOOL(trace_idle_notification, false, 960 "print one trace line following each idle notification") 961 DEFINE_BOOL(trace_idle_notification_verbose, false, 962 "prints the heap state used by the idle notification") 963 DEFINE_BOOL(trace_gc_verbose, false, 964 "print more details following each garbage collection") 965 DEFINE_IMPLICATION(trace_gc_verbose, trace_gc) 966 DEFINE_BOOL(trace_gc_freelists, false, 967 "prints details of each freelist before and after " 968 "each major garbage collection") 969 DEFINE_BOOL(trace_gc_freelists_verbose, false, 970 "prints details of freelists of each page before and after " 971 "each major garbage collection") 972 DEFINE_IMPLICATION(trace_gc_freelists_verbose, trace_gc_freelists) 973 DEFINE_BOOL(trace_evacuation_candidates, false, 974 "Show statistics about the pages evacuation by the compaction") 975 DEFINE_BOOL( 976 trace_allocations_origins, false, 977 "Show statistics about the origins of allocations. " 978 "Combine with --no-inline-new to track allocations from generated code") 979 980 DEFINE_INT(trace_allocation_stack_interval, -1, 981 "print stack trace after <n> free-list allocations") 982 DEFINE_INT(trace_duplicate_threshold_kb, 0, 983 "print duplicate objects in the heap if their size is more than " 984 "given threshold") 985 DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space") 986 DEFINE_BOOL(trace_fragmentation_verbose, false, 987 "report fragmentation for old space (detailed)") 988 DEFINE_BOOL(minor_mc_trace_fragmentation, false, 989 "trace fragmentation after marking") 990 DEFINE_BOOL(trace_evacuation, false, "report evacuation statistics") 991 DEFINE_BOOL(trace_mutator_utilization, false, 992 "print mutator utilization, allocation speed, gc speed") 993 DEFINE_BOOL(incremental_marking, true, "use incremental marking") 994 DEFINE_BOOL(incremental_marking_wrappers, true, 995 "use incremental marking for marking wrappers") 996 DEFINE_BOOL(incremental_marking_task, true, "use tasks for incremental marking") 997 DEFINE_INT(incremental_marking_soft_trigger, 0, 998 "threshold for starting incremental marking via a task in percent " 999 "of available space: limit - size") 1000 DEFINE_INT(incremental_marking_hard_trigger, 0, 1001 "threshold for starting incremental marking immediately in percent " 1002 "of available space: limit - size") 1003 DEFINE_BOOL(trace_unmapper, false, "Trace the unmapping") 1004 DEFINE_BOOL(parallel_scavenge, true, "parallel scavenge") 1005 DEFINE_BOOL(scavenge_task, true, "schedule scavenge tasks") 1006 DEFINE_INT(scavenge_task_trigger, 80, 1007 "scavenge task trigger in percent of the current heap limit") 1008 DEFINE_BOOL(scavenge_separate_stack_scanning, false, 1009 "use a separate phase for stack scanning in scavenge") 1010 DEFINE_BOOL(trace_parallel_scavenge, false, "trace parallel scavenge") 1011 DEFINE_BOOL(write_protect_code_memory, true, "write protect code memory") 1012 #if defined(V8_ATOMIC_MARKING_STATE) && defined(V8_ATOMIC_OBJECT_FIELD_WRITES) 1013 #define V8_CONCURRENT_MARKING_BOOL true 1014 #else 1015 #define V8_CONCURRENT_MARKING_BOOL false 1016 #endif 1017 DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING_BOOL, 1018 "use concurrent marking") 1019 DEFINE_BOOL(concurrent_array_buffer_sweeping, true, 1020 "concurrently sweep array buffers") 1021 DEFINE_BOOL(concurrent_allocation, true, "concurrently allocate in old space") 1022 DEFINE_BOOL(stress_concurrent_allocation, false, 1023 "start background threads that allocate memory") 1024 DEFINE_BOOL(local_heaps, true, "allow heap access from background tasks") 1025 // Since the local_heaps flag is enabled by default, we defined reverse 1026 // implications to simplify disabling the flag. 1027 DEFINE_NEG_NEG_IMPLICATION(local_heaps, turbo_direct_heap_access) 1028 DEFINE_NEG_NEG_IMPLICATION(local_heaps, concurrent_inlining) 1029 DEFINE_NEG_NEG_IMPLICATION(local_heaps, concurrent_allocation) 1030 DEFINE_NEG_NEG_IMPLICATION(concurrent_allocation, 1031 finalize_streaming_on_background) 1032 DEFINE_NEG_NEG_IMPLICATION(concurrent_allocation, stress_concurrent_allocation) 1033 DEFINE_BOOL(parallel_marking, V8_CONCURRENT_MARKING_BOOL, 1034 "use parallel marking in atomic pause") 1035 DEFINE_INT(ephemeron_fixpoint_iterations, 10, 1036 "number of fixpoint iterations it takes to switch to linear " 1037 "ephemeron algorithm") 1038 DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking") 1039 DEFINE_BOOL(concurrent_store_buffer, true, 1040 "use concurrent store buffer processing") 1041 DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping") 1042 DEFINE_BOOL(parallel_compaction, true, "use parallel compaction") 1043 DEFINE_BOOL(parallel_pointer_update, true, 1044 "use parallel pointer update during compaction") 1045 DEFINE_BOOL(detect_ineffective_gcs_near_heap_limit, true, 1046 "trigger out-of-memory failure to avoid GC storm near heap limit") 1047 DEFINE_BOOL(trace_incremental_marking, false, 1048 "trace progress of the incremental marking") 1049 DEFINE_BOOL(trace_stress_marking, false, "trace stress marking progress") 1050 DEFINE_BOOL(trace_stress_scavenge, false, "trace stress scavenge progress") 1051 DEFINE_BOOL(track_gc_object_stats, false, 1052 "track object counts and memory usage") 1053 DEFINE_BOOL(trace_gc_object_stats, false, 1054 "trace object counts and memory usage") 1055 DEFINE_BOOL(trace_zone_stats, false, "trace zone memory usage") 1056 DEFINE_GENERIC_IMPLICATION( 1057 trace_zone_stats, 1058 TracingFlags::zone_stats.store( 1059 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1060 DEFINE_SIZE_T( 1061 zone_stats_tolerance, 1 * MB, 1062 "report a tick only when allocated zone memory changes by this amount") 1063 DEFINE_BOOL(trace_zone_type_stats, false, "trace per-type zone memory usage") 1064 DEFINE_GENERIC_IMPLICATION( 1065 trace_zone_type_stats, 1066 TracingFlags::zone_stats.store( 1067 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1068 DEFINE_BOOL(track_retaining_path, false, 1069 "enable support for tracking retaining path") 1070 DEFINE_DEBUG_BOOL(trace_backing_store, false, "trace backing store events") 1071 DEFINE_BOOL(concurrent_array_buffer_freeing, true, 1072 "free array buffer allocations on a background thread") 1073 DEFINE_INT(gc_stats, 0, "Used by tracing internally to enable gc statistics") 1074 DEFINE_IMPLICATION(trace_gc_object_stats, track_gc_object_stats) 1075 DEFINE_GENERIC_IMPLICATION( 1076 track_gc_object_stats, 1077 TracingFlags::gc_stats.store( 1078 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1079 DEFINE_GENERIC_IMPLICATION( 1080 trace_gc_object_stats, 1081 TracingFlags::gc_stats.store( 1082 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1083 DEFINE_NEG_IMPLICATION(trace_gc_object_stats, incremental_marking) 1084 DEFINE_NEG_IMPLICATION(track_retaining_path, incremental_marking) 1085 DEFINE_NEG_IMPLICATION(track_retaining_path, parallel_marking) 1086 DEFINE_NEG_IMPLICATION(track_retaining_path, concurrent_marking) 1087 DEFINE_BOOL(track_detached_contexts, true, 1088 "track native contexts that are expected to be garbage collected") 1089 DEFINE_BOOL(trace_detached_contexts, false, 1090 "trace native contexts that are expected to be garbage collected") 1091 DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts) 1092 #ifdef VERIFY_HEAP 1093 DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC") 1094 DEFINE_BOOL(verify_heap_skip_remembered_set, false, 1095 "disable remembered set verification") 1096 #endif 1097 DEFINE_BOOL(move_object_start, true, "enable moving of object starts") 1098 DEFINE_BOOL(memory_reducer, true, "use memory reducer") 1099 DEFINE_BOOL(memory_reducer_for_small_heaps, true, 1100 "use memory reducer for small heaps") 1101 DEFINE_INT(heap_growing_percent, 0, 1102 "specifies heap growing factor as (1 + heap_growing_percent/100)") 1103 DEFINE_INT(v8_os_page_size, 0, "override OS page size (in KBytes)") 1104 DEFINE_BOOL(always_compact, false, "Perform compaction on every full GC") 1105 DEFINE_BOOL(never_compact, false, 1106 "Never perform compaction on full GC - testing only") 1107 DEFINE_BOOL(compact_code_space, true, "Compact code space on full collections") 1108 DEFINE_BOOL(flush_bytecode, true, 1109 "flush of bytecode when it has not been executed recently") 1110 DEFINE_BOOL(stress_flush_bytecode, false, "stress bytecode flushing") 1111 DEFINE_BOOL(trace_flush_bytecode, false, "trace bytecode flushing") 1112 DEFINE_IMPLICATION(stress_flush_bytecode, flush_bytecode) 1113 DEFINE_BOOL(use_marking_progress_bar, true, 1114 "Use a progress bar to scan large objects in increments when " 1115 "incremental marking is active.") 1116 DEFINE_BOOL(stress_per_context_marking_worklist, false, 1117 "Use per-context worklist for marking") 1118 DEFINE_BOOL(force_marking_deque_overflows, false, 1119 "force overflows of marking deque by reducing it's size " 1120 "to 64 words") 1121 DEFINE_BOOL(stress_compaction, false, 1122 "stress the GC compactor to flush out bugs (implies " 1123 "--force_marking_deque_overflows)") 1124 DEFINE_BOOL(stress_compaction_random, false, 1125 "Stress GC compaction by selecting random percent of pages as " 1126 "evacuation candidates. It overrides stress_compaction.") 1127 DEFINE_BOOL(stress_incremental_marking, false, 1128 "force incremental marking for small heaps and run it more often") 1129 1130 DEFINE_BOOL(fuzzer_gc_analysis, false, 1131 "prints number of allocations and enables analysis mode for gc " 1132 "fuzz testing, e.g. --stress-marking, --stress-scavenge") 1133 DEFINE_INT(stress_marking, 0, 1134 "force marking at random points between 0 and X (inclusive) percent " 1135 "of the regular marking start limit") 1136 DEFINE_INT(stress_scavenge, 0, 1137 "force scavenge at random points between 0 and X (inclusive) " 1138 "percent of the new space capacity") 1139 DEFINE_VALUE_IMPLICATION(fuzzer_gc_analysis, stress_marking, 99) 1140 DEFINE_VALUE_IMPLICATION(fuzzer_gc_analysis, stress_scavenge, 99) 1141 DEFINE_BOOL( 1142 reclaim_unmodified_wrappers, true, 1143 "reclaim otherwise unreachable unmodified wrapper objects when possible") 1144 1145 // These flags will be removed after experiments. Do not rely on them. 1146 DEFINE_BOOL(gc_experiment_background_schedule, false, 1147 "new background GC schedule heuristics") 1148 DEFINE_BOOL(gc_experiment_less_compaction, false, 1149 "less compaction in non-memory reducing mode") 1150 DEFINE_BOOL(gc_experiment_reduce_concurrent_marking_tasks, false, 1151 "reduce the number of concurrent marking tasks") 1152 1153 DEFINE_BOOL(disable_abortjs, false, "disables AbortJS runtime function") 1154 1155 DEFINE_BOOL(randomize_all_allocations, false, 1156 "randomize virtual memory reservations by ignoring any hints " 1157 "passed when allocating pages") 1158 1159 DEFINE_BOOL(manual_evacuation_candidates_selection, false, 1160 "Test mode only flag. It allows an unit test to select evacuation " 1161 "candidates pages (requires --stress_compaction).") 1162 DEFINE_BOOL(fast_promotion_new_space, false, 1163 "fast promote new space on high survival rates") 1164 1165 DEFINE_BOOL(clear_free_memory, false, "initialize free memory with 0") 1166 1167 DEFINE_BOOL_READONLY( 1168 young_generation_large_objects, true, 1169 "allocates large objects by default in the young generation large " 1170 "object space") 1171 1172 // assembler-ia32.cc / assembler-arm.cc / assembler-arm64.cc / assembler-x64.cc 1173 DEFINE_BOOL(debug_code, DEBUG_BOOL, 1174 "generate extra code (assertions) for debugging") 1175 DEFINE_BOOL(code_comments, false, 1176 "emit comments in code disassembly; for more readable source " 1177 "positions you should add --no-concurrent_recompilation") 1178 DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available") 1179 DEFINE_BOOL(enable_ssse3, true, "enable use of SSSE3 instructions if available") 1180 DEFINE_BOOL(enable_sse4_1, true, 1181 "enable use of SSE4.1 instructions if available") 1182 DEFINE_BOOL(enable_sse4_2, true, 1183 "enable use of SSE4.2 instructions if available") 1184 DEFINE_BOOL(enable_sahf, true, 1185 "enable use of SAHF instruction if available (X64 only)") 1186 DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available") 1187 DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available") 1188 DEFINE_BOOL(enable_bmi1, true, "enable use of BMI1 instructions if available") 1189 DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available") 1190 DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available") 1191 DEFINE_BOOL(enable_popcnt, true, 1192 "enable use of POPCNT instruction if available") 1193 DEFINE_STRING(arm_arch, ARM_ARCH_DEFAULT, 1194 "generate instructions for the selected ARM architecture if " 1195 "available: armv6, armv7, armv7+sudiv or armv8") 1196 DEFINE_BOOL(force_long_branches, false, 1197 "force all emitted branches to be in long mode (MIPS/PPC only)") 1198 DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu") 1199 DEFINE_BOOL(partial_constant_pool, true, 1200 "enable use of partial constant pools (X64 only)") 1201 DEFINE_STRING(sim_arm64_optional_features, "none", 1202 "enable optional features on the simulator for testing: none or " 1203 "all") 1204 1205 // Controlling source positions for Torque/CSA code. 1206 DEFINE_BOOL(enable_source_at_csa_bind, false, 1207 "Include source information in the binary at CSA bind locations.") 1208 1209 // Deprecated ARM flags (replaced by arm_arch). 1210 DEFINE_MAYBE_BOOL(enable_armv7, "deprecated (use --arm_arch instead)") 1211 DEFINE_MAYBE_BOOL(enable_vfp3, "deprecated (use --arm_arch instead)") 1212 DEFINE_MAYBE_BOOL(enable_32dregs, "deprecated (use --arm_arch instead)") 1213 DEFINE_MAYBE_BOOL(enable_neon, "deprecated (use --arm_arch instead)") 1214 DEFINE_MAYBE_BOOL(enable_sudiv, "deprecated (use --arm_arch instead)") 1215 DEFINE_MAYBE_BOOL(enable_armv8, "deprecated (use --arm_arch instead)") 1216 1217 // regexp-macro-assembler-*.cc 1218 DEFINE_BOOL(enable_regexp_unaligned_accesses, true, 1219 "enable unaligned accesses for the regexp engine") 1220 1221 // api.cc 1222 DEFINE_BOOL(script_streaming, true, "enable parsing on background") 1223 DEFINE_BOOL(stress_background_compile, false, 1224 "stress test parsing on background") 1225 DEFINE_BOOL( 1226 finalize_streaming_on_background, false, 1227 "perform the script streaming finalization on the background thread") 1228 DEFINE_BOOL(disable_old_api_accessors, false, 1229 "Disable old-style API accessors whose setters trigger through the " 1230 "prototype chain") 1231 1232 // bootstrapper.cc 1233 DEFINE_BOOL(expose_gc, false, "expose gc extension") 1234 DEFINE_STRING(expose_gc_as, nullptr, 1235 "expose gc extension under the specified name") 1236 DEFINE_IMPLICATION(expose_gc_as, expose_gc) 1237 DEFINE_BOOL(expose_externalize_string, false, 1238 "expose externalize string extension") 1239 DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension") 1240 DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture") 1241 DEFINE_BOOL(builtins_in_stack_traces, false, 1242 "show built-in functions in stack traces") 1243 DEFINE_BOOL(experimental_stack_trace_frames, false, 1244 "enable experimental frames (API/Builtins) and stack trace layout") 1245 DEFINE_BOOL(disallow_code_generation_from_strings, false, 1246 "disallow eval and friends") 1247 DEFINE_BOOL(expose_async_hooks, false, "expose async_hooks object") 1248 DEFINE_STRING(expose_cputracemark_as, nullptr, 1249 "expose cputracemark extension under the specified name") 1250 #ifdef ENABLE_VTUNE_TRACEMARK 1251 DEFINE_BOOL(enable_vtune_domain_support, true, "enable vtune domain support") 1252 #endif // ENABLE_VTUNE_TRACEMARK 1253 1254 // builtins.cc 1255 DEFINE_BOOL(allow_unsafe_function_constructor, false, 1256 "allow invoking the function constructor without security checks") 1257 DEFINE_BOOL(force_slow_path, false, "always take the slow path for builtins") 1258 DEFINE_BOOL(test_small_max_function_context_stub_size, false, 1259 "enable testing the function context size overflow path " 1260 "by making the maximum size smaller") 1261 1262 DEFINE_BOOL(inline_new, true, "use fast inline allocation") 1263 DEFINE_NEG_NEG_IMPLICATION(inline_new, turbo_allocation_folding) 1264 1265 // codegen-ia32.cc / codegen-arm.cc 1266 DEFINE_BOOL(trace, false, "trace javascript function calls") 1267 DEFINE_BOOL(trace_wasm, false, "trace wasm function calls") 1268 1269 // codegen.cc 1270 DEFINE_BOOL(lazy, true, "use lazy compilation") 1271 DEFINE_BOOL(max_lazy, false, "ignore eager compilation hints") 1272 DEFINE_IMPLICATION(max_lazy, lazy) 1273 DEFINE_BOOL(trace_opt, false, "trace optimized compilation") 1274 DEFINE_BOOL(trace_opt_verbose, false, 1275 "extra verbose optimized compilation tracing") 1276 DEFINE_IMPLICATION(trace_opt_verbose, trace_opt) 1277 DEFINE_BOOL(trace_opt_stats, false, "trace optimized compilation statistics") 1278 DEFINE_BOOL(trace_deopt, false, "trace deoptimization") 1279 DEFINE_BOOL(trace_deopt_verbose, false, "extra verbose deoptimization tracing") 1280 DEFINE_IMPLICATION(trace_deopt_verbose, trace_deopt) 1281 DEFINE_BOOL(trace_file_names, false, 1282 "include file names in trace-opt/trace-deopt output") 1283 DEFINE_BOOL(always_opt, false, "always try to optimize functions") 1284 DEFINE_BOOL(always_osr, false, "always try to OSR functions") 1285 DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt") 1286 1287 DEFINE_BOOL(trace_serializer, false, "print code serializer trace") 1288 #ifdef DEBUG 1289 DEFINE_BOOL(external_reference_stats, false, 1290 "print statistics on external references used during serialization") 1291 #endif // DEBUG 1292 1293 // compilation-cache.cc 1294 DEFINE_BOOL(compilation_cache, true, "enable compilation cache") 1295 1296 DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions") 1297 1298 // compiler-dispatcher.cc 1299 DEFINE_BOOL(parallel_compile_tasks, false, "enable parallel compile tasks") 1300 DEFINE_BOOL(compiler_dispatcher, false, "enable compiler dispatcher") 1301 DEFINE_IMPLICATION(parallel_compile_tasks, compiler_dispatcher) 1302 DEFINE_BOOL(trace_compiler_dispatcher, false, 1303 "trace compiler dispatcher activity") 1304 1305 // cpu-profiler.cc 1306 DEFINE_INT(cpu_profiler_sampling_interval, 1000, 1307 "CPU profiler sampling interval in microseconds") 1308 1309 // debugger 1310 DEFINE_BOOL( 1311 trace_side_effect_free_debug_evaluate, false, 1312 "print debug messages for side-effect-free debug-evaluate for testing") 1313 DEFINE_BOOL(hard_abort, true, "abort by crashing") 1314 1315 // inspector 1316 DEFINE_BOOL(expose_inspector_scripts, false, 1317 "expose injected-script-source.js for debugging") 1318 1319 // execution.cc 1320 DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB, 1321 "default size of stack region v8 is allowed to use (in kBytes)") 1322 1323 // frames.cc 1324 DEFINE_INT(max_stack_trace_source_length, 300, 1325 "maximum length of function source code printed in a stack trace.") 1326 1327 // execution.cc, messages.cc 1328 DEFINE_BOOL(clear_exceptions_on_js_entry, false, 1329 "clear pending exceptions when entering JavaScript") 1330 1331 // counters.cc 1332 DEFINE_INT(histogram_interval, 600000, 1333 "time interval in ms for aggregating memory histograms") 1334 1335 // heap-snapshot-generator.cc 1336 DEFINE_BOOL(heap_profiler_trace_objects, false, 1337 "Dump heap object allocations/movements/size_updates") 1338 DEFINE_BOOL(heap_profiler_use_embedder_graph, true, 1339 "Use the new EmbedderGraph API to get embedder nodes") 1340 DEFINE_INT(heap_snapshot_string_limit, 1024, 1341 "truncate strings to this length in the heap snapshot") 1342 1343 // sampling-heap-profiler.cc 1344 DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false, 1345 "Use constant sample intervals to eliminate test flakiness") 1346 1347 // v8.cc 1348 DEFINE_BOOL(use_idle_notification, true, 1349 "Use idle notification to reduce memory footprint.") 1350 // ic.cc 1351 DEFINE_BOOL(trace_ic, false, 1352 "trace inline cache state transitions for tools/ic-processor") 1353 DEFINE_IMPLICATION(trace_ic, log_code) 1354 DEFINE_GENERIC_IMPLICATION( 1355 trace_ic, TracingFlags::ic_stats.store( 1356 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1357 DEFINE_BOOL_READONLY(fast_map_update, false, 1358 "enable fast map update by caching the migration target") 1359 DEFINE_BOOL(modify_field_representation_inplace, true, 1360 "enable in-place field representation updates") 1361 DEFINE_INT(max_valid_polymorphic_map_count, 4, 1362 "maximum number of valid maps to track in POLYMORPHIC state") 1363 1364 DEFINE_BOOL(native_code_counters, DEBUG_BOOL, 1365 "generate extra code for manipulating stats counters") 1366 1367 DEFINE_BOOL(super_ic, false, "use an IC for super property loads") 1368 1369 // objects.cc 1370 DEFINE_BOOL(thin_strings, true, "Enable ThinString support") 1371 DEFINE_BOOL(trace_prototype_users, false, 1372 "Trace updates to prototype user tracking") 1373 DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths") 1374 DEFINE_BOOL(trace_maps, false, "trace map creation") 1375 DEFINE_BOOL(trace_maps_details, true, "also log map details") 1376 DEFINE_IMPLICATION(trace_maps, log_code) 1377 1378 // parser.cc 1379 DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax") 1380 DEFINE_BOOL(allow_natives_for_differential_fuzzing, false, 1381 "allow only natives explicitly allowlisted for differential " 1382 "fuzzers") 1383 DEFINE_IMPLICATION(allow_natives_for_differential_fuzzing, allow_natives_syntax) 1384 DEFINE_IMPLICATION(allow_natives_for_differential_fuzzing, fuzzing) 1385 DEFINE_BOOL(parse_only, false, "only parse the sources") 1386 1387 // simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc 1388 DEFINE_BOOL(trace_sim, false, "Trace simulator execution") 1389 DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator") 1390 DEFINE_BOOL(check_icache, false, 1391 "Check icache flushes in ARM and MIPS simulator") 1392 DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions") 1393 #if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \ 1394 defined(V8_TARGET_ARCH_PPC64) 1395 DEFINE_INT(sim_stack_alignment, 16, 1396 "Stack alignment in bytes in simulator. This must be a power of two " 1397 "and it must be at least 16. 16 is default.") 1398 #else 1399 DEFINE_INT(sim_stack_alignment, 8, 1400 "Stack alingment in bytes in simulator (4 or 8, 8 is default)") 1401 #endif 1402 DEFINE_INT(sim_stack_size, 2 * MB / KB, 1403 "Stack size of the ARM64, MIPS, MIPS64 and PPC64 simulator " 1404 "in kBytes (default is 2 MB)") 1405 DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR, 1406 "When logging, try to use coloured output.") 1407 DEFINE_BOOL(trace_sim_messages, false, 1408 "Trace simulator debug messages. Implied by --trace-sim.") 1409 1410 #if defined V8_TARGET_ARCH_ARM64 1411 // pointer-auth-arm64.cc 1412 DEFINE_DEBUG_BOOL(sim_abort_on_bad_auth, false, 1413 "Stop execution when a pointer authentication fails in the " 1414 "ARM64 simulator.") 1415 #endif 1416 1417 // isolate.cc 1418 DEFINE_BOOL(async_stack_traces, true, 1419 "include async stack traces in Error.stack") 1420 DEFINE_BOOL(stack_trace_on_illegal, false, 1421 "print stack trace when an illegal exception is thrown") 1422 DEFINE_BOOL(abort_on_uncaught_exception, false, 1423 "abort program (dump core) when an uncaught exception is thrown") 1424 DEFINE_BOOL(correctness_fuzzer_suppressions, false, 1425 "Suppress certain unspecified behaviors to ease correctness " 1426 "fuzzing: Abort program when the stack overflows or a string " 1427 "exceeds maximum length (as opposed to throwing RangeError). " 1428 "Use a fixed suppression string for error messages.") 1429 DEFINE_BOOL(randomize_hashes, true, 1430 "randomize hashes to avoid predictable hash collisions " 1431 "(with snapshots this option cannot override the baked-in seed)") 1432 DEFINE_BOOL(rehash_snapshot, true, 1433 "rehash strings from the snapshot to override the baked-in seed") 1434 DEFINE_UINT64(hash_seed, 0, 1435 "Fixed seed to use to hash property keys (0 means random)" 1436 "(with snapshots this option cannot override the baked-in seed)") 1437 DEFINE_INT(random_seed, 0, 1438 "Default seed for initializing random generator " 1439 "(0, the default, means to use system random).") 1440 DEFINE_INT(fuzzer_random_seed, 0, 1441 "Default seed for initializing fuzzer random generator " 1442 "(0, the default, means to use v8's random number generator seed).") 1443 DEFINE_BOOL(trace_rail, false, "trace RAIL mode") 1444 DEFINE_BOOL(print_all_exceptions, false, 1445 "print exception object and stack trace on each thrown exception") 1446 DEFINE_BOOL( 1447 detailed_error_stack_trace, false, 1448 "includes arguments for each function call in the error stack frames array") 1449 DEFINE_BOOL(adjust_os_scheduling_parameters, true, 1450 "adjust OS specific scheduling params for the isolate") 1451 DEFINE_BOOL(experimental_flush_embedded_blob_icache, false, 1452 "Used in an experiment to evaluate icache flushing on certain CPUs") 1453 1454 // runtime.cc 1455 DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times") 1456 DEFINE_GENERIC_IMPLICATION( 1457 runtime_call_stats, 1458 TracingFlags::runtime_stats.store( 1459 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) 1460 DEFINE_BOOL(rcs, false, "report runtime call counts and times") 1461 DEFINE_IMPLICATION(rcs, runtime_call_stats) 1462 1463 DEFINE_BOOL(rcs_cpu_time, false, 1464 "report runtime times in cpu time (the default is wall time)") 1465 DEFINE_IMPLICATION(rcs_cpu_time, rcs) 1466 1467 // snapshot-common.cc 1468 DEFINE_BOOL(profile_deserialization, false, 1469 "Print the time it takes to deserialize the snapshot.") 1470 DEFINE_BOOL(serialization_statistics, false, 1471 "Collect statistics on serialized objects.") 1472 // Regexp 1473 DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code") 1474 DEFINE_BOOL(regexp_mode_modifiers, false, "enable inline flags in regexp.") 1475 DEFINE_BOOL(regexp_interpret_all, false, "interpret all regexp code") 1476 #ifdef V8_TARGET_BIG_ENDIAN 1477 #define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL false 1478 #else 1479 #define REGEXP_PEEPHOLE_OPTIMIZATION_BOOL true 1480 #endif 1481 DEFINE_BOOL(regexp_tier_up, true, 1482 "enable regexp interpreter and tier up to the compiler after the " 1483 "number of executions set by the tier up ticks flag") 1484 DEFINE_INT(regexp_tier_up_ticks, 1, 1485 "set the number of executions for the regexp interpreter before " 1486 "tiering-up to the compiler") 1487 DEFINE_BOOL(regexp_peephole_optimization, REGEXP_PEEPHOLE_OPTIMIZATION_BOOL, 1488 "enable peephole optimization for regexp bytecode") 1489 DEFINE_BOOL(trace_regexp_peephole_optimization, false, 1490 "trace regexp bytecode peephole optimization") 1491 DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution") 1492 DEFINE_BOOL(trace_regexp_assembler, false, 1493 "trace regexp macro assembler calls.") 1494 DEFINE_BOOL(trace_regexp_parser, false, "trace regexp parsing") 1495 DEFINE_BOOL(trace_regexp_tier_up, false, "trace regexp tiering up execution") 1496 1497 DEFINE_BOOL(enable_experimental_regexp_engine, false, 1498 "recognize regexps with 'l' flag, run them on experimental engine") 1499 DEFINE_BOOL(default_to_experimental_regexp_engine, false, 1500 "run regexps with the experimental engine where possible") 1501 DEFINE_IMPLICATION(default_to_experimental_regexp_engine, 1502 enable_experimental_regexp_engine) 1503 DEFINE_BOOL(trace_experimental_regexp_engine, false, 1504 "trace execution of experimental regexp engine") 1505 1506 DEFINE_BOOL(enable_experimental_regexp_engine_on_excessive_backtracks, false, 1507 "fall back to a breadth-first regexp engine on excessive " 1508 "backtracking") 1509 DEFINE_UINT(regexp_backtracks_before_fallback, 50000, 1510 "number of backtracks during regexp execution before fall back " 1511 "to experimental engine if " 1512 "enable_experimental_regexp_engine_on_excessive_backtracks is set") 1513 1514 // Testing flags test/cctest/test-{flags,api,serialization}.cc 1515 DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag") 1516 DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag") 1517 DEFINE_INT(testing_int_flag, 13, "testing_int_flag") 1518 DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag") 1519 DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag") 1520 DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness") 1521 1522 // Test flag for a check in %OptimizeFunctionOnNextCall 1523 DEFINE_BOOL( 1524 testing_d8_test_runner, false, 1525 "test runner turns on this flag to enable a check that the function was " 1526 "prepared for optimization before marking it for optimization") 1527 1528 DEFINE_BOOL( 1529 fuzzing, false, 1530 "Fuzzers use this flag to signal that they are ... fuzzing. This causes " 1531 "intrinsics to fail silently (e.g. return undefined) on invalid usage.") 1532 1533 // mksnapshot.cc 1534 DEFINE_STRING(embedded_src, nullptr, 1535 "Path for the generated embedded data file. (mksnapshot only)") 1536 DEFINE_STRING( 1537 embedded_variant, nullptr, 1538 "Label to disambiguate symbols in embedded data file. (mksnapshot only)") 1539 DEFINE_STRING(startup_src, nullptr, 1540 "Write V8 startup as C++ src. (mksnapshot only)") 1541 DEFINE_STRING(startup_blob, nullptr, 1542 "Write V8 startup blob file. (mksnapshot only)") 1543 DEFINE_STRING(target_arch, nullptr, 1544 "The mksnapshot target arch. (mksnapshot only)") 1545 DEFINE_STRING(target_os, nullptr, "The mksnapshot target os. (mksnapshot only)") 1546 DEFINE_BOOL(target_is_simulator, false, 1547 "Instruct mksnapshot that the target is meant to run in the " 1548 "simulator and it can generate simulator-specific instructions. " 1549 "(mksnapshot only)") 1550 DEFINE_STRING(turbo_profiling_log_file, nullptr, 1551 "Path of the input file containing basic block counters for " 1552 "builtins. (mksnapshot only)") 1553 1554 // On some platforms, the .text section only has execute permissions. 1555 DEFINE_BOOL(text_is_readable, true, 1556 "Whether the .text section of binary can be read") 1557 DEFINE_NEG_NEG_IMPLICATION(text_is_readable, partial_constant_pool) 1558 1559 // 1560 // Minor mark compact collector flags. 1561 // 1562 #ifdef ENABLE_MINOR_MC 1563 DEFINE_BOOL(minor_mc_parallel_marking, true, 1564 "use parallel marking for the young generation") 1565 DEFINE_BOOL(trace_minor_mc_parallel_marking, false, 1566 "trace parallel marking for the young generation") 1567 DEFINE_BOOL(minor_mc, false, "perform young generation mark compact GCs") 1568 #else 1569 DEFINE_BOOL_READONLY(minor_mc, false, 1570 "perform young generation mark compact GCs") 1571 #endif // ENABLE_MINOR_MC 1572 1573 // 1574 // Dev shell flags 1575 // 1576 1577 DEFINE_BOOL(help, false, "Print usage message, including flags, on console") 1578 DEFINE_BOOL(dump_counters, false, "Dump counters on exit") 1579 DEFINE_BOOL(dump_counters_nvp, false, 1580 "Dump counters as name-value pairs on exit") 1581 DEFINE_BOOL(use_external_strings, false, "Use external strings for source code") 1582 DEFINE_STRING(map_counters, "", "Map counters to a file") 1583 DEFINE_BOOL(mock_arraybuffer_allocator, false, 1584 "Use a mock ArrayBuffer allocator for testing.") 1585 DEFINE_SIZE_T(mock_arraybuffer_allocator_limit, 0, 1586 "Memory limit for mock ArrayBuffer allocator used to simulate " 1587 "OOM for testing.") 1588 #if V8_OS_LINUX 1589 DEFINE_BOOL(multi_mapped_mock_allocator, false, 1590 "Use a multi-mapped mock ArrayBuffer allocator for testing.") 1591 #endif 1592 1593 // Flags for Wasm GDB remote debugging. 1594 #ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING 1595 #define DEFAULT_WASM_GDB_REMOTE_PORT 8765 1596 DEFINE_BOOL(wasm_gdb_remote, false, 1597 "enable GDB-remote for WebAssembly debugging") 1598 DEFINE_NEG_IMPLICATION(wasm_gdb_remote, wasm_tier_up) 1599 DEFINE_INT(wasm_gdb_remote_port, DEFAULT_WASM_GDB_REMOTE_PORT, 1600 "default port for WebAssembly debugging with LLDB.") 1601 DEFINE_BOOL(wasm_pause_waiting_for_debugger, false, 1602 "pause at the first Webassembly instruction waiting for a debugger " 1603 "to attach") 1604 #endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING 1605 1606 // 1607 // GDB JIT integration flags. 1608 // 1609 #undef FLAG 1610 #ifdef ENABLE_GDB_JIT_INTERFACE 1611 #define FLAG FLAG_FULL 1612 #else 1613 #define FLAG FLAG_READONLY 1614 #endif 1615 1616 DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface") 1617 DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects") 1618 DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk") 1619 DEFINE_STRING(gdbjit_dump_filter, "", 1620 "dump only objects containing this substring") 1621 1622 #ifdef ENABLE_GDB_JIT_INTERFACE 1623 DEFINE_IMPLICATION(gdbjit_full, gdbjit) 1624 DEFINE_IMPLICATION(gdbjit_dump, gdbjit) 1625 #endif 1626 DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space) 1627 1628 // 1629 // Debug only flags 1630 // 1631 #undef FLAG 1632 #ifdef DEBUG 1633 #define FLAG FLAG_FULL 1634 #else 1635 #define FLAG FLAG_READONLY 1636 #endif 1637 1638 // checks.cc 1639 #ifdef ENABLE_SLOW_DCHECKS 1640 DEFINE_BOOL(enable_slow_asserts, true, 1641 "enable asserts that are slow to execute") 1642 #endif 1643 1644 // codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc 1645 DEFINE_BOOL(print_ast, false, "print source AST") 1646 DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints") 1647 1648 // compiler.cc 1649 DEFINE_BOOL(print_scopes, false, "print scopes") 1650 1651 // contexts.cc 1652 DEFINE_BOOL(trace_contexts, false, "trace contexts operations") 1653 1654 // heap.cc 1655 DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection") 1656 DEFINE_BOOL(code_stats, false, "report code statistics after GC") 1657 DEFINE_BOOL(print_handles, false, "report handles after GC") 1658 DEFINE_BOOL(check_handle_count, false, 1659 "Check that there are not too many handles at GC") 1660 DEFINE_BOOL(print_global_handles, false, "report global handles after GC") 1661 1662 // TurboFan debug-only flags. 1663 DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis") 1664 1665 // objects.cc 1666 DEFINE_BOOL(trace_module_status, false, 1667 "Trace status transitions of ECMAScript modules") 1668 DEFINE_BOOL(trace_normalization, false, 1669 "prints when objects are turned into dictionaries.") 1670 1671 // runtime.cc 1672 DEFINE_BOOL(trace_lazy, false, "trace lazy compilation") 1673 1674 // spaces.cc 1675 DEFINE_BOOL(collect_heap_spill_statistics, false, 1676 "report heap spill statistics along with heap_stats " 1677 "(requires heap_stats)") 1678 DEFINE_BOOL(trace_isolates, false, "trace isolate state changes") 1679 1680 // Regexp 1681 DEFINE_BOOL(regexp_possessive_quantifier, false, 1682 "enable possessive quantifier syntax for testing") 1683 1684 // Debugger 1685 DEFINE_BOOL(print_break_location, false, "print source location on debug break") 1686 1687 // wasm instance management 1688 DEFINE_DEBUG_BOOL(trace_wasm_instances, false, 1689 "trace creation and collection of wasm instances") 1690 1691 #ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING 1692 DEFINE_BOOL(trace_wasm_gdb_remote, false, "trace Webassembly GDB-remote server") 1693 #endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING 1694 1695 // 1696 // Logging and profiling flags 1697 // 1698 #undef FLAG 1699 #define FLAG FLAG_FULL 1700 1701 // log.cc 1702 DEFINE_STRING(logfile, "v8.log", 1703 "Specify the name of the log file, use '-' for console, '+' for " 1704 "a temporary file.") 1705 DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.") 1706 1707 DEFINE_BOOL(log, false, 1708 "Minimal logging (no API, code, GC, suspect, or handles samples).") 1709 DEFINE_BOOL(log_all, false, "Log all events to the log file.") 1710 DEFINE_BOOL(log_api, false, "Log API events to the log file.") 1711 DEFINE_BOOL(log_code, false, 1712 "Log code events to the log file without profiling.") 1713 DEFINE_BOOL(log_handles, false, "Log global handle events.") 1714 DEFINE_BOOL(log_suspect, false, "Log suspect operations.") 1715 DEFINE_BOOL(log_source_code, false, "Log source code.") 1716 DEFINE_BOOL(log_function_events, false, 1717 "Log function events " 1718 "(parse, compile, execute) separately.") 1719 1720 DEFINE_IMPLICATION(log_all, log_api) 1721 DEFINE_IMPLICATION(log_all, log_code) 1722 DEFINE_IMPLICATION(log_all, log_suspect) 1723 DEFINE_IMPLICATION(log_all, log_handles) 1724 DEFINE_IMPLICATION(log_all, log_internal_timer_events) 1725 DEFINE_IMPLICATION(log_all, log_function_events) 1726 1727 DEFINE_BOOL(detailed_line_info, false, 1728 "Always generate detailed line information for CPU profiling.") 1729 1730 #if defined(ANDROID) 1731 // Phones and tablets have processors that are much slower than desktop 1732 // and laptop computers for which current heuristics are tuned. 1733 #define DEFAULT_PROF_SAMPLING_INTERVAL 5000 1734 #else 1735 #define DEFAULT_PROF_SAMPLING_INTERVAL 1000 1736 #endif 1737 DEFINE_INT(prof_sampling_interval, DEFAULT_PROF_SAMPLING_INTERVAL, 1738 "Interval for --prof samples (in microseconds).") 1739 #undef DEFAULT_PROF_SAMPLING_INTERVAL 1740 1741 DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.") 1742 DEFINE_BOOL(prof_browser_mode, true, 1743 "Used with --prof, turns on browser-compatible mode for profiling.") 1744 1745 DEFINE_BOOL(prof, false, 1746 "Log statistical profiling information (implies --log-code).") 1747 DEFINE_IMPLICATION(prof, prof_cpp) 1748 DEFINE_IMPLICATION(prof, log_code) 1749 1750 DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.") 1751 1752 #if V8_OS_LINUX 1753 #define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL(nam, false, cmt) 1754 #define DEFINE_PERF_PROF_IMPLICATION DEFINE_IMPLICATION 1755 #else 1756 #define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL_READONLY(nam, false, cmt) 1757 #define DEFINE_PERF_PROF_IMPLICATION(...) 1758 #endif 1759 1760 DEFINE_PERF_PROF_BOOL(perf_basic_prof, 1761 "Enable perf linux profiler (basic support).") 1762 DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space) 1763 DEFINE_PERF_PROF_BOOL( 1764 perf_basic_prof_only_functions, 1765 "Only report function code ranges to perf (i.e. no stubs).") 1766 DEFINE_PERF_PROF_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof) 1767 DEFINE_PERF_PROF_BOOL( 1768 perf_prof, "Enable perf linux profiler (experimental annotate support).") 1769 DEFINE_PERF_PROF_BOOL( 1770 perf_prof_annotate_wasm, 1771 "Used with --perf-prof, load wasm source map and provide annotate " 1772 "support (experimental).") 1773 DEFINE_PERF_PROF_BOOL( 1774 perf_prof_delete_file, 1775 "Remove the perf file right after creating it (for testing only).") 1776 DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space) 1777 // TODO(v8:8462) Remove implication once perf supports remapping. 1778 DEFINE_NEG_IMPLICATION(perf_prof, write_protect_code_memory) 1779 DEFINE_NEG_IMPLICATION(perf_prof, wasm_write_protect_code_memory) 1780 1781 // --perf-prof-unwinding-info is available only on selected architectures. 1782 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \ 1783 !V8_TARGET_ARCH_S390X && !V8_TARGET_ARCH_PPC64 1784 #undef DEFINE_PERF_PROF_BOOL 1785 #define DEFINE_PERF_PROF_BOOL(nam, cmt) DEFINE_BOOL_READONLY(nam, false, cmt) 1786 #undef DEFINE_PERF_PROF_IMPLICATION 1787 #define DEFINE_PERF_PROF_IMPLICATION(...) 1788 #endif 1789 1790 DEFINE_PERF_PROF_BOOL( 1791 perf_prof_unwinding_info, 1792 "Enable unwinding info for perf linux profiler (experimental).") 1793 DEFINE_PERF_PROF_IMPLICATION(perf_prof, perf_prof_unwinding_info) 1794 1795 #undef DEFINE_PERF_PROF_BOOL 1796 #undef DEFINE_PERF_PROF_IMPLICATION 1797 1798 DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__", 1799 "Specify the name of the file for fake gc mmap used in ll_prof") 1800 DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.") 1801 DEFINE_IMPLICATION(log_internal_timer_events, prof) 1802 1803 DEFINE_BOOL(redirect_code_traces, false, 1804 "output deopt information and disassembly into file " 1805 "code-<pid>-<isolate id>.asm") 1806 DEFINE_STRING(redirect_code_traces_to, nullptr, 1807 "output deopt information and disassembly into the given file") 1808 1809 DEFINE_BOOL(print_opt_source, false, 1810 "print source code of optimized and inlined functions") 1811 1812 DEFINE_BOOL(vtune_prof_annotate_wasm, false, 1813 "Used when v8_enable_vtunejit is enabled, load wasm source map and " 1814 "provide annotate support (experimental).") 1815 1816 DEFINE_BOOL(win64_unwinding_info, true, "Enable unwinding info for Windows/x64") 1817 1818 #ifdef V8_TARGET_ARCH_ARM 1819 // Unsupported on arm. See https://crbug.com/v8/8713. 1820 DEFINE_BOOL_READONLY( 1821 interpreted_frames_native_stack, false, 1822 "Show interpreted frames on the native stack (useful for external " 1823 "profilers).") 1824 #else 1825 DEFINE_BOOL(interpreted_frames_native_stack, false, 1826 "Show interpreted frames on the native stack (useful for external " 1827 "profilers).") 1828 #endif 1829 1830 // 1831 // Disassembler only flags 1832 // 1833 #undef FLAG 1834 #ifdef ENABLE_DISASSEMBLER 1835 #define FLAG FLAG_FULL 1836 #else 1837 #define FLAG FLAG_READONLY 1838 #endif 1839 1840 // elements.cc 1841 DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions") 1842 1843 DEFINE_BOOL(trace_creation_allocation_sites, false, 1844 "trace the creation of allocation sites") 1845 1846 DEFINE_BOOL(print_code, false, "print generated code") 1847 DEFINE_BOOL(print_opt_code, false, "print optimized code") 1848 DEFINE_STRING(print_opt_code_filter, "*", "filter for printing optimized code") 1849 DEFINE_BOOL(print_code_verbose, false, "print more information for code") 1850 DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins") 1851 DEFINE_STRING(print_builtin_code_filter, "*", 1852 "filter for printing builtin code") 1853 DEFINE_BOOL(print_regexp_code, false, "print generated regexp code") 1854 DEFINE_BOOL(print_regexp_bytecode, false, "print generated regexp bytecode") 1855 DEFINE_BOOL(print_builtin_size, false, "print code size for builtins") 1856 1857 #ifdef ENABLE_DISASSEMBLER 1858 DEFINE_BOOL(sodium, false, 1859 "print generated code output suitable for use with " 1860 "the Sodium code viewer") 1861 1862 DEFINE_IMPLICATION(sodium, print_code) 1863 DEFINE_IMPLICATION(sodium, print_opt_code) 1864 DEFINE_IMPLICATION(sodium, code_comments) 1865 1866 DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code") 1867 DEFINE_IMPLICATION(print_all_code, print_code) 1868 DEFINE_IMPLICATION(print_all_code, print_opt_code) 1869 DEFINE_IMPLICATION(print_all_code, print_code_verbose) 1870 DEFINE_IMPLICATION(print_all_code, print_builtin_code) 1871 DEFINE_IMPLICATION(print_all_code, print_regexp_code) 1872 DEFINE_IMPLICATION(print_all_code, code_comments) 1873 #endif 1874 1875 #undef FLAG 1876 #define FLAG FLAG_FULL 1877 1878 // 1879 // Predictable mode related flags. 1880 // 1881 1882 DEFINE_BOOL(predictable, false, "enable predictable mode") 1883 DEFINE_IMPLICATION(predictable, single_threaded) 1884 DEFINE_NEG_IMPLICATION(predictable, memory_reducer) 1885 DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0) 1886 DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation) 1887 1888 DEFINE_BOOL(predictable_gc_schedule, false, 1889 "Predictable garbage collection schedule. Fixes heap growing, " 1890 "idle, and memory reducing behavior.") 1891 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, min_semi_space_size, 4) 1892 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, max_semi_space_size, 4) 1893 DEFINE_VALUE_IMPLICATION(predictable_gc_schedule, heap_growing_percent, 30) 1894 DEFINE_NEG_IMPLICATION(predictable_gc_schedule, memory_reducer) 1895 1896 // 1897 // Threading related flags. 1898 // 1899 1900 DEFINE_BOOL(single_threaded, false, "disable the use of background tasks") 1901 DEFINE_IMPLICATION(single_threaded, single_threaded_gc) 1902 DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation) 1903 DEFINE_NEG_IMPLICATION(single_threaded, compiler_dispatcher) 1904 1905 // 1906 // Parallel and concurrent GC (Orinoco) related flags. 1907 // 1908 DEFINE_BOOL(single_threaded_gc, false, "disable the use of background gc tasks") 1909 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_marking) 1910 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_sweeping) 1911 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_compaction) 1912 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_marking) 1913 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_pointer_update) 1914 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_scavenge) 1915 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_store_buffer) 1916 #ifdef ENABLE_MINOR_MC 1917 DEFINE_NEG_IMPLICATION(single_threaded_gc, minor_mc_parallel_marking) 1918 #endif // ENABLE_MINOR_MC 1919 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_array_buffer_sweeping) 1920 1921 #undef FLAG 1922 1923 #ifdef VERIFY_PREDICTABLE 1924 #define FLAG FLAG_FULL 1925 #else 1926 #define FLAG FLAG_READONLY 1927 #endif 1928 1929 DEFINE_BOOL(verify_predictable, false, 1930 "this mode is used for checking that V8 behaves predictably") 1931 DEFINE_INT(dump_allocations_digest_at_alloc, -1, 1932 "dump allocations digest each n-th allocation") 1933 1934 // 1935 // Read-only flags 1936 // 1937 #undef FLAG 1938 #define FLAG FLAG_READONLY 1939 1940 // assembler.h 1941 DEFINE_BOOL(enable_embedded_constant_pool, V8_EMBEDDED_CONSTANT_POOL, 1942 "enable use of embedded constant pools (PPC only)") 1943 1944 DEFINE_BOOL(unbox_double_fields, V8_DOUBLE_FIELDS_UNBOXING, 1945 "enable in-object double fields unboxing (64-bit only)") 1946 DEFINE_IMPLICATION(unbox_double_fields, track_double_fields) 1947 1948 // Cleanup... 1949 #undef FLAG_FULL 1950 #undef FLAG_READONLY 1951 #undef FLAG 1952 #undef FLAG_ALIAS 1953 1954 #undef DEFINE_BOOL 1955 #undef DEFINE_MAYBE_BOOL 1956 #undef DEFINE_DEBUG_BOOL 1957 #undef DEFINE_INT 1958 #undef DEFINE_STRING 1959 #undef DEFINE_FLOAT 1960 #undef DEFINE_IMPLICATION 1961 #undef DEFINE_WEAK_IMPLICATION 1962 #undef DEFINE_NEG_IMPLICATION 1963 #undef DEFINE_NEG_VALUE_IMPLICATION 1964 #undef DEFINE_VALUE_IMPLICATION 1965 #undef DEFINE_WEAK_VALUE_IMPLICATION 1966 #undef DEFINE_GENERIC_IMPLICATION 1967 #undef DEFINE_ALIAS_BOOL 1968 #undef DEFINE_ALIAS_INT 1969 #undef DEFINE_ALIAS_STRING 1970 #undef DEFINE_ALIAS_FLOAT 1971 1972 #undef FLAG_MODE_DECLARE 1973 #undef FLAG_MODE_DEFINE 1974 #undef FLAG_MODE_DEFINE_DEFAULTS 1975 #undef FLAG_MODE_META 1976 #undef FLAG_MODE_DEFINE_IMPLICATIONS 1977 #undef FLAG_MODE_APPLY 1978 1979 #undef COMMA 1980