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