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