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 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \ 19 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false) 20 21 #define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \ 22 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false) 23 24 // We want to declare the names of the variables for the header file. Normally 25 // this will just be an extern declaration, but for a readonly flag we let the 26 // compiler make better optimizations by giving it the value. 27 #if defined(FLAG_MODE_DECLARE) 28 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 29 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; 30 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 31 static constexpr ctype FLAG_##nam = def; 32 33 // We want to supply the actual storage and value for the flag variable in the 34 // .cc file. We only do this for writable flags. 35 #elif defined(FLAG_MODE_DEFINE) 36 #ifdef USING_V8_SHARED 37 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 38 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; 39 #else 40 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 41 V8_EXPORT_PRIVATE ctype FLAG_##nam = def; 42 #endif 43 44 // We need to define all of our default values so that the Flag structure can 45 // access them by pointer. These are just used internally inside of one .cc, 46 // for MODE_META, so there is no impact on the flags interface. 47 #elif defined(FLAG_MODE_DEFINE_DEFAULTS) 48 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 49 static constexpr ctype FLAGDEFAULT_##nam = def; 50 51 // We want to write entries into our meta data table, for internal parsing and 52 // printing / etc in the flag parser code. We only do this for writable flags. 53 #elif defined(FLAG_MODE_META) 54 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 55 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false } \ 56 , 57 #define FLAG_ALIAS(ftype, ctype, alias, nam) \ 58 { \ 59 Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \ 60 "alias for --" #nam, false \ 61 } \ 62 , 63 64 // We produce the code to set flags when it is implied by another flag. 65 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 66 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \ 67 if (FLAG_##whenflag) FLAG_##thenflag = value; 68 69 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \ 70 if (!FLAG_##whenflag) FLAG_##thenflag = value; 71 72 #else 73 #error No mode supplied when including flags.defs 74 #endif 75 76 // Dummy defines for modes where it is not relevant. 77 #ifndef FLAG_FULL 78 #define FLAG_FULL(ftype, ctype, nam, def, cmt) 79 #endif 80 81 #ifndef FLAG_READONLY 82 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 83 #endif 84 85 #ifndef FLAG_ALIAS 86 #define FLAG_ALIAS(ftype, ctype, alias, nam) 87 #endif 88 89 #ifndef DEFINE_VALUE_IMPLICATION 90 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) 91 #endif 92 93 #ifndef DEFINE_NEG_VALUE_IMPLICATION 94 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) 95 #endif 96 97 #define COMMA , 98 99 #ifdef FLAG_MODE_DECLARE 100 // Structure used to hold a collection of arguments to the JavaScript code. 101 struct JSArguments { 102 public: 103 inline const char*& operator[](int idx) const { return argv[idx]; } CreateJSArguments104 static JSArguments Create(int argc, const char** argv) { 105 JSArguments args; 106 args.argc = argc; 107 args.argv = argv; 108 return args; 109 } 110 int argc; 111 const char** argv; 112 }; 113 114 struct MaybeBoolFlag { CreateMaybeBoolFlag115 static MaybeBoolFlag Create(bool has_value, bool value) { 116 MaybeBoolFlag flag; 117 flag.has_value = has_value; 118 flag.value = value; 119 return flag; 120 } 121 bool has_value; 122 bool value; 123 }; 124 #endif 125 126 #ifdef DEBUG 127 #define DEBUG_BOOL true 128 #else 129 #define DEBUG_BOOL false 130 #endif 131 132 // Supported ARM configurations are: 133 // "armv6": ARMv6 + VFPv2 134 // "armv7": ARMv7 + VFPv3-D32 + NEON 135 // "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV 136 // "armv8": ARMv8 (including all of the above) 137 #if !defined(ARM_TEST_NO_FEATURE_PROBE) || \ 138 (defined(CAN_USE_ARMV8_INSTRUCTIONS) && \ 139 defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 140 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)) 141 #define ARM_ARCH_DEFAULT "armv8" 142 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \ 143 defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS) 144 #define ARM_ARCH_DEFAULT "armv7+sudiv" 145 #elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_NEON) && \ 146 defined(CAN_USE_VFP3_INSTRUCTIONS) 147 #define ARM_ARCH_DEFAULT "armv7" 148 #else 149 #define ARM_ARCH_DEFAULT "armv6" 150 #endif 151 152 #ifdef V8_OS_WIN 153 # define ENABLE_LOG_COLOUR false 154 #else 155 # define ENABLE_LOG_COLOUR true 156 #endif 157 158 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 159 #define DEFINE_BOOL_READONLY(nam, def, cmt) \ 160 FLAG_READONLY(BOOL, bool, nam, def, cmt) 161 #define DEFINE_MAYBE_BOOL(nam, cmt) \ 162 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt) 163 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 164 #define DEFINE_UINT(nam, def, cmt) FLAG(UINT, unsigned int, nam, def, cmt) 165 #define DEFINE_UINT64(nam, def, cmt) FLAG(UINT64, uint64_t, nam, def, cmt) 166 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 167 #define DEFINE_SIZE_T(nam, def, cmt) FLAG(SIZE_T, size_t, nam, def, cmt) 168 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 169 #define DEFINE_ARGS(nam, cmt) \ 170 FLAG(ARGS, JSArguments, nam, {0 COMMA nullptr}, cmt) 171 172 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) 173 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam) 174 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) 175 #define DEFINE_ALIAS_SIZE_T(alias, nam) FLAG_ALIAS(SIZE_T, size_t, alias, nam) 176 #define DEFINE_ALIAS_STRING(alias, nam) \ 177 FLAG_ALIAS(STRING, const char*, alias, nam) 178 #define DEFINE_ALIAS_ARGS(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam) 179 180 #ifdef DEBUG 181 #define DEFINE_DEBUG_BOOL DEFINE_BOOL 182 #else 183 #define DEFINE_DEBUG_BOOL DEFINE_BOOL_READONLY 184 #endif 185 186 // 187 // Flags in all modes. 188 // 189 #define FLAG FLAG_FULL 190 191 DEFINE_BOOL(experimental_extras, false, 192 "enable code compiled in via v8_experimental_extra_library_files") 193 194 // Flags for language modes and experimental language features. 195 DEFINE_BOOL(use_strict, false, "enforce strict mode") 196 197 DEFINE_BOOL(es_staging, false, 198 "enable test-worthy harmony features (for internal use only)") 199 DEFINE_BOOL(harmony, false, "enable all completed harmony features") 200 DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features") 201 DEFINE_IMPLICATION(es_staging, harmony) 202 // Enabling import.meta requires to also enable import() 203 DEFINE_IMPLICATION(harmony_import_meta, harmony_dynamic_import) 204 205 DEFINE_IMPLICATION(harmony_class_fields, harmony_public_fields) 206 DEFINE_IMPLICATION(harmony_class_fields, harmony_static_fields) 207 DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields) 208 209 // Update bootstrapper.cc whenever adding a new feature flag. 210 211 // Features that are still work in progress (behind individual flags). 212 #define HARMONY_INPROGRESS_BASE(V) \ 213 V(harmony_do_expressions, "harmony do-expressions") \ 214 V(harmony_class_fields, "harmony fields in class literals") \ 215 V(harmony_static_fields, "harmony static fields in class literals") \ 216 V(harmony_await_optimization, "harmony await taking 1 tick") 217 218 #ifdef V8_INTL_SUPPORT 219 #define HARMONY_INPROGRESS(V) \ 220 HARMONY_INPROGRESS_BASE(V) \ 221 V(harmony_locale, "Intl.Locale") \ 222 V(harmony_intl_list_format, "Intl.ListFormat") \ 223 V(harmony_intl_relative_time_format, "Intl.RelativeTimeFormat") 224 #else 225 #define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) 226 #endif 227 228 // Features that are complete (but still behind --harmony/es-staging flag). 229 #define HARMONY_STAGED(V) \ 230 V(harmony_public_fields, "harmony public fields in class literals") \ 231 V(harmony_private_fields, "harmony private fields in class literals") \ 232 V(harmony_numeric_separator, "harmony numeric separator between digits") \ 233 V(harmony_string_matchall, "harmony String.prototype.matchAll") \ 234 V(harmony_global, "harmony global") 235 236 // Features that are shipping (turned on by default, but internal flag remains). 237 #define HARMONY_SHIPPING(V) \ 238 V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \ 239 V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ 240 V(harmony_function_tostring, "harmony Function.prototype.toString") \ 241 V(harmony_import_meta, "harmony import.meta property") \ 242 V(harmony_bigint, "harmony arbitrary precision integers") \ 243 V(harmony_dynamic_import, "harmony dynamic import") \ 244 V(harmony_array_prototype_values, "harmony Array.prototype.values") \ 245 V(harmony_array_flat, "harmony Array.prototype.{flat,flatMap}") \ 246 V(harmony_symbol_description, "harmony Symbol.prototype.description") 247 248 // Once a shipping feature has proved stable in the wild, it will be dropped 249 // from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed, 250 // and associated tests are moved from the harmony directory to the appropriate 251 // esN directory. 252 253 254 #define FLAG_INPROGRESS_FEATURES(id, description) \ 255 DEFINE_BOOL(id, false, "enable " #description " (in progress)") 256 HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES) 257 #undef FLAG_INPROGRESS_FEATURES 258 259 #define FLAG_STAGED_FEATURES(id, description) \ 260 DEFINE_BOOL(id, false, "enable " #description) \ 261 DEFINE_IMPLICATION(harmony, id) 262 HARMONY_STAGED(FLAG_STAGED_FEATURES) 263 #undef FLAG_STAGED_FEATURES 264 265 #define FLAG_SHIPPING_FEATURES(id, description) \ 266 DEFINE_BOOL(id, true, "enable " #description) \ 267 DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id) 268 HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES) 269 #undef FLAG_SHIPPING_FEATURES 270 271 #ifdef V8_INTL_SUPPORT 272 DEFINE_BOOL(icu_timezone_data, true, "get information about timezones from ICU") 273 #endif 274 275 #ifdef V8_ENABLE_FUTURE 276 #define FUTURE_BOOL true 277 #else 278 #define FUTURE_BOOL false 279 #endif 280 DEFINE_BOOL(future, FUTURE_BOOL, 281 "Implies all staged features that we want to ship in the " 282 "not-too-far future") 283 284 DEFINE_IMPLICATION(future, write_protect_code_memory) 285 286 // Flags for experimental implementation features. 287 DEFINE_BOOL(allocation_site_pretenuring, true, 288 "pretenure with allocation sites") 289 DEFINE_BOOL(page_promotion, true, "promote pages based on utilization") 290 DEFINE_INT(page_promotion_threshold, 70, 291 "min percentage of live bytes on a page to enable fast evacuation") 292 DEFINE_BOOL(trace_pretenuring, false, 293 "trace pretenuring decisions of HAllocate instructions") 294 DEFINE_BOOL(trace_pretenuring_statistics, false, 295 "trace allocation site pretenuring statistics") 296 DEFINE_BOOL(track_fields, true, "track fields with only smi values") 297 DEFINE_BOOL(track_double_fields, true, "track fields with double values") 298 DEFINE_BOOL(track_heap_object_fields, true, "track fields with heap values") 299 DEFINE_BOOL(track_computed_fields, true, "track computed boilerplate fields") 300 DEFINE_IMPLICATION(track_double_fields, track_fields) 301 DEFINE_IMPLICATION(track_heap_object_fields, track_fields) 302 DEFINE_IMPLICATION(track_computed_fields, track_fields) 303 DEFINE_BOOL(track_field_types, true, "track field types") 304 DEFINE_IMPLICATION(track_field_types, track_fields) 305 DEFINE_IMPLICATION(track_field_types, track_heap_object_fields) 306 DEFINE_BOOL(trace_block_coverage, false, 307 "trace collected block coverage information") 308 DEFINE_BOOL(feedback_normalization, false, 309 "feed back normalization to constructors") 310 // TODO(jkummerow): This currently adds too much load on the stub cache. 311 DEFINE_BOOL_READONLY(internalize_on_the_fly, true, 312 "internalize string keys for generic keyed ICs on the fly") 313 314 // Flags for optimization types. 315 DEFINE_BOOL(optimize_for_size, false, 316 "Enables optimizations which favor memory size over execution " 317 "speed") 318 319 // Flag for one shot optimiztions. 320 DEFINE_BOOL(enable_one_shot_optimization, true, 321 "Enable size optimizations for the code that will " 322 "only be executed once") 323 324 DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1) 325 326 // Flags for data representation optimizations 327 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles") 328 DEFINE_BOOL_READONLY(string_slices, true, "use string slices") 329 330 // Flags for Ignition for no-snapshot builds. 331 #undef FLAG 332 #ifndef V8_USE_SNAPSHOT 333 #define FLAG FLAG_FULL 334 #else 335 #define FLAG FLAG_READONLY 336 #endif 337 DEFINE_INT(interrupt_budget, 144 * KB, 338 "interrupt budget which should be used for the profiler counter") 339 #undef FLAG 340 #define FLAG FLAG_FULL 341 342 // Flags for Ignition. 343 DEFINE_BOOL(ignition_elide_noneffectful_bytecodes, true, 344 "elide bytecodes which won't have any external effect") 345 DEFINE_BOOL(ignition_reo, true, "use ignition register equivalence optimizer") 346 DEFINE_BOOL(ignition_filter_expression_positions, true, 347 "filter expression positions before the bytecode pipeline") 348 DEFINE_BOOL(ignition_share_named_property_feedback, true, 349 "share feedback slots when loading the same named property from " 350 "the same object") 351 DEFINE_BOOL(print_bytecode, false, 352 "print bytecode generated by ignition interpreter") 353 DEFINE_STRING(print_bytecode_filter, "*", 354 "filter for selecting which functions to print bytecode") 355 #ifdef V8_TRACE_IGNITION 356 DEFINE_BOOL(trace_ignition, false, 357 "trace the bytecodes executed by the ignition interpreter") 358 #endif 359 #ifdef V8_TRACE_FEEDBACK_UPDATES 360 DEFINE_BOOL( 361 trace_feedback_updates, false, 362 "trace updates to feedback vectors during ignition interpreter execution.") 363 #endif 364 DEFINE_BOOL(trace_ignition_codegen, false, 365 "trace the codegen of ignition interpreter bytecode handlers") 366 DEFINE_BOOL(trace_ignition_dispatches, false, 367 "traces the dispatches to bytecode handlers by the ignition " 368 "interpreter") 369 DEFINE_STRING(trace_ignition_dispatches_output_file, nullptr, 370 "the file to which the bytecode handler dispatch table is " 371 "written (by default, the table is not written to a file)") 372 373 DEFINE_BOOL(fast_math, true, "faster (but maybe less accurate) math functions") 374 DEFINE_BOOL(trace_track_allocation_sites, false, 375 "trace the tracking of allocation sites") 376 DEFINE_BOOL(trace_migration, false, "trace object migration") 377 DEFINE_BOOL(trace_generalization, false, "trace map generalization") 378 379 // Flags for concurrent recompilation. 380 DEFINE_BOOL(concurrent_recompilation, true, 381 "optimizing hot functions asynchronously on a separate thread") 382 DEFINE_BOOL(trace_concurrent_recompilation, false, 383 "track concurrent recompilation") 384 DEFINE_INT(concurrent_recompilation_queue_length, 8, 385 "the length of the concurrent compilation queue") 386 DEFINE_INT(concurrent_recompilation_delay, 0, 387 "artificial compilation delay in ms") 388 DEFINE_BOOL(block_concurrent_recompilation, false, 389 "block queued jobs until released") 390 DEFINE_BOOL(concurrent_compiler_frontend, false, 391 "run optimizing compiler's frontend phases on a separate thread") 392 DEFINE_IMPLICATION(future, concurrent_compiler_frontend) 393 DEFINE_BOOL(strict_heap_broker, false, "fail on incomplete serialization") 394 DEFINE_BOOL(trace_heap_broker, false, "trace the heap broker") 395 396 // Flags for stress-testing the compiler. 397 DEFINE_INT(stress_runs, 0, "number of stress runs") 398 DEFINE_INT(deopt_every_n_times, 0, 399 "deoptimize every n times a deopt point is passed") 400 DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points") 401 402 // Flags for TurboFan. 403 DEFINE_BOOL(turbo_sp_frame_access, false, 404 "use stack pointer-relative access to frame wherever possible") 405 DEFINE_BOOL(turbo_preprocess_ranges, true, 406 "run pre-register allocation heuristics") 407 DEFINE_STRING(turbo_filter, "*", "optimization filter for TurboFan compiler") 408 DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR") 409 DEFINE_STRING(trace_turbo_path, nullptr, 410 "directory to dump generated TurboFan IR to") 411 DEFINE_STRING(trace_turbo_filter, "*", 412 "filter for tracing turbofan compilation") 413 DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs") 414 DEFINE_BOOL(trace_turbo_scheduled, false, "trace TurboFan IR with schedule") 415 DEFINE_IMPLICATION(trace_turbo_scheduled, trace_turbo_graph) 416 DEFINE_STRING(trace_turbo_cfg_file, nullptr, 417 "trace turbo cfg graph (for C1 visualizer) to a given file name") 418 DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types") 419 DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler") 420 DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers") 421 DEFINE_BOOL(trace_turbo_trimming, false, "trace TurboFan's graph trimmer") 422 DEFINE_BOOL(trace_turbo_jt, false, "trace TurboFan's jump threading") 423 DEFINE_BOOL(trace_turbo_ceq, false, "trace TurboFan's control equivalence") 424 DEFINE_BOOL(trace_turbo_loop, false, "trace TurboFan's loop optimizations") 425 DEFINE_BOOL(trace_alloc, false, "trace register allocator") 426 DEFINE_BOOL(trace_all_uses, false, "trace all use positions") 427 DEFINE_BOOL(trace_representation, false, "trace representation types") 428 DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase") 429 DEFINE_STRING(turbo_verify_machine_graph, nullptr, 430 "verify TurboFan machine graph before instruction selection") 431 #ifdef ENABLE_VERIFY_CSA 432 DEFINE_BOOL(verify_csa, DEBUG_BOOL, 433 "verify TurboFan machine graph of code stubs") 434 #else 435 // Define the flag as read-only-false so that code still compiles even in the 436 // non-ENABLE_VERIFY_CSA configuration. 437 DEFINE_BOOL_READONLY(verify_csa, false, 438 "verify TurboFan machine graph of code stubs") 439 #endif 440 DEFINE_BOOL(trace_verify_csa, false, "trace code stubs verification") 441 DEFINE_STRING(csa_trap_on_node, nullptr, 442 "trigger break point when a node with given id is created in " 443 "given stub. The format is: StubName,NodeId") 444 DEFINE_BOOL_READONLY(fixed_array_bounds_checks, DEBUG_BOOL, 445 "enable FixedArray bounds checks") 446 DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics") 447 DEFINE_BOOL(turbo_stats_nvp, false, 448 "print TurboFan statistics in machine-readable format") 449 DEFINE_BOOL(turbo_stats_wasm, false, 450 "print TurboFan statistics of wasm compilations") 451 DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan") 452 DEFINE_BOOL(function_context_specialization, false, 453 "enable function context specialization in TurboFan") 454 DEFINE_BOOL(turbo_inlining, true, "enable inlining in TurboFan") 455 DEFINE_INT(max_inlined_bytecode_size, 500, 456 "maximum size of bytecode for a single inlining") 457 DEFINE_INT(max_inlined_bytecode_size_cumulative, 1000, 458 "maximum cumulative size of bytecode considered for inlining") 459 DEFINE_INT(max_inlined_bytecode_size_absolute, 5000, 460 "maximum cumulative size of bytecode considered for inlining") 461 DEFINE_FLOAT(reserve_inline_budget_scale_factor, 1.2, 462 "maximum cumulative size of bytecode considered for inlining") 463 DEFINE_INT(max_inlined_bytecode_size_small, 30, 464 "maximum size of bytecode considered for small function inlining") 465 DEFINE_FLOAT(min_inlining_frequency, 0.15, "minimum frequency for inlining") 466 DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining") 467 DEFINE_BOOL(stress_inline, false, 468 "set high thresholds for inlining to inline as much as possible") 469 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size, 999999) 470 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_cumulative, 471 999999) 472 DEFINE_VALUE_IMPLICATION(stress_inline, max_inlined_bytecode_size_absolute, 473 999999) 474 DEFINE_VALUE_IMPLICATION(stress_inline, min_inlining_frequency, 0) 475 DEFINE_VALUE_IMPLICATION(stress_inline, polymorphic_inlining, true) 476 DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining") 477 DEFINE_BOOL(inline_accessors, true, "inline JavaScript accessors") 478 DEFINE_BOOL(inline_into_try, true, "inline into try blocks") 479 DEFINE_BOOL(turbo_inline_array_builtins, true, 480 "inline array builtins in TurboFan code") 481 DEFINE_BOOL(use_osr, true, "use on-stack replacement") 482 DEFINE_BOOL(trace_osr, false, "trace on-stack replacement") 483 DEFINE_BOOL(analyze_environment_liveness, true, 484 "analyze liveness of environment slots and zap dead values") 485 DEFINE_BOOL(trace_environment_liveness, false, 486 "trace liveness of local variable slots") 487 DEFINE_BOOL(turbo_load_elimination, true, "enable load elimination in TurboFan") 488 DEFINE_BOOL(trace_turbo_load_elimination, false, 489 "trace TurboFan load elimination") 490 DEFINE_BOOL(turbo_profiling, false, "enable profiling in TurboFan") 491 DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL, 492 "verify register allocation in TurboFan") 493 DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan") 494 DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan") 495 DEFINE_BOOL(turbo_loop_peeling, true, "Turbofan loop peeling") 496 DEFINE_BOOL(turbo_loop_variable, true, "Turbofan loop variable optimization") 497 DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan") 498 DEFINE_BOOL(turbo_escape, true, "enable escape analysis") 499 DEFINE_BOOL(turbo_allocation_folding, true, "Turbofan allocation folding") 500 DEFINE_BOOL(turbo_instruction_scheduling, false, 501 "enable instruction scheduling in TurboFan") 502 DEFINE_BOOL(turbo_stress_instruction_scheduling, false, 503 "randomly schedule instructions to stress dependency tracking") 504 DEFINE_BOOL(turbo_store_elimination, true, 505 "enable store-store elimination in TurboFan") 506 DEFINE_BOOL(trace_store_elimination, false, "trace store elimination") 507 DEFINE_BOOL(turbo_rewrite_far_jumps, true, 508 "rewrite far to near jumps (ia32,x64)") 509 DEFINE_BOOL(experimental_inline_promise_constructor, true, 510 "inline the Promise constructor in TurboFan") 511 512 #ifdef DISABLE_UNTRUSTED_CODE_MITIGATIONS 513 #define V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS false 514 #else 515 #define V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS true 516 #endif 517 DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS, 518 "Enable mitigations for executing untrusted code") 519 #undef V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS 520 521 DEFINE_BOOL(branch_load_poisoning, false, "Mask loads with branch conditions.") 522 DEFINE_IMPLICATION(future, branch_load_poisoning) 523 524 // Flags to help platform porters 525 DEFINE_BOOL(minimal, false, 526 "simplifies execution model to make porting " 527 "easier (e.g. always use Ignition, never optimize)") 528 DEFINE_NEG_IMPLICATION(minimal, opt) 529 DEFINE_NEG_IMPLICATION(minimal, use_ic) 530 531 // Flags for native WebAssembly. 532 DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript") 533 DEFINE_BOOL(assume_asmjs_origin, false, 534 "force wasm decoder to assume input is internal asm-wasm format") 535 DEFINE_BOOL(wasm_disable_structured_cloning, false, 536 "disable wasm structured cloning") 537 DEFINE_INT(wasm_num_compilation_tasks, 10, 538 "number of parallel compilation tasks for wasm") 539 DEFINE_DEBUG_BOOL(wasm_trace_native_heap, false, 540 "trace wasm native heap events") 541 DEFINE_BOOL(wasm_write_protect_code_memory, false, 542 "write protect code memory on the wasm native heap") 543 DEFINE_BOOL(wasm_trace_serialization, false, 544 "trace serialization/deserialization") 545 DEFINE_BOOL(wasm_async_compilation, true, 546 "enable actual asynchronous compilation for WebAssembly.compile") 547 DEFINE_BOOL(wasm_test_streaming, false, 548 "use streaming compilation instead of async compilation for tests") 549 DEFINE_UINT(wasm_max_mem_pages, v8::internal::wasm::kV8MaxWasmMemoryPages, 550 "maximum number of 64KiB memory pages of a wasm instance") 551 DEFINE_UINT(wasm_max_table_size, v8::internal::wasm::kV8MaxWasmTableSize, 552 "maximum table size of a wasm instance") 553 // Enable Liftoff by default on ia32 and x64. More architectures will follow 554 // once they are implemented and sufficiently tested. 555 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 556 DEFINE_BOOL( 557 wasm_tier_up, true, 558 "enable wasm baseline compilation and tier up to the optimizing compiler") 559 #else 560 DEFINE_BOOL( 561 wasm_tier_up, false, 562 "enable wasm baseline compilation and tier up to the optimizing compiler") 563 DEFINE_IMPLICATION(future, wasm_tier_up) 564 #endif 565 DEFINE_IMPLICATION(wasm_tier_up, liftoff) 566 DEFINE_DEBUG_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code") 567 DEFINE_DEBUG_BOOL(trace_wasm_decode_time, false, 568 "trace decoding time of wasm code") 569 DEFINE_DEBUG_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code") 570 DEFINE_DEBUG_BOOL(trace_wasm_interpreter, false, 571 "trace interpretation of wasm code") 572 DEFINE_DEBUG_BOOL(trace_wasm_streaming, false, 573 "trace streaming compilation of wasm code") 574 DEFINE_INT(trace_wasm_ast_start, 0, 575 "start function for wasm AST trace (inclusive)") 576 DEFINE_INT(trace_wasm_ast_end, 0, "end function for wasm AST trace (exclusive)") 577 DEFINE_BOOL(liftoff, false, 578 "enable Liftoff, the baseline compiler for WebAssembly") 579 DEFINE_DEBUG_BOOL(trace_liftoff, false, 580 "trace Liftoff, the baseline compiler for WebAssembly") 581 DEFINE_DEBUG_BOOL(wasm_break_on_decoder_error, false, 582 "debug break when wasm decoder encounters an error") 583 DEFINE_BOOL(wasm_trace_memory, false, 584 "print all memory updates performed in wasm code") 585 // Fuzzers use {wasm_tier_mask_for_testing} together with {liftoff} and 586 // {no_wasm_tier_up} to force some functions to be compiled with Turbofan. 587 DEFINE_INT(wasm_tier_mask_for_testing, 0, 588 "bitmask of functions to compile with TurboFan instead of Liftoff") 589 590 DEFINE_BOOL(validate_asm, true, "validate asm.js modules before compiling") 591 DEFINE_BOOL(suppress_asm_messages, false, 592 "don't emit asm.js related messages (for golden file testing)") 593 DEFINE_BOOL(trace_asm_time, false, "log asm.js timing info to the console") 594 DEFINE_BOOL(trace_asm_scanner, false, 595 "log tokens encountered by asm.js scanner") 596 DEFINE_BOOL(trace_asm_parser, false, "verbose logging of asm.js parse failures") 597 DEFINE_BOOL(stress_validate_asm, false, "try to validate everything as asm.js") 598 599 DEFINE_DEBUG_BOOL(dump_wasm_module, false, "dump wasm module bytes") 600 DEFINE_STRING(dump_wasm_module_path, nullptr, 601 "directory to dump wasm modules to") 602 603 // Declare command-line flags for WASM features. Warning: avoid using these 604 // flags directly in the implementation. Instead accept wasm::WasmFeatures 605 // for configurability. 606 #include "src/wasm/wasm-feature-flags.h" 607 608 #define SPACE 609 #define DECL_WASM_FLAG(feat, desc, val) \ 610 DEFINE_BOOL(experimental_wasm_##feat, val, \ 611 "enable prototype " desc " for wasm") 612 FOREACH_WASM_FEATURE_FLAG(DECL_WASM_FLAG, SPACE) 613 #undef DECL_WASM_FLAG 614 #undef SPACE 615 616 DEFINE_BOOL(wasm_opt, false, "enable wasm optimization") 617 DEFINE_BOOL(wasm_no_bounds_checks, false, 618 "disable bounds checks (performance testing only)") 619 DEFINE_BOOL(wasm_no_stack_checks, false, 620 "disable stack checks (performance testing only)") 621 622 DEFINE_BOOL(wasm_shared_engine, true, 623 "shares one wasm engine between all isolates within a process") 624 DEFINE_IMPLICATION(future, wasm_shared_engine) 625 DEFINE_BOOL(wasm_shared_code, true, 626 "shares code underlying a wasm module when it is transferred") 627 DEFINE_IMPLICATION(future, wasm_shared_code) 628 DEFINE_BOOL(wasm_trap_handler, true, 629 "use signal handlers to catch out of bounds memory access in wasm" 630 " (currently Linux x86_64 only)") 631 DEFINE_BOOL(wasm_trap_handler_fallback, false, 632 "Use bounds checks if guarded memory is not available") 633 DEFINE_BOOL(wasm_fuzzer_gen_test, false, 634 "Generate a test case when running a wasm fuzzer") 635 DEFINE_IMPLICATION(wasm_fuzzer_gen_test, single_threaded) 636 DEFINE_BOOL(print_wasm_code, false, "Print WebAssembly code") 637 DEFINE_BOOL(wasm_interpret_all, false, 638 "Execute all wasm code in the wasm interpreter") 639 DEFINE_BOOL(asm_wasm_lazy_compilation, false, 640 "enable lazy compilation for asm-wasm modules") 641 DEFINE_IMPLICATION(validate_asm, asm_wasm_lazy_compilation) 642 DEFINE_BOOL(wasm_lazy_compilation, false, 643 "enable lazy compilation for all wasm modules") 644 DEFINE_DEBUG_BOOL(trace_wasm_lazy_compilation, false, 645 "trace lazy compilation of wasm functions") 646 // wasm-interpret-all resets {asm-,}wasm-lazy-compilation. 647 DEFINE_NEG_IMPLICATION(wasm_interpret_all, asm_wasm_lazy_compilation) 648 DEFINE_NEG_IMPLICATION(wasm_interpret_all, wasm_lazy_compilation) 649 650 // Profiler flags. 651 DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler") 652 DEFINE_INT(type_info_threshold, 25, 653 "percentage of ICs that must have type info to allow optimization") 654 655 DEFINE_INT(stress_sampling_allocation_profiler, 0, 656 "Enables sampling allocation profiler with X as a sample interval") 657 658 // Garbage collections flags. 659 DEFINE_SIZE_T(min_semi_space_size, 0, 660 "min size of a semi-space (in MBytes), the new space consists of " 661 "two semi-spaces") 662 DEFINE_SIZE_T(max_semi_space_size, 0, 663 "max size of a semi-space (in MBytes), the new space consists of " 664 "two semi-spaces") 665 DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space") 666 DEFINE_BOOL(experimental_new_space_growth_heuristic, false, 667 "Grow the new space based on the percentage of survivors instead " 668 "of their absolute value.") 669 DEFINE_SIZE_T(max_old_space_size, 0, "max size of the old space (in Mbytes)") 670 DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)") 671 DEFINE_BOOL(gc_global, false, "always perform global GCs") 672 DEFINE_INT(random_gc_interval, 0, 673 "Collect garbage after random(0, X) allocations. It overrides " 674 "gc_interval.") 675 DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations") 676 DEFINE_INT(retain_maps_for_n_gc, 2, 677 "keeps maps alive for <n> old space garbage collections") 678 DEFINE_BOOL(trace_gc, false, 679 "print one trace line following each garbage collection") 680 DEFINE_BOOL(trace_gc_nvp, false, 681 "print one detailed trace line in name=value format " 682 "after each garbage collection") 683 DEFINE_BOOL(trace_gc_ignore_scavenger, false, 684 "do not print trace line after scavenger collection") 685 DEFINE_BOOL(trace_idle_notification, false, 686 "print one trace line following each idle notification") 687 DEFINE_BOOL(trace_idle_notification_verbose, false, 688 "prints the heap state used by the idle notification") 689 DEFINE_BOOL(trace_gc_verbose, false, 690 "print more details following each garbage collection") 691 DEFINE_INT(trace_allocation_stack_interval, -1, 692 "print stack trace after <n> free-list allocations") 693 DEFINE_INT(trace_duplicate_threshold_kb, 0, 694 "print duplicate objects in the heap if their size is more than " 695 "given threshold") 696 DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space") 697 DEFINE_BOOL(trace_fragmentation_verbose, false, 698 "report fragmentation for old space (detailed)") 699 DEFINE_BOOL(trace_evacuation, false, "report evacuation statistics") 700 DEFINE_BOOL(trace_mutator_utilization, false, 701 "print mutator utilization, allocation speed, gc speed") 702 DEFINE_BOOL(incremental_marking, true, "use incremental marking") 703 DEFINE_BOOL(incremental_marking_wrappers, true, 704 "use incremental marking for marking wrappers") 705 DEFINE_BOOL(trace_unmapper, false, "Trace the unmapping") 706 DEFINE_BOOL(parallel_scavenge, true, "parallel scavenge") 707 DEFINE_BOOL(trace_parallel_scavenge, false, "trace parallel scavenge") 708 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_ARM64) 709 #define V8_WRITE_PROTECT_CODE_MEMORY_BOOL false 710 #else 711 #define V8_WRITE_PROTECT_CODE_MEMORY_BOOL true 712 #endif 713 DEFINE_BOOL(write_protect_code_memory, V8_WRITE_PROTECT_CODE_MEMORY_BOOL, 714 "write protect code memory") 715 #ifdef V8_CONCURRENT_MARKING 716 #define V8_CONCURRENT_MARKING_BOOL true 717 #else 718 #define V8_CONCURRENT_MARKING_BOOL false 719 #endif 720 DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING_BOOL, 721 "use concurrent marking") 722 DEFINE_BOOL(parallel_marking, true, "use parallel marking in atomic pause") 723 DEFINE_IMPLICATION(parallel_marking, concurrent_marking) 724 DEFINE_INT(ephemeron_fixpoint_iterations, 10, 725 "number of fixpoint iterations it takes to switch to linear " 726 "ephemeron algorithm") 727 DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking") 728 DEFINE_BOOL(black_allocation, true, "use black allocation") 729 DEFINE_BOOL(concurrent_store_buffer, true, 730 "use concurrent store buffer processing") 731 DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping") 732 DEFINE_BOOL(parallel_compaction, true, "use parallel compaction") 733 DEFINE_BOOL(parallel_pointer_update, true, 734 "use parallel pointer update during compaction") 735 DEFINE_BOOL(detect_ineffective_gcs_near_heap_limit, true, 736 "trigger out-of-memory failure to avoid GC storm near heap limit") 737 DEFINE_BOOL(trace_incremental_marking, false, 738 "trace progress of the incremental marking") 739 DEFINE_BOOL(trace_stress_marking, false, "trace stress marking progress") 740 DEFINE_BOOL(trace_stress_scavenge, false, "trace stress scavenge progress") 741 DEFINE_BOOL(track_gc_object_stats, false, 742 "track object counts and memory usage") 743 DEFINE_BOOL(trace_gc_object_stats, false, 744 "trace object counts and memory usage") 745 DEFINE_BOOL(trace_zone_stats, false, "trace zone memory usage") 746 DEFINE_BOOL(track_retaining_path, false, 747 "enable support for tracking retaining path") 748 DEFINE_BOOL(concurrent_array_buffer_freeing, true, 749 "free array buffer allocations on a background thread") 750 DEFINE_INT(gc_stats, 0, "Used by tracing internally to enable gc statistics") 751 DEFINE_IMPLICATION(trace_gc_object_stats, track_gc_object_stats) 752 DEFINE_VALUE_IMPLICATION(track_gc_object_stats, gc_stats, 1) 753 DEFINE_VALUE_IMPLICATION(trace_gc_object_stats, gc_stats, 1) 754 DEFINE_NEG_IMPLICATION(trace_gc_object_stats, incremental_marking) 755 DEFINE_NEG_IMPLICATION(track_retaining_path, incremental_marking) 756 DEFINE_NEG_IMPLICATION(track_retaining_path, parallel_marking) 757 DEFINE_NEG_IMPLICATION(track_retaining_path, concurrent_marking) 758 DEFINE_BOOL(track_detached_contexts, true, 759 "track native contexts that are expected to be garbage collected") 760 DEFINE_BOOL(trace_detached_contexts, false, 761 "trace native contexts that are expected to be garbage collected") 762 DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts) 763 #ifdef VERIFY_HEAP 764 DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC") 765 DEFINE_BOOL(verify_heap_skip_remembered_set, false, 766 "disable remembered set verification") 767 #endif 768 DEFINE_BOOL(move_object_start, true, "enable moving of object starts") 769 DEFINE_BOOL(memory_reducer, true, "use memory reducer") 770 DEFINE_INT(heap_growing_percent, 0, 771 "specifies heap growing factor as (1 + heap_growing_percent/100)") 772 DEFINE_INT(v8_os_page_size, 0, "override OS page size (in KBytes)") 773 DEFINE_BOOL(always_compact, false, "Perform compaction on every full GC") 774 DEFINE_BOOL(never_compact, false, 775 "Never perform compaction on full GC - testing only") 776 DEFINE_BOOL(compact_code_space, true, "Compact code space on full collections") 777 DEFINE_BOOL(use_marking_progress_bar, true, 778 "Use a progress bar to scan large objects in increments when " 779 "incremental marking is active.") 780 DEFINE_BOOL(force_marking_deque_overflows, false, 781 "force overflows of marking deque by reducing it's size " 782 "to 64 words") 783 DEFINE_BOOL(stress_compaction, false, 784 "stress the GC compactor to flush out bugs (implies " 785 "--force_marking_deque_overflows)") 786 DEFINE_BOOL(stress_compaction_random, false, 787 "Stress GC compaction by selecting random percent of pages as " 788 "evacuation candidates. It overrides stress_compaction.") 789 DEFINE_BOOL(stress_incremental_marking, false, 790 "force incremental marking for small heaps and run it more often") 791 792 DEFINE_BOOL(fuzzer_gc_analysis, false, 793 "prints number of allocations and enables analysis mode for gc " 794 "fuzz testing, e.g. --stress-marking, --stress-scavenge") 795 DEFINE_INT(stress_marking, 0, 796 "force marking at random points between 0 and X (inclusive) percent " 797 "of the regular marking start limit") 798 DEFINE_INT(stress_scavenge, 0, 799 "force scavenge at random points between 0 and X (inclusive) " 800 "percent of the new space capacity") 801 DEFINE_IMPLICATION(fuzzer_gc_analysis, stress_marking) 802 DEFINE_IMPLICATION(fuzzer_gc_analysis, stress_scavenge) 803 804 DEFINE_BOOL(disable_abortjs, false, "disables AbortJS runtime function") 805 806 DEFINE_BOOL(manual_evacuation_candidates_selection, false, 807 "Test mode only flag. It allows an unit test to select evacuation " 808 "candidates pages (requires --stress_compaction).") 809 DEFINE_BOOL(fast_promotion_new_space, false, 810 "fast promote new space on high survival rates") 811 812 DEFINE_BOOL(clear_free_memory, false, "initialize free memory with 0") 813 814 DEFINE_BOOL(young_generation_large_objects, false, 815 "allocates large objects by default in the young generation large " 816 "object space") 817 818 // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc 819 DEFINE_BOOL(debug_code, DEBUG_BOOL, 820 "generate extra code (assertions) for debugging") 821 DEFINE_BOOL(code_comments, false, 822 "emit comments in code disassembly; for more readable source " 823 "positions you should add --no-concurrent_recompilation") 824 DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available") 825 DEFINE_BOOL(enable_ssse3, true, "enable use of SSSE3 instructions if available") 826 DEFINE_BOOL(enable_sse4_1, true, 827 "enable use of SSE4.1 instructions if available") 828 DEFINE_BOOL(enable_sahf, true, 829 "enable use of SAHF instruction if available (X64 only)") 830 DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available") 831 DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available") 832 DEFINE_BOOL(enable_bmi1, true, "enable use of BMI1 instructions if available") 833 DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available") 834 DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available") 835 DEFINE_BOOL(enable_popcnt, true, 836 "enable use of POPCNT instruction if available") 837 DEFINE_STRING(arm_arch, ARM_ARCH_DEFAULT, 838 "generate instructions for the selected ARM architecture if " 839 "available: armv6, armv7, armv7+sudiv or armv8") 840 DEFINE_BOOL(force_long_branches, false, 841 "force all emitted branches to be in long mode (MIPS/PPC only)") 842 DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu") 843 DEFINE_BOOL(partial_constant_pool, true, 844 "enable use of partial constant pools (X64 only)") 845 846 // Deprecated ARM flags (replaced by arm_arch). 847 DEFINE_MAYBE_BOOL(enable_armv7, "deprecated (use --arm_arch instead)") 848 DEFINE_MAYBE_BOOL(enable_vfp3, "deprecated (use --arm_arch instead)") 849 DEFINE_MAYBE_BOOL(enable_32dregs, "deprecated (use --arm_arch instead)") 850 DEFINE_MAYBE_BOOL(enable_neon, "deprecated (use --arm_arch instead)") 851 DEFINE_MAYBE_BOOL(enable_sudiv, "deprecated (use --arm_arch instead)") 852 DEFINE_MAYBE_BOOL(enable_armv8, "deprecated (use --arm_arch instead)") 853 854 // regexp-macro-assembler-*.cc 855 DEFINE_BOOL(enable_regexp_unaligned_accesses, true, 856 "enable unaligned accesses for the regexp engine") 857 858 // api.cc 859 DEFINE_BOOL(script_streaming, true, "enable parsing on background") 860 DEFINE_BOOL(disable_old_api_accessors, false, 861 "Disable old-style API accessors whose setters trigger through the " 862 "prototype chain") 863 864 // bootstrapper.cc 865 DEFINE_STRING(expose_natives_as, nullptr, "expose natives in global object") 866 DEFINE_BOOL(expose_free_buffer, false, "expose freeBuffer extension") 867 DEFINE_BOOL(expose_gc, false, "expose gc extension") 868 DEFINE_STRING(expose_gc_as, nullptr, 869 "expose gc extension under the specified name") 870 DEFINE_IMPLICATION(expose_gc_as, expose_gc) 871 DEFINE_BOOL(expose_externalize_string, false, 872 "expose externalize string extension") 873 DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension") 874 DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture") 875 DEFINE_BOOL(builtins_in_stack_traces, false, 876 "show built-in functions in stack traces") 877 DEFINE_BOOL(enable_experimental_builtins, false, 878 "enable new csa-based experimental builtins") 879 DEFINE_BOOL(disallow_code_generation_from_strings, false, 880 "disallow eval and friends") 881 DEFINE_BOOL(expose_async_hooks, false, "expose async_hooks object") 882 883 // builtins.cc 884 DEFINE_BOOL(allow_unsafe_function_constructor, false, 885 "allow invoking the function constructor without security checks") 886 DEFINE_BOOL(force_slow_path, false, "always take the slow path for builtins") 887 888 // builtins-ia32.cc 889 DEFINE_BOOL(inline_new, true, "use fast inline allocation") 890 891 // codegen-ia32.cc / codegen-arm.cc 892 DEFINE_BOOL(trace, false, "trace function calls") 893 894 // codegen.cc 895 DEFINE_BOOL(lazy, true, "use lazy compilation") 896 DEFINE_BOOL(trace_opt, false, "trace lazy optimization") 897 DEFINE_BOOL(trace_opt_verbose, false, "extra verbose compilation tracing") 898 DEFINE_IMPLICATION(trace_opt_verbose, trace_opt) 899 DEFINE_BOOL(trace_opt_stats, false, "trace lazy optimization statistics") 900 DEFINE_BOOL(trace_deopt, false, "trace optimize function deoptimization") 901 DEFINE_BOOL(trace_file_names, false, 902 "include file names in trace-opt/trace-deopt output") 903 DEFINE_BOOL(trace_interrupts, false, "trace interrupts when they are handled") 904 DEFINE_BOOL(opt, true, "use adaptive optimizations") 905 DEFINE_BOOL(always_opt, false, "always try to optimize functions") 906 DEFINE_BOOL(always_osr, false, "always try to OSR functions") 907 DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt") 908 909 DEFINE_BOOL(trace_serializer, false, "print code serializer trace") 910 #ifdef DEBUG 911 DEFINE_BOOL(external_reference_stats, false, 912 "print statistics on external references used during serialization") 913 #endif // DEBUG 914 915 // compilation-cache.cc 916 DEFINE_BOOL(compilation_cache, true, "enable compilation cache") 917 918 DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions") 919 920 // compiler-dispatcher.cc 921 DEFINE_BOOL(compiler_dispatcher, false, "enable compiler dispatcher") 922 DEFINE_BOOL(trace_compiler_dispatcher, false, 923 "trace compiler dispatcher activity") 924 925 // compiler-dispatcher-job.cc 926 DEFINE_BOOL( 927 trace_compiler_dispatcher_jobs, false, 928 "trace progress of individual jobs managed by the compiler dispatcher") 929 930 // cpu-profiler.cc 931 DEFINE_INT(cpu_profiler_sampling_interval, 1000, 932 "CPU profiler sampling interval in microseconds") 933 934 // Array abuse tracing 935 DEFINE_BOOL(trace_js_array_abuse, false, 936 "trace out-of-bounds accesses to JS arrays") 937 DEFINE_BOOL(trace_external_array_abuse, false, 938 "trace out-of-bounds-accesses to external arrays") 939 DEFINE_BOOL(trace_array_abuse, false, 940 "trace out-of-bounds accesses to all arrays") 941 DEFINE_IMPLICATION(trace_array_abuse, trace_js_array_abuse) 942 DEFINE_IMPLICATION(trace_array_abuse, trace_external_array_abuse) 943 944 // debugger 945 DEFINE_BOOL( 946 trace_side_effect_free_debug_evaluate, false, 947 "print debug messages for side-effect-free debug-evaluate for testing") 948 DEFINE_BOOL(hard_abort, true, "abort by crashing") 949 950 // inspector 951 DEFINE_BOOL(expose_inspector_scripts, false, 952 "expose injected-script-source.js for debugging") 953 954 // execution.cc 955 DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB, 956 "default size of stack region v8 is allowed to use (in kBytes)") 957 958 // frames.cc 959 DEFINE_INT(max_stack_trace_source_length, 300, 960 "maximum length of function source code printed in a stack trace.") 961 962 // execution.cc, messages.cc 963 DEFINE_BOOL(clear_exceptions_on_js_entry, false, 964 "clear pending exceptions when entering JavaScript") 965 966 // counters.cc 967 DEFINE_INT(histogram_interval, 600000, 968 "time interval in ms for aggregating memory histograms") 969 970 // heap-snapshot-generator.cc 971 DEFINE_BOOL(heap_profiler_trace_objects, false, 972 "Dump heap object allocations/movements/size_updates") 973 DEFINE_BOOL(heap_profiler_use_embedder_graph, true, 974 "Use the new EmbedderGraph API to get embedder nodes") 975 DEFINE_INT(heap_snapshot_string_limit, 1024, 976 "truncate strings to this length in the heap snapshot") 977 978 // sampling-heap-profiler.cc 979 DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false, 980 "Use constant sample intervals to eliminate test flakiness") 981 982 // v8.cc 983 DEFINE_BOOL(use_idle_notification, true, 984 "Use idle notification to reduce memory footprint.") 985 // ic.cc 986 DEFINE_BOOL(use_ic, true, "use inline caching") 987 DEFINE_BOOL(trace_ic, false, 988 "trace inline cache state transitions for tools/ic-processor") 989 DEFINE_IMPLICATION(trace_ic, log_code) 990 DEFINE_INT(ic_stats, 0, "inline cache state transitions statistics") 991 DEFINE_VALUE_IMPLICATION(trace_ic, ic_stats, 1) 992 DEFINE_BOOL_READONLY(track_constant_fields, false, 993 "enable constant field tracking") 994 DEFINE_BOOL_READONLY(modify_map_inplace, false, "enable in-place map updates") 995 996 // macro-assembler-ia32.cc 997 DEFINE_BOOL(native_code_counters, false, 998 "generate extra code for manipulating stats counters") 999 1000 // objects.cc 1001 DEFINE_BOOL(thin_strings, true, "Enable ThinString support") 1002 DEFINE_BOOL(trace_prototype_users, false, 1003 "Trace updates to prototype user tracking") 1004 DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing") 1005 DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths") 1006 DEFINE_BOOL(trace_maps, false, "trace map creation") 1007 DEFINE_BOOL(trace_maps_details, true, "also log map details") 1008 DEFINE_IMPLICATION(trace_maps, log_code) 1009 1010 // parser.cc 1011 DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax") 1012 DEFINE_BOOL(lazy_inner_functions, true, "enable lazy parsing inner functions") 1013 DEFINE_BOOL(aggressive_lazy_inner_functions, false, 1014 "even lazier inner function parsing") 1015 DEFINE_IMPLICATION(aggressive_lazy_inner_functions, lazy_inner_functions) 1016 DEFINE_BOOL(preparser_scope_analysis, true, 1017 "perform scope analysis for preparsed inner functions") 1018 DEFINE_IMPLICATION(preparser_scope_analysis, aggressive_lazy_inner_functions) 1019 1020 // simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc 1021 DEFINE_BOOL(trace_sim, false, "Trace simulator execution") 1022 DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator") 1023 DEFINE_BOOL(check_icache, false, 1024 "Check icache flushes in ARM and MIPS simulator") 1025 DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions") 1026 #if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \ 1027 defined(V8_TARGET_ARCH_PPC64) 1028 DEFINE_INT(sim_stack_alignment, 16, 1029 "Stack alignment in bytes in simulator. This must be a power of two " 1030 "and it must be at least 16. 16 is default.") 1031 #else 1032 DEFINE_INT(sim_stack_alignment, 8, 1033 "Stack alingment in bytes in simulator (4 or 8, 8 is default)") 1034 #endif 1035 DEFINE_INT(sim_stack_size, 2 * MB / KB, 1036 "Stack size of the ARM64, MIPS64 and PPC64 simulator " 1037 "in kBytes (default is 2 MB)") 1038 DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR, 1039 "When logging, try to use coloured output.") 1040 DEFINE_BOOL(ignore_asm_unimplemented_break, false, 1041 "Don't break for ASM_UNIMPLEMENTED_BREAK macros.") 1042 DEFINE_BOOL(trace_sim_messages, false, 1043 "Trace simulator debug messages. Implied by --trace-sim.") 1044 1045 // isolate.cc 1046 DEFINE_BOOL(stack_trace_on_illegal, false, 1047 "print stack trace when an illegal exception is thrown") 1048 DEFINE_BOOL(abort_on_uncaught_exception, false, 1049 "abort program (dump core) when an uncaught exception is thrown") 1050 DEFINE_BOOL(abort_on_stack_or_string_length_overflow, false, 1051 "Abort program when the stack overflows or a string exceeds " 1052 "maximum length (as opposed to throwing RangeError). This is " 1053 "useful for fuzzing where the spec behaviour would introduce " 1054 "nondeterminism.") 1055 DEFINE_BOOL(randomize_hashes, true, 1056 "randomize hashes to avoid predictable hash collisions " 1057 "(with snapshots this option cannot override the baked-in seed)") 1058 DEFINE_BOOL(rehash_snapshot, true, 1059 "rehash strings from the snapshot to override the baked-in seed") 1060 DEFINE_UINT64(hash_seed, 0, 1061 "Fixed seed to use to hash property keys (0 means random)" 1062 "(with snapshots this option cannot override the baked-in seed)") 1063 DEFINE_INT(random_seed, 0, 1064 "Default seed for initializing random generator " 1065 "(0, the default, means to use system random).") 1066 DEFINE_INT(fuzzer_random_seed, 0, 1067 "Default seed for initializing fuzzer random generator " 1068 "(0, the default, means to use v8's random number generator seed).") 1069 DEFINE_BOOL(trace_rail, false, "trace RAIL mode") 1070 DEFINE_BOOL(print_all_exceptions, false, 1071 "print exception object and stack trace on each thrown exception") 1072 1073 // runtime.cc 1074 DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times") 1075 DEFINE_INT(runtime_stats, 0, 1076 "internal usage only for controlling runtime statistics") 1077 DEFINE_VALUE_IMPLICATION(runtime_call_stats, runtime_stats, 1) 1078 1079 // snapshot-common.cc 1080 #ifdef V8_EMBEDDED_BUILTINS 1081 #define V8_EMBEDDED_BUILTINS_BOOL true 1082 #else 1083 #define V8_EMBEDDED_BUILTINS_BOOL false 1084 #endif 1085 DEFINE_BOOL_READONLY(embedded_builtins, V8_EMBEDDED_BUILTINS_BOOL, 1086 "Embed builtin code into the binary.") 1087 // TODO(jgruber,v8:6666): Remove once ia32 has full embedded builtin support. 1088 DEFINE_BOOL_READONLY( 1089 ia32_verify_root_register, false, 1090 "Check that the value of the root register was not clobbered.") 1091 // TODO(jgruber,v8:6666): Remove once ia32 has full embedded builtin support. 1092 DEFINE_BOOL(print_embedded_builtin_candidates, false, 1093 "Prints builtins that are not yet embedded but could be.") 1094 DEFINE_BOOL(lazy_deserialization, true, 1095 "Deserialize code lazily from the snapshot.") 1096 DEFINE_BOOL(lazy_handler_deserialization, true, 1097 "Deserialize bytecode handlers lazily from the snapshot.") 1098 DEFINE_IMPLICATION(lazy_handler_deserialization, lazy_deserialization) 1099 DEFINE_IMPLICATION(future, lazy_handler_deserialization) 1100 DEFINE_BOOL(trace_lazy_deserialization, false, "Trace lazy deserialization.") 1101 DEFINE_BOOL(profile_deserialization, false, 1102 "Print the time it takes to deserialize the snapshot.") 1103 DEFINE_BOOL(serialization_statistics, false, 1104 "Collect statistics on serialized objects.") 1105 DEFINE_UINT(serialization_chunk_size, 4096, 1106 "Custom size for serialization chunks") 1107 1108 // Regexp 1109 DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code") 1110 DEFINE_BOOL(regexp_mode_modifiers, false, "enable inline flags in regexp.") 1111 1112 // Testing flags test/cctest/test-{flags,api,serialization}.cc 1113 DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag") 1114 DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag") 1115 DEFINE_INT(testing_int_flag, 13, "testing_int_flag") 1116 DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag") 1117 DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag") 1118 DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness") 1119 1120 // mksnapshot.cc 1121 DEFINE_STRING(embedded_src, nullptr, 1122 "Path for the generated embedded data file. (mksnapshot only)") 1123 DEFINE_STRING( 1124 embedded_variant, nullptr, 1125 "Label to disambiguate symbols in embedded data file. (mksnapshot only)") 1126 DEFINE_STRING(startup_src, nullptr, 1127 "Write V8 startup as C++ src. (mksnapshot only)") 1128 DEFINE_STRING(startup_blob, nullptr, 1129 "Write V8 startup blob file. (mksnapshot only)") 1130 1131 // 1132 // Minor mark compact collector flags. 1133 // 1134 #ifdef ENABLE_MINOR_MC 1135 DEFINE_BOOL(minor_mc_parallel_marking, true, 1136 "use parallel marking for the young generation") 1137 DEFINE_BOOL(trace_minor_mc_parallel_marking, false, 1138 "trace parallel marking for the young generation") 1139 DEFINE_BOOL(minor_mc, false, "perform young generation mark compact GCs") 1140 #endif // ENABLE_MINOR_MC 1141 1142 // 1143 // Dev shell flags 1144 // 1145 1146 DEFINE_BOOL(help, false, "Print usage message, including flags, on console") 1147 DEFINE_BOOL(dump_counters, false, "Dump counters on exit") 1148 DEFINE_BOOL(dump_counters_nvp, false, 1149 "Dump counters as name-value pairs on exit") 1150 DEFINE_BOOL(use_external_strings, false, "Use external strings for source code") 1151 1152 DEFINE_STRING(map_counters, "", "Map counters to a file") 1153 DEFINE_ARGS(js_arguments, 1154 "Pass all remaining arguments to the script. Alias for \"--\".") 1155 DEFINE_BOOL(mock_arraybuffer_allocator, false, 1156 "Use a mock ArrayBuffer allocator for testing.") 1157 1158 // 1159 // GDB JIT integration flags. 1160 // 1161 #undef FLAG 1162 #ifdef ENABLE_GDB_JIT_INTERFACE 1163 #define FLAG FLAG_FULL 1164 #else 1165 #define FLAG FLAG_READONLY 1166 #endif 1167 1168 DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface") 1169 DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects") 1170 DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk") 1171 DEFINE_STRING(gdbjit_dump_filter, "", 1172 "dump only objects containing this substring") 1173 1174 #ifdef ENABLE_GDB_JIT_INTERFACE 1175 DEFINE_IMPLICATION(gdbjit_full, gdbjit) 1176 DEFINE_IMPLICATION(gdbjit_dump, gdbjit) 1177 #endif 1178 DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space) 1179 1180 // 1181 // Debug only flags 1182 // 1183 #undef FLAG 1184 #ifdef DEBUG 1185 #define FLAG FLAG_FULL 1186 #else 1187 #define FLAG FLAG_READONLY 1188 #endif 1189 1190 // checks.cc 1191 #ifdef ENABLE_SLOW_DCHECKS 1192 DEFINE_BOOL(enable_slow_asserts, true, 1193 "enable asserts that are slow to execute") 1194 #endif 1195 1196 // codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc 1197 DEFINE_BOOL(print_ast, false, "print source AST") 1198 DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints") 1199 1200 // compiler.cc 1201 DEFINE_BOOL(print_builtin_scopes, false, "print scopes for builtins") 1202 DEFINE_BOOL(print_scopes, false, "print scopes") 1203 1204 // contexts.cc 1205 DEFINE_BOOL(trace_contexts, false, "trace contexts operations") 1206 1207 // heap.cc 1208 DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection") 1209 DEFINE_BOOL(code_stats, false, "report code statistics after GC") 1210 DEFINE_BOOL(print_handles, false, "report handles after GC") 1211 DEFINE_BOOL(check_handle_count, false, 1212 "Check that there are not too many handles at GC") 1213 DEFINE_BOOL(print_global_handles, false, "report global handles after GC") 1214 1215 // TurboFan debug-only flags. 1216 DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis") 1217 1218 // objects.cc 1219 DEFINE_BOOL(trace_module_status, false, 1220 "Trace status transitions of ECMAScript modules") 1221 DEFINE_BOOL(trace_normalization, false, 1222 "prints when objects are turned into dictionaries.") 1223 1224 // runtime.cc 1225 DEFINE_BOOL(trace_lazy, false, "trace lazy compilation") 1226 1227 // spaces.cc 1228 DEFINE_BOOL(collect_heap_spill_statistics, false, 1229 "report heap spill statistics along with heap_stats " 1230 "(requires heap_stats)") 1231 DEFINE_BOOL(trace_isolates, false, "trace isolate state changes") 1232 1233 // Regexp 1234 DEFINE_BOOL(regexp_possessive_quantifier, false, 1235 "enable possessive quantifier syntax for testing") 1236 DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution") 1237 DEFINE_BOOL(trace_regexp_assembler, false, 1238 "trace regexp macro assembler calls.") 1239 DEFINE_BOOL(trace_regexp_parser, false, "trace regexp parsing") 1240 1241 // Debugger 1242 DEFINE_BOOL(print_break_location, false, "print source location on debug break") 1243 1244 // wasm instance management 1245 DEFINE_DEBUG_BOOL(trace_wasm_instances, false, 1246 "trace creation and collection of wasm instances") 1247 1248 // 1249 // Logging and profiling flags 1250 // 1251 #undef FLAG 1252 #define FLAG FLAG_FULL 1253 1254 // log.cc 1255 DEFINE_BOOL(log, false, 1256 "Minimal logging (no API, code, GC, suspect, or handles samples).") 1257 DEFINE_BOOL(log_all, false, "Log all events to the log file.") 1258 DEFINE_BOOL(log_api, false, "Log API events to the log file.") 1259 DEFINE_BOOL(log_code, false, 1260 "Log code events to the log file without profiling.") 1261 DEFINE_BOOL(log_handles, false, "Log global handle events.") 1262 DEFINE_BOOL(log_suspect, false, "Log suspect operations.") 1263 DEFINE_BOOL(log_source_code, false, "Log source code.") 1264 DEFINE_BOOL(log_function_events, false, 1265 "Log function events " 1266 "(parse, compile, execute) separately.") 1267 DEFINE_BOOL(prof, false, 1268 "Log statistical profiling information (implies --log-code).") 1269 1270 DEFINE_BOOL(detailed_line_info, false, 1271 "Always generate detailed line information for CPU profiling.") 1272 1273 #if defined(ANDROID) 1274 // Phones and tablets have processors that are much slower than desktop 1275 // and laptop computers for which current heuristics are tuned. 1276 #define DEFAULT_PROF_SAMPLING_INTERVAL 5000 1277 #else 1278 #define DEFAULT_PROF_SAMPLING_INTERVAL 1000 1279 #endif 1280 DEFINE_INT(prof_sampling_interval, DEFAULT_PROF_SAMPLING_INTERVAL, 1281 "Interval for --prof samples (in microseconds).") 1282 #undef DEFAULT_PROF_SAMPLING_INTERVAL 1283 1284 DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.") 1285 DEFINE_IMPLICATION(prof, prof_cpp) 1286 DEFINE_BOOL(prof_browser_mode, true, 1287 "Used with --prof, turns on browser-compatible mode for profiling.") 1288 DEFINE_STRING(logfile, "v8.log", "Specify the name of the log file.") 1289 DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.") 1290 DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.") 1291 DEFINE_BOOL(interpreted_frames_native_stack, false, 1292 "Show interpreted frames on the native stack (useful for external " 1293 "profilers).") 1294 DEFINE_BOOL(perf_basic_prof, false, 1295 "Enable perf linux profiler (basic support).") 1296 DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space) 1297 DEFINE_BOOL(perf_basic_prof_only_functions, false, 1298 "Only report function code ranges to perf (i.e. no stubs).") 1299 DEFINE_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof) 1300 DEFINE_BOOL(perf_prof, false, 1301 "Enable perf linux profiler (experimental annotate support).") 1302 DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space) 1303 DEFINE_BOOL(perf_prof_unwinding_info, false, 1304 "Enable unwinding info for perf linux profiler (experimental).") 1305 DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info) 1306 DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__", 1307 "Specify the name of the file for fake gc mmap used in ll_prof") 1308 DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.") 1309 DEFINE_BOOL(log_timer_events, false, 1310 "Time events including external callbacks.") 1311 DEFINE_IMPLICATION(log_timer_events, log_internal_timer_events) 1312 DEFINE_IMPLICATION(log_internal_timer_events, prof) 1313 DEFINE_BOOL(log_instruction_stats, false, "Log AArch64 instruction statistics.") 1314 DEFINE_STRING(log_instruction_file, "arm64_inst.csv", 1315 "AArch64 instruction statistics log file.") 1316 DEFINE_INT(log_instruction_period, 1 << 22, 1317 "AArch64 instruction statistics logging period.") 1318 1319 DEFINE_BOOL(redirect_code_traces, false, 1320 "output deopt information and disassembly into file " 1321 "code-<pid>-<isolate id>.asm") 1322 DEFINE_STRING(redirect_code_traces_to, nullptr, 1323 "output deopt information and disassembly into the given file") 1324 1325 DEFINE_BOOL(print_opt_source, false, 1326 "print source code of optimized and inlined functions") 1327 1328 // 1329 // Disassembler only flags 1330 // 1331 #undef FLAG 1332 #ifdef ENABLE_DISASSEMBLER 1333 #define FLAG FLAG_FULL 1334 #else 1335 #define FLAG FLAG_READONLY 1336 #endif 1337 1338 // elements.cc 1339 DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions") 1340 1341 DEFINE_BOOL(trace_creation_allocation_sites, false, 1342 "trace the creation of allocation sites") 1343 1344 // code-stubs.cc 1345 DEFINE_BOOL(print_code_stubs, false, "print code stubs") 1346 DEFINE_BOOL(test_secondary_stub_cache, false, 1347 "test secondary stub cache by disabling the primary one") 1348 1349 DEFINE_BOOL(test_primary_stub_cache, false, 1350 "test primary stub cache by disabling the secondary one") 1351 1352 DEFINE_BOOL(test_small_max_function_context_stub_size, false, 1353 "enable testing the function context size overflow path " 1354 "by making the maximum size smaller") 1355 1356 // codegen-ia32.cc / codegen-arm.cc 1357 DEFINE_BOOL(print_code, false, "print generated code") 1358 DEFINE_BOOL(print_opt_code, false, "print optimized code") 1359 DEFINE_STRING(print_opt_code_filter, "*", "filter for printing optimized code") 1360 DEFINE_BOOL(print_code_verbose, false, "print more information for code") 1361 DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins") 1362 DEFINE_STRING(print_builtin_code_filter, "*", 1363 "filter for printing builtin code") 1364 DEFINE_BOOL(print_builtin_size, false, "print code size for builtins") 1365 1366 #ifdef ENABLE_DISASSEMBLER 1367 DEFINE_BOOL(sodium, false, 1368 "print generated code output suitable for use with " 1369 "the Sodium code viewer") 1370 1371 DEFINE_IMPLICATION(sodium, print_code_stubs) 1372 DEFINE_IMPLICATION(sodium, print_code) 1373 DEFINE_IMPLICATION(sodium, print_opt_code) 1374 DEFINE_IMPLICATION(sodium, code_comments) 1375 1376 DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code") 1377 DEFINE_IMPLICATION(print_all_code, print_code) 1378 DEFINE_IMPLICATION(print_all_code, print_opt_code) 1379 DEFINE_IMPLICATION(print_all_code, print_code_verbose) 1380 DEFINE_IMPLICATION(print_all_code, print_builtin_code) 1381 DEFINE_IMPLICATION(print_all_code, print_code_stubs) 1382 DEFINE_IMPLICATION(print_all_code, code_comments) 1383 #endif 1384 1385 #undef FLAG 1386 #define FLAG FLAG_FULL 1387 1388 // 1389 // Predictable mode related flags. 1390 // 1391 1392 DEFINE_BOOL(predictable, false, "enable predictable mode") 1393 DEFINE_IMPLICATION(predictable, single_threaded) 1394 DEFINE_NEG_IMPLICATION(predictable, memory_reducer) 1395 DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0) 1396 DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation) 1397 1398 // 1399 // Threading related flags. 1400 // 1401 1402 DEFINE_BOOL(single_threaded, false, "disable the use of background tasks") 1403 DEFINE_IMPLICATION(single_threaded, single_threaded_gc) 1404 DEFINE_NEG_IMPLICATION(single_threaded, concurrent_recompilation) 1405 DEFINE_NEG_IMPLICATION(single_threaded, compiler_dispatcher) 1406 1407 // 1408 // Parallel and concurrent GC (Orinoco) related flags. 1409 // 1410 DEFINE_BOOL(single_threaded_gc, false, "disable the use of background gc tasks") 1411 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_marking) 1412 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_sweeping) 1413 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_compaction) 1414 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_marking) 1415 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_pointer_update) 1416 DEFINE_NEG_IMPLICATION(single_threaded_gc, parallel_scavenge) 1417 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_store_buffer) 1418 #ifdef ENABLE_MINOR_MC 1419 DEFINE_NEG_IMPLICATION(single_threaded_gc, minor_mc_parallel_marking) 1420 #endif // ENABLE_MINOR_MC 1421 DEFINE_NEG_IMPLICATION(single_threaded_gc, concurrent_array_buffer_freeing) 1422 1423 #undef FLAG 1424 1425 #ifdef VERIFY_PREDICTABLE 1426 #define FLAG FLAG_FULL 1427 #else 1428 #define FLAG FLAG_READONLY 1429 #endif 1430 1431 DEFINE_BOOL(verify_predictable, false, 1432 "this mode is used for checking that V8 behaves predictably") 1433 DEFINE_INT(dump_allocations_digest_at_alloc, -1, 1434 "dump allocations digest each n-th allocation") 1435 1436 // 1437 // Read-only flags 1438 // 1439 #undef FLAG 1440 #define FLAG FLAG_READONLY 1441 1442 // assembler.h 1443 DEFINE_BOOL(enable_embedded_constant_pool, V8_EMBEDDED_CONSTANT_POOL, 1444 "enable use of embedded constant pools (PPC only)") 1445 1446 DEFINE_BOOL(unbox_double_fields, V8_DOUBLE_FIELDS_UNBOXING, 1447 "enable in-object double fields unboxing (64-bit only)") 1448 DEFINE_IMPLICATION(unbox_double_fields, track_double_fields) 1449 1450 // Cleanup... 1451 #undef FLAG_FULL 1452 #undef FLAG_READONLY 1453 #undef FLAG 1454 #undef FLAG_ALIAS 1455 1456 #undef DEFINE_BOOL 1457 #undef DEFINE_MAYBE_BOOL 1458 #undef DEFINE_DEBUG_BOOL 1459 #undef DEFINE_INT 1460 #undef DEFINE_STRING 1461 #undef DEFINE_FLOAT 1462 #undef DEFINE_ARGS 1463 #undef DEFINE_IMPLICATION 1464 #undef DEFINE_NEG_IMPLICATION 1465 #undef DEFINE_NEG_VALUE_IMPLICATION 1466 #undef DEFINE_VALUE_IMPLICATION 1467 #undef DEFINE_ALIAS_BOOL 1468 #undef DEFINE_ALIAS_INT 1469 #undef DEFINE_ALIAS_STRING 1470 #undef DEFINE_ALIAS_FLOAT 1471 #undef DEFINE_ALIAS_ARGS 1472 1473 #undef FLAG_MODE_DECLARE 1474 #undef FLAG_MODE_DEFINE 1475 #undef FLAG_MODE_DEFINE_DEFAULTS 1476 #undef FLAG_MODE_META 1477 #undef FLAG_MODE_DEFINE_IMPLICATIONS 1478 1479 #undef COMMA 1480