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