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