deps: update v8 to 4.3.61.21
[platform/upstream/nodejs.git] / deps / v8 / src / flag-definitions.h
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 #define DEFINE_IMPLICATION(whenflag, thenflag)              \
14   DEFINE_VALUE_IMPLICATION(whenflag, thenflag, true)
15
16 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag)          \
17   DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false)
18
19 #define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \
20   DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false)
21
22 // We want to declare the names of the variables for the header file.  Normally
23 // this will just be an extern declaration, but for a readonly flag we let the
24 // compiler make better optimizations by giving it the value.
25 #if defined(FLAG_MODE_DECLARE)
26 #define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam;
27 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
28   static ctype const FLAG_##nam = def;
29
30 // We want to supply the actual storage and value for the flag variable in the
31 // .cc file.  We only do this for writable flags.
32 #elif defined(FLAG_MODE_DEFINE)
33 #define FLAG_FULL(ftype, ctype, nam, def, cmt) ctype FLAG_##nam = def;
34
35 // We need to define all of our default values so that the Flag structure can
36 // access them by pointer.  These are just used internally inside of one .cc,
37 // for MODE_META, so there is no impact on the flags interface.
38 #elif defined(FLAG_MODE_DEFINE_DEFAULTS)
39 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
40   static ctype const FLAGDEFAULT_##nam = def;
41
42 // We want to write entries into our meta data table, for internal parsing and
43 // printing / etc in the flag parser code.  We only do this for writable flags.
44 #elif defined(FLAG_MODE_META)
45 #define FLAG_FULL(ftype, ctype, nam, def, cmt)                              \
46   { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false } \
47   ,
48 #define FLAG_ALIAS(ftype, ctype, alias, nam)                     \
49   {                                                              \
50     Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \
51         "alias for --" #nam, false                               \
52   }                                                              \
53   ,
54
55 // We produce the code to set flags when it is implied by another flag.
56 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
57 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \
58   if (FLAG_##whenflag) FLAG_##thenflag = value;
59
60 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \
61   if (!FLAG_##whenflag) FLAG_##thenflag = value;
62
63 #else
64 #error No mode supplied when including flags.defs
65 #endif
66
67 // Dummy defines for modes where it is not relevant.
68 #ifndef FLAG_FULL
69 #define FLAG_FULL(ftype, ctype, nam, def, cmt)
70 #endif
71
72 #ifndef FLAG_READONLY
73 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
74 #endif
75
76 #ifndef FLAG_ALIAS
77 #define FLAG_ALIAS(ftype, ctype, alias, nam)
78 #endif
79
80 #ifndef DEFINE_VALUE_IMPLICATION
81 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value)
82 #endif
83
84 #ifndef DEFINE_NEG_VALUE_IMPLICATION
85 #define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value)
86 #endif
87
88 #define COMMA ,
89
90 #ifdef FLAG_MODE_DECLARE
91 // Structure used to hold a collection of arguments to the JavaScript code.
92 struct JSArguments {
93  public:
94   inline const char*& operator[](int idx) const { return argv[idx]; }
95   static JSArguments Create(int argc, const char** argv) {
96     JSArguments args;
97     args.argc = argc;
98     args.argv = argv;
99     return args;
100   }
101   int argc;
102   const char** argv;
103 };
104
105 struct MaybeBoolFlag {
106   static MaybeBoolFlag Create(bool has_value, bool value) {
107     MaybeBoolFlag flag;
108     flag.has_value = has_value;
109     flag.value = value;
110     return flag;
111   }
112   bool has_value;
113   bool value;
114 };
115 #endif
116
117 #ifdef DEBUG
118 #define DEBUG_BOOL true
119 #else
120 #define DEBUG_BOOL false
121 #endif
122 #if (defined CAN_USE_VFP3_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
123 #define ENABLE_VFP3_DEFAULT true
124 #else
125 #define ENABLE_VFP3_DEFAULT false
126 #endif
127 #if (defined CAN_USE_ARMV7_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
128 #define ENABLE_ARMV7_DEFAULT true
129 #else
130 #define ENABLE_ARMV7_DEFAULT false
131 #endif
132 #if (defined CAN_USE_ARMV8_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
133 #define ENABLE_ARMV8_DEFAULT true
134 #else
135 #define ENABLE_ARMV8_DEFAULT false
136 #endif
137 #if (defined CAN_USE_VFP32DREGS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
138 #define ENABLE_32DREGS_DEFAULT true
139 #else
140 #define ENABLE_32DREGS_DEFAULT false
141 #endif
142 #if (defined CAN_USE_NEON) || !(defined ARM_TEST_NO_FEATURE_PROBE)
143 # define ENABLE_NEON_DEFAULT true
144 #else
145 # define ENABLE_NEON_DEFAULT false
146 #endif
147
148 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
149 #define DEFINE_BOOL_READONLY(nam, def, cmt) \
150   FLAG_READONLY(BOOL, bool, nam, def, cmt)
151 #define DEFINE_MAYBE_BOOL(nam, cmt) \
152   FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt)
153 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
154 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
155 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
156 #define DEFINE_ARGS(nam, cmt) FLAG(ARGS, JSArguments, nam, {0 COMMA NULL}, cmt)
157
158 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam)
159 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam)
160 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam)
161 #define DEFINE_ALIAS_STRING(alias, nam) \
162   FLAG_ALIAS(STRING, const char*, alias, nam)
163 #define DEFINE_ALIAS_ARGS(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam)
164
165 //
166 // Flags in all modes.
167 //
168 #define FLAG FLAG_FULL
169
170 // Flags for language modes and experimental language features.
171 DEFINE_BOOL(use_strict, false, "enforce strict mode")
172 DEFINE_BOOL(use_strong, false, "enforce strong mode")
173 DEFINE_IMPLICATION(use_strong, use_strict)
174
175 DEFINE_BOOL(strong_mode, false, "experimental strong language mode")
176 DEFINE_IMPLICATION(use_strong, strong_mode)
177
178 DEFINE_BOOL(es_staging, false, "enable all completed harmony features")
179 DEFINE_BOOL(harmony, false, "enable all completed harmony features")
180 DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony fetaures")
181 DEFINE_IMPLICATION(harmony, es_staging)
182 DEFINE_IMPLICATION(es_staging, harmony)
183
184 // Features that are still work in progress (behind individual flags).
185 #define HARMONY_INPROGRESS(V)                                   \
186   V(harmony_modules, "harmony modules")                         \
187   V(harmony_arrays, "harmony array methods")                    \
188   V(harmony_array_includes, "harmony Array.prototype.includes") \
189   V(harmony_regexps, "harmony regular expression extensions")   \
190   V(harmony_arrow_functions, "harmony arrow functions")         \
191   V(harmony_proxies, "harmony proxies")                         \
192   V(harmony_sloppy, "harmony features in sloppy mode")          \
193   V(harmony_unicode, "harmony unicode escapes")                 \
194   V(harmony_unicode_regexps, "harmony unicode regexps")         \
195   V(harmony_rest_parameters, "harmony rest parameters")         \
196   V(harmony_reflect, "harmony Reflect API")
197
198 // Features that are complete (but still behind --harmony/es-staging flag).
199 #define HARMONY_STAGED(V)                                               \
200   V(harmony_computed_property_names, "harmony computed property names") \
201   V(harmony_tostring, "harmony toString")
202
203 // Features that are shipping (turned on by default, but internal flag remains).
204 #define HARMONY_SHIPPING(V)                                                \
205   V(harmony_numeric_literals, "harmony numeric literals")                  \
206   V(harmony_classes, "harmony classes (implies object literal extension)") \
207   V(harmony_object_literals, "harmony object literal extensions")
208
209 // Once a shipping feature has proved stable in the wild, it will be dropped
210 // from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,
211 // and associated tests are moved from the harmony directory to the appropriate
212 // esN directory.
213
214
215 #define FLAG_INPROGRESS_FEATURES(id, description) \
216   DEFINE_BOOL(id, false, "enable " #description " (in progress)")
217 HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES)
218 #undef FLAG_INPROGRESS_FEATURES
219
220 #define FLAG_STAGED_FEATURES(id, description) \
221   DEFINE_BOOL(id, false, "enable " #description) \
222   DEFINE_IMPLICATION(es_staging, id)
223 HARMONY_STAGED(FLAG_STAGED_FEATURES)
224 #undef FLAG_STAGED_FEATURES
225
226 #define FLAG_SHIPPING_FEATURES(id, description) \
227   DEFINE_BOOL(id, true, "enable " #description) \
228   DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id)
229 HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES)
230 #undef FLAG_SHIPPING_FEATURES
231
232
233 // Feature dependencies.
234 DEFINE_IMPLICATION(harmony_classes, harmony_object_literals)
235 DEFINE_IMPLICATION(harmony_unicode_regexps, harmony_unicode)
236
237
238 // Flags for experimental implementation features.
239 DEFINE_BOOL(compiled_keyed_generic_loads, false,
240             "use optimizing compiler to generate keyed generic load stubs")
241 // TODO(hpayer): We will remove this flag as soon as we have pretenuring
242 // support for specific allocation sites.
243 DEFINE_BOOL(pretenuring_call_new, false, "pretenure call new")
244 DEFINE_BOOL(allocation_site_pretenuring, true,
245             "pretenure with allocation sites")
246 DEFINE_BOOL(trace_pretenuring, false,
247             "trace pretenuring decisions of HAllocate instructions")
248 DEFINE_BOOL(trace_pretenuring_statistics, false,
249             "trace allocation site pretenuring statistics")
250 DEFINE_BOOL(track_fields, true, "track fields with only smi values")
251 DEFINE_BOOL(track_double_fields, true, "track fields with double values")
252 DEFINE_BOOL(track_heap_object_fields, true, "track fields with heap values")
253 DEFINE_BOOL(track_computed_fields, true, "track computed boilerplate fields")
254 DEFINE_IMPLICATION(track_double_fields, track_fields)
255 DEFINE_IMPLICATION(track_heap_object_fields, track_fields)
256 DEFINE_IMPLICATION(track_computed_fields, track_fields)
257 DEFINE_BOOL(track_field_types, true, "track field types")
258 DEFINE_IMPLICATION(track_field_types, track_fields)
259 DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
260 DEFINE_BOOL(smi_binop, true, "support smi representation in binary operations")
261 DEFINE_BOOL(vector_ics, false, "support vector-based ics")
262
263 // Flags for optimization types.
264 DEFINE_BOOL(optimize_for_size, false,
265             "Enables optimizations which favor memory size over execution "
266             "speed.")
267
268 DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
269
270 // Flags for data representation optimizations
271 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
272 DEFINE_BOOL(string_slices, true, "use string slices")
273
274 // Flags for Crankshaft.
275 DEFINE_BOOL(crankshaft, true, "use crankshaft")
276 DEFINE_STRING(hydrogen_filter, "*", "optimization filter")
277 DEFINE_BOOL(use_gvn, true, "use hydrogen global value numbering")
278 DEFINE_INT(gvn_iterations, 3, "maximum number of GVN fix-point iterations")
279 DEFINE_BOOL(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
280 DEFINE_BOOL(use_inlining, true, "use function inlining")
281 DEFINE_BOOL(use_escape_analysis, true, "use hydrogen escape analysis")
282 DEFINE_BOOL(use_allocation_folding, true, "use allocation folding")
283 DEFINE_BOOL(use_local_allocation_folding, false, "only fold in basic blocks")
284 DEFINE_BOOL(use_write_barrier_elimination, true,
285             "eliminate write barriers targeting allocations in optimized code")
286 DEFINE_INT(max_inlining_levels, 5, "maximum number of inlining levels")
287 DEFINE_INT(max_inlined_source_size, 600,
288            "maximum source size in bytes considered for a single inlining")
289 DEFINE_INT(max_inlined_nodes, 196,
290            "maximum number of AST nodes considered for a single inlining")
291 DEFINE_INT(max_inlined_nodes_cumulative, 400,
292            "maximum cumulative number of AST nodes considered for inlining")
293 DEFINE_BOOL(loop_invariant_code_motion, true, "loop invariant code motion")
294 DEFINE_BOOL(fast_math, true, "faster (but maybe less accurate) math functions")
295 DEFINE_BOOL(collect_megamorphic_maps_from_stub_cache, true,
296             "crankshaft harvests type feedback from stub cache")
297 DEFINE_BOOL(hydrogen_stats, false, "print statistics for hydrogen")
298 DEFINE_BOOL(trace_check_elimination, false, "trace check elimination phase")
299 DEFINE_BOOL(trace_environment_liveness, false,
300             "trace liveness of local variable slots")
301 DEFINE_BOOL(trace_hydrogen, false, "trace generated hydrogen to file")
302 DEFINE_STRING(trace_hydrogen_filter, "*", "hydrogen tracing filter")
303 DEFINE_BOOL(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs")
304 DEFINE_STRING(trace_hydrogen_file, NULL, "trace hydrogen to given file name")
305 DEFINE_STRING(trace_phase, "HLZ", "trace generated IR for specified phases")
306 DEFINE_BOOL(trace_inlining, false, "trace inlining decisions")
307 DEFINE_BOOL(trace_load_elimination, false, "trace load elimination")
308 DEFINE_BOOL(trace_store_elimination, false, "trace store elimination")
309 DEFINE_BOOL(trace_alloc, false, "trace register allocator")
310 DEFINE_BOOL(trace_all_uses, false, "trace all use positions")
311 DEFINE_BOOL(trace_range, false, "trace range analysis")
312 DEFINE_BOOL(trace_gvn, false, "trace global value numbering")
313 DEFINE_BOOL(trace_representation, false, "trace representation types")
314 DEFINE_BOOL(trace_removable_simulates, false, "trace removable simulates")
315 DEFINE_BOOL(trace_escape_analysis, false, "trace hydrogen escape analysis")
316 DEFINE_BOOL(trace_allocation_folding, false, "trace allocation folding")
317 DEFINE_BOOL(trace_track_allocation_sites, false,
318             "trace the tracking of allocation sites")
319 DEFINE_BOOL(trace_migration, false, "trace object migration")
320 DEFINE_BOOL(trace_generalization, false, "trace map generalization")
321 DEFINE_BOOL(stress_pointer_maps, false, "pointer map for every instruction")
322 DEFINE_BOOL(stress_environments, false, "environment for every instruction")
323 DEFINE_INT(deopt_every_n_times, 0,
324            "deoptimize every n times a deopt point is passed")
325 DEFINE_INT(deopt_every_n_garbage_collections, 0,
326            "deoptimize every n garbage collections")
327 DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points")
328 DEFINE_BOOL(trap_on_deopt, false, "put a break point before deoptimizing")
329 DEFINE_BOOL(trap_on_stub_deopt, false,
330             "put a break point before deoptimizing a stub")
331 DEFINE_BOOL(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
332 DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining")
333 DEFINE_BOOL(use_osr, true, "use on-stack replacement")
334 DEFINE_BOOL(array_bounds_checks_elimination, true,
335             "perform array bounds checks elimination")
336 DEFINE_BOOL(trace_bce, false, "trace array bounds check elimination")
337 DEFINE_BOOL(array_bounds_checks_hoisting, false,
338             "perform array bounds checks hoisting")
339 DEFINE_BOOL(array_index_dehoisting, true, "perform array index dehoisting")
340 DEFINE_BOOL(analyze_environment_liveness, true,
341             "analyze liveness of environment slots and zap dead values")
342 DEFINE_BOOL(load_elimination, true, "use load elimination")
343 DEFINE_BOOL(check_elimination, true, "use check elimination")
344 DEFINE_BOOL(store_elimination, false, "use store elimination")
345 DEFINE_BOOL(dead_code_elimination, true, "use dead code elimination")
346 DEFINE_BOOL(fold_constants, true, "use constant folding")
347 DEFINE_BOOL(trace_dead_code_elimination, false, "trace dead code elimination")
348 DEFINE_BOOL(unreachable_code_elimination, true, "eliminate unreachable code")
349 DEFINE_BOOL(trace_osr, false, "trace on-stack replacement")
350 DEFINE_INT(stress_runs, 0, "number of stress runs")
351 DEFINE_BOOL(lookup_sample_by_shared, true,
352             "when picking a function to optimize, watch for shared function "
353             "info, not JSFunction itself")
354 DEFINE_BOOL(cache_optimized_code, true, "cache optimized code for closures")
355 DEFINE_BOOL(flush_optimized_code_cache, true,
356             "flushes the cache of optimized code for closures on every GC")
357 DEFINE_BOOL(inline_construct, true, "inline constructor calls")
358 DEFINE_BOOL(inline_arguments, true, "inline functions with arguments object")
359 DEFINE_BOOL(inline_accessors, true, "inline JavaScript accessors")
360 DEFINE_INT(escape_analysis_iterations, 2,
361            "maximum number of escape analysis fix-point iterations")
362
363 DEFINE_BOOL(optimize_for_in, true, "optimize functions containing for-in loops")
364
365 DEFINE_BOOL(concurrent_recompilation, true,
366             "optimizing hot functions asynchronously on a separate thread")
367 DEFINE_BOOL(job_based_recompilation, true,
368             "post tasks to v8::Platform instead of using a thread for "
369             "concurrent recompilation")
370 DEFINE_BOOL(trace_concurrent_recompilation, false,
371             "track concurrent recompilation")
372 DEFINE_INT(concurrent_recompilation_queue_length, 8,
373            "the length of the concurrent compilation queue")
374 DEFINE_INT(concurrent_recompilation_delay, 0,
375            "artificial compilation delay in ms")
376 DEFINE_BOOL(block_concurrent_recompilation, false,
377             "block queued jobs until released")
378 DEFINE_BOOL(concurrent_osr, true, "concurrent on-stack replacement")
379 DEFINE_IMPLICATION(concurrent_osr, concurrent_recompilation)
380
381 DEFINE_BOOL(omit_map_checks_for_leaf_maps, true,
382             "do not emit check maps for constant values that have a leaf map, "
383             "deoptimize the optimized code if the layout of the maps changes.")
384
385 // Flags for TurboFan.
386 DEFINE_STRING(turbo_filter, "~", "optimization filter for TurboFan compiler")
387 DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR")
388 DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs")
389 DEFINE_IMPLICATION(trace_turbo_graph, trace_turbo)
390 DEFINE_STRING(trace_turbo_cfg_file, NULL,
391               "trace turbo cfg graph (for C1 visualizer) to a given file name")
392 DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types")
393 DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler")
394 DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers")
395 DEFINE_BOOL(trace_turbo_jt, false, "trace TurboFan's jump threading")
396 DEFINE_BOOL(turbo_asm, true, "enable TurboFan for asm.js code")
397 DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase")
398 DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
399 DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan")
400 DEFINE_BOOL(turbo_types, true, "use typed lowering in TurboFan")
401 DEFINE_BOOL(turbo_type_feedback, false, "use type feedback in TurboFan")
402 DEFINE_BOOL(turbo_source_positions, false,
403             "track source code positions when building TurboFan IR")
404 DEFINE_IMPLICATION(trace_turbo, turbo_source_positions)
405 DEFINE_BOOL(context_specialization, false,
406             "enable context specialization in TurboFan")
407 DEFINE_BOOL(turbo_deoptimization, false, "enable deoptimization in TurboFan")
408 DEFINE_BOOL(turbo_inlining, false, "enable inlining in TurboFan")
409 DEFINE_BOOL(turbo_builtin_inlining, true, "enable builtin inlining in TurboFan")
410 DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
411 DEFINE_BOOL(loop_assignment_analysis, true, "perform loop assignment analysis")
412 DEFINE_BOOL(turbo_profiling, false, "enable profiling in TurboFan")
413 // TODO(dcarney): this is just for experimentation, remove when default.
414 DEFINE_BOOL(turbo_delay_ssa_decon, false,
415             "delay ssa deconstruction in TurboFan register allocator")
416 DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL,
417             "verify register allocation in TurboFan")
418 DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan")
419 DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan")
420 DEFINE_BOOL(turbo_osr, true, "enable OSR in TurboFan")
421 DEFINE_BOOL(turbo_exceptions, false, "enable exception handling in TurboFan")
422 DEFINE_BOOL(turbo_stress_loop_peeling, false,
423             "stress loop peeling optimization")
424 DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan")
425
426 DEFINE_INT(typed_array_max_size_in_heap, 64,
427            "threshold for in-heap typed array")
428
429 // Profiler flags.
430 DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
431 // 0x1800 fits in the immediate field of an ARM instruction.
432 DEFINE_INT(interrupt_budget, 0x1800,
433            "execution budget before interrupt is triggered")
434 DEFINE_INT(type_info_threshold, 25,
435            "percentage of ICs that must have type info to allow optimization")
436 DEFINE_INT(generic_ic_threshold, 30,
437            "max percentage of megamorphic/generic ICs to allow optimization")
438 DEFINE_INT(self_opt_count, 130, "call count before self-optimization")
439
440 DEFINE_BOOL(trace_opt_verbose, false, "extra verbose compilation tracing")
441 DEFINE_IMPLICATION(trace_opt_verbose, trace_opt)
442
443 // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
444 DEFINE_BOOL(debug_code, false, "generate extra code (assertions) for debugging")
445 DEFINE_BOOL(code_comments, false, "emit comments in code disassembly")
446 DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available")
447 DEFINE_BOOL(enable_sse4_1, true,
448             "enable use of SSE4.1 instructions if available")
449 DEFINE_BOOL(enable_sahf, true,
450             "enable use of SAHF instruction if available (X64 only)")
451 DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available")
452 DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available")
453 DEFINE_BOOL(enable_vfp3, ENABLE_VFP3_DEFAULT,
454             "enable use of VFP3 instructions if available")
455 DEFINE_BOOL(enable_armv7, ENABLE_ARMV7_DEFAULT,
456             "enable use of ARMv7 instructions if available (ARM only)")
457 DEFINE_BOOL(enable_armv8, ENABLE_ARMV8_DEFAULT,
458             "enable use of ARMv8 instructions if available (ARM 32-bit only)")
459 DEFINE_BOOL(enable_neon, ENABLE_NEON_DEFAULT,
460             "enable use of NEON instructions if available (ARM only)")
461 DEFINE_BOOL(enable_sudiv, true,
462             "enable use of SDIV and UDIV instructions if available (ARM only)")
463 DEFINE_BOOL(enable_mls, true,
464             "enable use of MLS instructions if available (ARM only)")
465 DEFINE_BOOL(enable_movw_movt, false,
466             "enable loading 32-bit constant by means of movw/movt "
467             "instruction pairs (ARM only)")
468 DEFINE_BOOL(enable_unaligned_accesses, true,
469             "enable unaligned accesses for ARMv7 (ARM only)")
470 DEFINE_BOOL(enable_32dregs, ENABLE_32DREGS_DEFAULT,
471             "enable use of d16-d31 registers on ARM - this requires VFP3")
472 DEFINE_BOOL(enable_vldr_imm, false,
473             "enable use of constant pools for double immediate (ARM only)")
474 DEFINE_BOOL(force_long_branches, false,
475             "force all emitted branches to be in long mode (MIPS/PPC only)")
476 DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu")
477
478 // bootstrapper.cc
479 DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object")
480 DEFINE_STRING(expose_debug_as, NULL, "expose debug in global object")
481 DEFINE_BOOL(expose_free_buffer, false, "expose freeBuffer extension")
482 DEFINE_BOOL(expose_gc, false, "expose gc extension")
483 DEFINE_STRING(expose_gc_as, NULL,
484               "expose gc extension under the specified name")
485 DEFINE_IMPLICATION(expose_gc_as, expose_gc)
486 DEFINE_BOOL(expose_externalize_string, false,
487             "expose externalize string extension")
488 DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension")
489 DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture")
490 DEFINE_BOOL(builtins_in_stack_traces, false,
491             "show built-in functions in stack traces")
492 DEFINE_BOOL(disable_native_files, false, "disable builtin natives files")
493
494 // builtins-ia32.cc
495 DEFINE_BOOL(inline_new, true, "use fast inline allocation")
496
497 // codegen-ia32.cc / codegen-arm.cc
498 DEFINE_BOOL(trace_codegen, false,
499             "print name of functions for which code is generated")
500 DEFINE_BOOL(trace, false, "trace function calls")
501 DEFINE_BOOL(mask_constants_with_cookie, true,
502             "use random jit cookie to mask large constants")
503
504 // codegen.cc
505 DEFINE_BOOL(lazy, true, "use lazy compilation")
506 DEFINE_BOOL(trace_opt, false, "trace lazy optimization")
507 DEFINE_BOOL(trace_opt_stats, false, "trace lazy optimization statistics")
508 DEFINE_BOOL(opt, true, "use adaptive optimizations")
509 DEFINE_BOOL(always_opt, false, "always try to optimize functions")
510 DEFINE_BOOL(always_osr, false, "always try to OSR functions")
511 DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt")
512 DEFINE_BOOL(trace_deopt, false, "trace optimize function deoptimization")
513 DEFINE_BOOL(trace_stub_failures, false,
514             "trace deoptimization of generated code stubs")
515
516 DEFINE_BOOL(serialize_toplevel, true, "enable caching of toplevel scripts")
517 DEFINE_BOOL(serialize_inner, true, "enable caching of inner functions")
518 DEFINE_BOOL(trace_serializer, false, "print code serializer trace")
519
520 // compiler.cc
521 DEFINE_INT(min_preparse_length, 1024,
522            "minimum length for automatic enable preparsing")
523 DEFINE_INT(max_opt_count, 10,
524            "maximum number of optimization attempts before giving up.")
525
526 // compilation-cache.cc
527 DEFINE_BOOL(compilation_cache, true, "enable compilation cache")
528
529 DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions")
530
531 // cpu-profiler.cc
532 DEFINE_INT(cpu_profiler_sampling_interval, 1000,
533            "CPU profiler sampling interval in microseconds")
534
535 // debug.cc
536 DEFINE_BOOL(trace_debug_json, false, "trace debugging JSON request/response")
537 DEFINE_BOOL(trace_js_array_abuse, false,
538             "trace out-of-bounds accesses to JS arrays")
539 DEFINE_BOOL(trace_external_array_abuse, false,
540             "trace out-of-bounds-accesses to external arrays")
541 DEFINE_BOOL(trace_array_abuse, false,
542             "trace out-of-bounds accesses to all arrays")
543 DEFINE_IMPLICATION(trace_array_abuse, trace_js_array_abuse)
544 DEFINE_IMPLICATION(trace_array_abuse, trace_external_array_abuse)
545 DEFINE_BOOL(enable_liveedit, true, "enable liveedit experimental feature")
546 DEFINE_BOOL(hard_abort, true, "abort by crashing")
547
548 // execution.cc
549 DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB,
550            "default size of stack region v8 is allowed to use (in kBytes)")
551
552 // frames.cc
553 DEFINE_INT(max_stack_trace_source_length, 300,
554            "maximum length of function source code printed in a stack trace.")
555
556 // full-codegen.cc
557 DEFINE_BOOL(always_inline_smi_code, false,
558             "always inline smi code in non-opt code")
559
560 // heap.cc
561 DEFINE_INT(min_semi_space_size, 0,
562            "min size of a semi-space (in MBytes), the new space consists of two"
563            "semi-spaces")
564 DEFINE_INT(target_semi_space_size, 0,
565            "target size of a semi-space (in MBytes) before triggering a GC")
566 DEFINE_INT(max_semi_space_size, 0,
567            "max size of a semi-space (in MBytes), the new space consists of two"
568            "semi-spaces")
569 DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
570 DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
571             "Grow the new space based on the percentage of survivors instead "
572             "of their absolute value.")
573 DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)")
574 DEFINE_INT(initial_old_space_size, 0, "initial old space size (in Mbytes)")
575 DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
576 DEFINE_BOOL(gc_global, false, "always perform global GCs")
577 DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
578 DEFINE_INT(retain_maps_for_n_gc, 2,
579            "keeps maps alive for <n> old space garbage collections")
580 DEFINE_BOOL(trace_gc, false,
581             "print one trace line following each garbage collection")
582 DEFINE_BOOL(trace_gc_nvp, false,
583             "print one detailed trace line in name=value format "
584             "after each garbage collection")
585 DEFINE_BOOL(trace_gc_ignore_scavenger, false,
586             "do not print trace line after scavenger collection")
587 DEFINE_BOOL(trace_idle_notification, false,
588             "print one trace line following each idle notification")
589 DEFINE_BOOL(trace_idle_notification_verbose, false,
590             "prints the heap state used by the idle notification")
591 DEFINE_BOOL(print_cumulative_gc_stat, false,
592             "print cumulative GC statistics in name=value format on exit")
593 DEFINE_BOOL(print_max_heap_committed, false,
594             "print statistics of the maximum memory committed for the heap "
595             "in name=value format on exit")
596 DEFINE_BOOL(trace_gc_verbose, false,
597             "print more details following each garbage collection")
598 DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space")
599 DEFINE_BOOL(trace_fragmentation_verbose, false,
600             "report fragmentation for old space (detailed)")
601 DEFINE_BOOL(collect_maps, true,
602             "garbage collect maps from which no objects can be reached")
603 DEFINE_BOOL(weak_embedded_maps_in_optimized_code, true,
604             "make maps embedded in optimized code weak")
605 DEFINE_BOOL(weak_embedded_objects_in_optimized_code, true,
606             "make objects embedded in optimized code weak")
607 DEFINE_BOOL(flush_code, true,
608             "flush code that we expect not to use again (during full gc)")
609 DEFINE_BOOL(flush_code_incrementally, true,
610             "flush code that we expect not to use again (incrementally)")
611 DEFINE_BOOL(trace_code_flushing, false, "trace code flushing progress")
612 DEFINE_BOOL(age_code, true,
613             "track un-executed functions to age code and flush only "
614             "old code (required for code flushing)")
615 DEFINE_BOOL(incremental_marking, true, "use incremental marking")
616 DEFINE_BOOL(incremental_marking_steps, true, "do incremental marking steps")
617 DEFINE_BOOL(overapproximate_weak_closure, true,
618             "overapproximate weak closer to reduce atomic pause time")
619 DEFINE_INT(min_progress_during_object_groups_marking, 128,
620            "keep overapproximating the weak closure as long as we discover at "
621            "least this many unmarked objects")
622 DEFINE_INT(max_object_groups_marking_rounds, 3,
623            "at most try this many times to over approximate the weak closure")
624 DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
625 DEFINE_BOOL(trace_incremental_marking, false,
626             "trace progress of the incremental marking")
627 DEFINE_BOOL(track_gc_object_stats, false,
628             "track object counts and memory usage")
629 DEFINE_BOOL(track_detached_contexts, true,
630             "track native contexts that are expected to be garbage collected")
631 DEFINE_BOOL(trace_detached_contexts, false,
632             "trace native contexts that are expected to be garbage collected")
633 DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts)
634 #ifdef VERIFY_HEAP
635 DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC")
636 #endif
637
638
639 // heap-snapshot-generator.cc
640 DEFINE_BOOL(heap_profiler_trace_objects, false,
641             "Dump heap object allocations/movements/size_updates")
642
643
644 // v8.cc
645 DEFINE_BOOL(use_idle_notification, true,
646             "Use idle notification to reduce memory footprint.")
647 // ic.cc
648 DEFINE_BOOL(use_ic, true, "use inline caching")
649 DEFINE_BOOL(trace_ic, false, "trace inline cache state transitions")
650
651 // macro-assembler-ia32.cc
652 DEFINE_BOOL(native_code_counters, false,
653             "generate extra code for manipulating stats counters")
654
655 // mark-compact.cc
656 DEFINE_BOOL(always_compact, false, "Perform compaction on every full GC")
657 DEFINE_BOOL(never_compact, false,
658             "Never perform compaction on full GC - testing only")
659 DEFINE_BOOL(compact_code_space, true,
660             "Compact code space on full non-incremental collections")
661 DEFINE_BOOL(incremental_code_compaction, true,
662             "Compact code space on full incremental collections")
663 DEFINE_BOOL(cleanup_code_caches_at_gc, true,
664             "Flush inline caches prior to mark compact collection and "
665             "flush code caches in maps during mark compact cycle.")
666 DEFINE_BOOL(use_marking_progress_bar, true,
667             "Use a progress bar to scan large objects in increments when "
668             "incremental marking is active.")
669 DEFINE_BOOL(zap_code_space, true,
670             "Zap free memory in code space with 0xCC while sweeping.")
671 DEFINE_INT(random_seed, 0,
672            "Default seed for initializing random generator "
673            "(0, the default, means to use system random).")
674
675 // objects.cc
676 DEFINE_BOOL(trace_weak_arrays, false, "trace WeakFixedArray usage")
677 DEFINE_BOOL(track_prototype_users, false,
678             "keep track of which maps refer to a given prototype object")
679 DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
680 #if TRACE_MAPS
681 DEFINE_BOOL(trace_maps, false, "trace map creation")
682 #endif
683
684 // parser.cc
685 DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
686 DEFINE_BOOL(trace_parse, false, "trace parsing and preparsing")
687
688 // simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc
689 DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
690 DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator")
691 DEFINE_BOOL(check_icache, false,
692             "Check icache flushes in ARM and MIPS simulator")
693 DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions")
694 #if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \
695     defined(V8_TARGET_ARCH_PPC64)
696 DEFINE_INT(sim_stack_alignment, 16,
697            "Stack alignment in bytes in simulator. This must be a power of two "
698            "and it must be at least 16. 16 is default.")
699 #else
700 DEFINE_INT(sim_stack_alignment, 8,
701            "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
702 #endif
703 DEFINE_INT(sim_stack_size, 2 * MB / KB,
704            "Stack size of the ARM64 and MIPS64 simulator "
705            "in kBytes (default is 2 MB)")
706 DEFINE_BOOL(log_regs_modified, true,
707             "When logging register values, only print modified registers.")
708 DEFINE_BOOL(log_colour, true, "When logging, try to use coloured output.")
709 DEFINE_BOOL(ignore_asm_unimplemented_break, false,
710             "Don't break for ASM_UNIMPLEMENTED_BREAK macros.")
711 DEFINE_BOOL(trace_sim_messages, false,
712             "Trace simulator debug messages. Implied by --trace-sim.")
713
714 // isolate.cc
715 DEFINE_BOOL(stack_trace_on_illegal, false,
716             "print stack trace when an illegal exception is thrown")
717 DEFINE_BOOL(abort_on_uncaught_exception, false,
718             "abort program (dump core) when an uncaught exception is thrown")
719 DEFINE_BOOL(randomize_hashes, true,
720             "randomize hashes to avoid predictable hash collisions "
721             "(with snapshots this option cannot override the baked-in seed)")
722 DEFINE_INT(hash_seed, 0,
723            "Fixed seed to use to hash property keys (0 means random)"
724            "(with snapshots this option cannot override the baked-in seed)")
725
726 // snapshot-common.cc
727 DEFINE_BOOL(profile_deserialization, false,
728             "Print the time it takes to deserialize the snapshot.")
729
730 // Regexp
731 DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code")
732
733 // Testing flags test/cctest/test-{flags,api,serialization}.cc
734 DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag")
735 DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag")
736 DEFINE_INT(testing_int_flag, 13, "testing_int_flag")
737 DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag")
738 DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag")
739 DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness")
740 #ifdef _WIN32
741 DEFINE_STRING(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
742               "file in which to testing_serialize heap")
743 #else
744 DEFINE_STRING(testing_serialization_file, "/tmp/serdes",
745               "file in which to serialize heap")
746 #endif
747
748 // mksnapshot.cc
749 DEFINE_STRING(startup_blob, NULL,
750               "Write V8 startup blob file. (mksnapshot only)")
751
752 // code-stubs-hydrogen.cc
753 DEFINE_BOOL(profile_hydrogen_code_stub_compilation, false,
754             "Print the time it takes to lazily compile hydrogen code stubs.")
755
756 DEFINE_BOOL(predictable, false, "enable predictable mode")
757 DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation)
758 DEFINE_NEG_IMPLICATION(predictable, concurrent_osr)
759 DEFINE_NEG_IMPLICATION(predictable, concurrent_sweeping)
760
761 // mark-compact.cc
762 DEFINE_BOOL(force_marking_deque_overflows, false,
763             "force overflows of marking deque by reducing it's size "
764             "to 64 words")
765
766 DEFINE_BOOL(stress_compaction, false,
767             "stress the GC compactor to flush out bugs (implies "
768             "--force_marking_deque_overflows)")
769
770 DEFINE_BOOL(manual_evacuation_candidates_selection, false,
771             "Test mode only flag. It allows an unit test to select evacuation "
772             "candidates pages (requires --stress_compaction).")
773
774
775 //
776 // Dev shell flags
777 //
778
779 DEFINE_BOOL(help, false, "Print usage message, including flags, on console")
780 DEFINE_BOOL(dump_counters, false, "Dump counters on exit")
781
782 DEFINE_BOOL(debugger, false, "Enable JavaScript debugger")
783
784 DEFINE_STRING(map_counters, "", "Map counters to a file")
785 DEFINE_ARGS(js_arguments,
786             "Pass all remaining arguments to the script. Alias for \"--\".")
787
788 //
789 // GDB JIT integration flags.
790 //
791 #undef FLAG
792 #ifdef ENABLE_GDB_JIT_INTERFACE
793 #define FLAG FLAG_FULL
794 #else
795 #define FLAG FLAG_READONLY
796 #endif
797
798 DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface")
799 DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects")
800 DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk")
801 DEFINE_STRING(gdbjit_dump_filter, "",
802               "dump only objects containing this substring")
803
804 #ifdef ENABLE_GDB_JIT_INTERFACE
805 DEFINE_IMPLICATION(gdbjit_full, gdbjit)
806 DEFINE_IMPLICATION(gdbjit_dump, gdbjit)
807 #endif
808 DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space)
809
810 //
811 // Debug only flags
812 //
813 #undef FLAG
814 #ifdef DEBUG
815 #define FLAG FLAG_FULL
816 #else
817 #define FLAG FLAG_READONLY
818 #endif
819
820 // checks.cc
821 #ifdef ENABLE_SLOW_DCHECKS
822 DEFINE_BOOL(enable_slow_asserts, false,
823             "enable asserts that are slow to execute")
824 #endif
825
826 // codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc
827 DEFINE_BOOL(print_source, false, "pretty print source code")
828 DEFINE_BOOL(print_builtin_source, false,
829             "pretty print source code for builtins")
830 DEFINE_BOOL(print_ast, false, "print source AST")
831 DEFINE_BOOL(print_builtin_ast, false, "print source AST for builtins")
832 DEFINE_STRING(stop_at, "", "function name where to insert a breakpoint")
833 DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints")
834
835 // compiler.cc
836 DEFINE_BOOL(print_builtin_scopes, false, "print scopes for builtins")
837 DEFINE_BOOL(print_scopes, false, "print scopes")
838
839 // contexts.cc
840 DEFINE_BOOL(trace_contexts, false, "trace contexts operations")
841
842 // heap.cc
843 DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection")
844 DEFINE_BOOL(heap_stats, false, "report heap statistics before and after GC")
845 DEFINE_BOOL(code_stats, false, "report code statistics after GC")
846 DEFINE_BOOL(print_handles, false, "report handles after GC")
847 DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
848
849 // TurboFan debug-only flags.
850 DEFINE_BOOL(print_turbo_replay, false,
851             "print C++ code to recreate TurboFan graphs")
852
853 // objects.cc
854 DEFINE_BOOL(trace_normalization, false,
855             "prints when objects are turned into dictionaries.")
856
857 // runtime.cc
858 DEFINE_BOOL(trace_lazy, false, "trace lazy compilation")
859
860 // spaces.cc
861 DEFINE_BOOL(collect_heap_spill_statistics, false,
862             "report heap spill statistics along with heap_stats "
863             "(requires heap_stats)")
864
865 DEFINE_BOOL(trace_isolates, false, "trace isolate state changes")
866
867 // Regexp
868 DEFINE_BOOL(regexp_possessive_quantifier, false,
869             "enable possessive quantifier syntax for testing")
870 DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
871 DEFINE_BOOL(trace_regexp_assembler, false,
872             "trace regexp macro assembler calls.")
873
874 //
875 // Logging and profiling flags
876 //
877 #undef FLAG
878 #define FLAG FLAG_FULL
879
880 // log.cc
881 DEFINE_BOOL(log, false,
882             "Minimal logging (no API, code, GC, suspect, or handles samples).")
883 DEFINE_BOOL(log_all, false, "Log all events to the log file.")
884 DEFINE_BOOL(log_api, false, "Log API events to the log file.")
885 DEFINE_BOOL(log_code, false,
886             "Log code events to the log file without profiling.")
887 DEFINE_BOOL(log_gc, false,
888             "Log heap samples on garbage collection for the hp2ps tool.")
889 DEFINE_BOOL(log_handles, false, "Log global handle events.")
890 DEFINE_BOOL(log_snapshot_positions, false,
891             "log positions of (de)serialized objects in the snapshot.")
892 DEFINE_BOOL(log_suspect, false, "Log suspect operations.")
893 DEFINE_BOOL(prof, false,
894             "Log statistical profiling information (implies --log-code).")
895 DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.")
896 DEFINE_IMPLICATION(prof, prof_cpp)
897 DEFINE_BOOL(prof_browser_mode, true,
898             "Used with --prof, turns on browser-compatible mode for profiling.")
899 DEFINE_BOOL(log_regexp, false, "Log regular expression execution.")
900 DEFINE_STRING(logfile, "v8.log", "Specify the name of the log file.")
901 DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
902 DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
903 DEFINE_BOOL(perf_basic_prof, false,
904             "Enable perf linux profiler (basic support).")
905 DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
906 DEFINE_BOOL(perf_jit_prof, false,
907             "Enable perf linux profiler (experimental annotate support).")
908 DEFINE_NEG_IMPLICATION(perf_jit_prof, compact_code_space)
909 DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
910               "Specify the name of the file for fake gc mmap used in ll_prof")
911 DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")
912 DEFINE_BOOL(log_timer_events, false,
913             "Time events including external callbacks.")
914 DEFINE_IMPLICATION(log_timer_events, log_internal_timer_events)
915 DEFINE_IMPLICATION(log_internal_timer_events, prof)
916 DEFINE_BOOL(log_instruction_stats, false, "Log AArch64 instruction statistics.")
917 DEFINE_STRING(log_instruction_file, "arm64_inst.csv",
918               "AArch64 instruction statistics log file.")
919 DEFINE_INT(log_instruction_period, 1 << 22,
920            "AArch64 instruction statistics logging period.")
921
922 DEFINE_BOOL(redirect_code_traces, false,
923             "output deopt information and disassembly into file "
924             "code-<pid>-<isolate id>.asm")
925 DEFINE_STRING(redirect_code_traces_to, NULL,
926               "output deopt information and disassembly into the given file")
927
928 DEFINE_BOOL(hydrogen_track_positions, false,
929             "track source code positions when building IR")
930
931 //
932 // Disassembler only flags
933 //
934 #undef FLAG
935 #ifdef ENABLE_DISASSEMBLER
936 #define FLAG FLAG_FULL
937 #else
938 #define FLAG FLAG_READONLY
939 #endif
940
941 // elements.cc
942 DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions")
943
944 DEFINE_BOOL(trace_creation_allocation_sites, false,
945             "trace the creation of allocation sites")
946
947 // code-stubs.cc
948 DEFINE_BOOL(print_code_stubs, false, "print code stubs")
949 DEFINE_BOOL(test_secondary_stub_cache, false,
950             "test secondary stub cache by disabling the primary one")
951
952 DEFINE_BOOL(test_primary_stub_cache, false,
953             "test primary stub cache by disabling the secondary one")
954
955
956 // codegen-ia32.cc / codegen-arm.cc
957 DEFINE_BOOL(print_code, false, "print generated code")
958 DEFINE_BOOL(print_opt_code, false, "print optimized code")
959 DEFINE_BOOL(print_unopt_code, false,
960             "print unoptimized code before "
961             "printing optimized code based on it")
962 DEFINE_BOOL(print_code_verbose, false, "print more information for code")
963 DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins")
964
965 #ifdef ENABLE_DISASSEMBLER
966 DEFINE_BOOL(sodium, false,
967             "print generated code output suitable for use with "
968             "the Sodium code viewer")
969
970 DEFINE_IMPLICATION(sodium, print_code_stubs)
971 DEFINE_IMPLICATION(sodium, print_code)
972 DEFINE_IMPLICATION(sodium, print_opt_code)
973 DEFINE_IMPLICATION(sodium, hydrogen_track_positions)
974 DEFINE_IMPLICATION(sodium, code_comments)
975
976 DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code")
977 DEFINE_IMPLICATION(print_all_code, print_code)
978 DEFINE_IMPLICATION(print_all_code, print_opt_code)
979 DEFINE_IMPLICATION(print_all_code, print_unopt_code)
980 DEFINE_IMPLICATION(print_all_code, print_code_verbose)
981 DEFINE_IMPLICATION(print_all_code, print_builtin_code)
982 DEFINE_IMPLICATION(print_all_code, print_code_stubs)
983 DEFINE_IMPLICATION(print_all_code, code_comments)
984 #ifdef DEBUG
985 DEFINE_IMPLICATION(print_all_code, trace_codegen)
986 #endif
987 #endif
988
989
990 //
991 // VERIFY_PREDICTABLE related flags
992 //
993 #undef FLAG
994
995 #ifdef VERIFY_PREDICTABLE
996 #define FLAG FLAG_FULL
997 #else
998 #define FLAG FLAG_READONLY
999 #endif
1000
1001 DEFINE_BOOL(verify_predictable, false,
1002             "this mode is used for checking that V8 behaves predictably")
1003 DEFINE_INT(dump_allocations_digest_at_alloc, 0,
1004            "dump allocations digest each n-th allocation")
1005
1006
1007 //
1008 // Read-only flags
1009 //
1010 #undef FLAG
1011 #define FLAG FLAG_READONLY
1012
1013 // assembler.h
1014 DEFINE_BOOL(enable_ool_constant_pool, V8_OOL_CONSTANT_POOL,
1015             "enable use of out-of-line constant pools (ARM only)")
1016
1017 DEFINE_BOOL(unbox_double_fields, V8_DOUBLE_FIELDS_UNBOXING,
1018             "enable in-object double fields unboxing (64-bit only)")
1019 DEFINE_IMPLICATION(unbox_double_fields, track_double_fields)
1020
1021
1022 // Cleanup...
1023 #undef FLAG_FULL
1024 #undef FLAG_READONLY
1025 #undef FLAG
1026 #undef FLAG_ALIAS
1027
1028 #undef DEFINE_BOOL
1029 #undef DEFINE_MAYBE_BOOL
1030 #undef DEFINE_INT
1031 #undef DEFINE_STRING
1032 #undef DEFINE_FLOAT
1033 #undef DEFINE_ARGS
1034 #undef DEFINE_IMPLICATION
1035 #undef DEFINE_NEG_IMPLICATION
1036 #undef DEFINE_NEG_VALUE_IMPLICATION
1037 #undef DEFINE_VALUE_IMPLICATION
1038 #undef DEFINE_ALIAS_BOOL
1039 #undef DEFINE_ALIAS_INT
1040 #undef DEFINE_ALIAS_STRING
1041 #undef DEFINE_ALIAS_FLOAT
1042 #undef DEFINE_ALIAS_ARGS
1043
1044 #undef FLAG_MODE_DECLARE
1045 #undef FLAG_MODE_DEFINE
1046 #undef FLAG_MODE_DEFINE_DEFAULTS
1047 #undef FLAG_MODE_META
1048 #undef FLAG_MODE_DEFINE_IMPLICATIONS
1049
1050 #undef COMMA