blob: 49f0714dec63d007856ad7a897053bcc231990e9 [file] [log] [blame]
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001// Copyright 2012 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Steve Blocka7e24c12009-10-30 11:49:00 +00004
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
Ben Murdochb8a8cc12014-11-26 15:28:44 +000013#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
Steve Blocka7e24c12009-10-30 11:49:00 +000019// We want to declare the names of the variables for the header file. Normally
20// this will just be an extern declaration, but for a readonly flag we let the
21// compiler make better optimizations by giving it the value.
22#if defined(FLAG_MODE_DECLARE)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000023#define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam;
Steve Blocka7e24c12009-10-30 11:49:00 +000024#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
25 static ctype const FLAG_##nam = def;
26
27// We want to supply the actual storage and value for the flag variable in the
28// .cc file. We only do this for writable flags.
29#elif defined(FLAG_MODE_DEFINE)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000030#define FLAG_FULL(ftype, ctype, nam, def, cmt) ctype FLAG_##nam = def;
Steve Blocka7e24c12009-10-30 11:49:00 +000031
32// We need to define all of our default values so that the Flag structure can
33// access them by pointer. These are just used internally inside of one .cc,
34// for MODE_META, so there is no impact on the flags interface.
35#elif defined(FLAG_MODE_DEFINE_DEFAULTS)
36#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
37 static ctype const FLAGDEFAULT_##nam = def;
Steve Blocka7e24c12009-10-30 11:49:00 +000038
39// We want to write entries into our meta data table, for internal parsing and
40// printing / etc in the flag parser code. We only do this for writable flags.
41#elif defined(FLAG_MODE_META)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000042#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
43 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false } \
44 ,
45#define FLAG_ALIAS(ftype, ctype, alias, nam) \
46 { \
47 Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \
48 "alias for --" #nam, false \
49 } \
50 ,
Ben Murdoch3ef787d2012-04-12 10:51:47 +010051
52// We produce the code to set flags when it is implied by another flag.
53#elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000054#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \
55 if (FLAG_##whenflag) FLAG_##thenflag = value;
Steve Blocka7e24c12009-10-30 11:49:00 +000056
57#else
58#error No mode supplied when including flags.defs
59#endif
60
Ben Murdochb8a8cc12014-11-26 15:28:44 +000061// Dummy defines for modes where it is not relevant.
62#ifndef FLAG_FULL
63#define FLAG_FULL(ftype, ctype, nam, def, cmt)
64#endif
65
66#ifndef FLAG_READONLY
67#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
68#endif
69
70#ifndef FLAG_ALIAS
71#define FLAG_ALIAS(ftype, ctype, alias, nam)
72#endif
73
74#ifndef DEFINE_VALUE_IMPLICATION
75#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value)
76#endif
77
78#define COMMA ,
79
Steve Blocka7e24c12009-10-30 11:49:00 +000080#ifdef FLAG_MODE_DECLARE
81// Structure used to hold a collection of arguments to the JavaScript code.
82struct JSArguments {
Ben Murdochb8a8cc12014-11-26 15:28:44 +000083 public:
84 inline const char*& operator[](int idx) const { return argv[idx]; }
Ben Murdoch3ef787d2012-04-12 10:51:47 +010085 static JSArguments Create(int argc, const char** argv) {
86 JSArguments args;
Ben Murdochb8a8cc12014-11-26 15:28:44 +000087 args.argc = argc;
88 args.argv = argv;
Ben Murdoch3ef787d2012-04-12 10:51:47 +010089 return args;
90 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +000091 int argc;
92 const char** argv;
93};
94
95struct MaybeBoolFlag {
96 static MaybeBoolFlag Create(bool has_value, bool value) {
97 MaybeBoolFlag flag;
98 flag.has_value = has_value;
99 flag.value = value;
100 return flag;
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100101 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000102 bool has_value;
103 bool value;
Steve Blocka7e24c12009-10-30 11:49:00 +0000104};
105#endif
106
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000107#if (defined CAN_USE_VFP3_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
108#define ENABLE_VFP3_DEFAULT true
109#else
110#define ENABLE_VFP3_DEFAULT false
111#endif
112#if (defined CAN_USE_ARMV7_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
113#define ENABLE_ARMV7_DEFAULT true
114#else
115#define ENABLE_ARMV7_DEFAULT false
116#endif
117#if (defined CAN_USE_VFP32DREGS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
118#define ENABLE_32DREGS_DEFAULT true
119#else
120#define ENABLE_32DREGS_DEFAULT false
121#endif
122#if (defined CAN_USE_NEON) || !(defined ARM_TEST_NO_FEATURE_PROBE)
123# define ENABLE_NEON_DEFAULT true
124#else
125# define ENABLE_NEON_DEFAULT false
126#endif
127
128#define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
129#define DEFINE_MAYBE_BOOL(nam, cmt) \
130 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt)
131#define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
132#define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
133#define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
134#define DEFINE_ARGS(nam, cmt) FLAG(ARGS, JSArguments, nam, {0 COMMA NULL}, cmt)
135
136#define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam)
137#define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam)
138#define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam)
139#define DEFINE_ALIAS_STRING(alias, nam) \
140 FLAG_ALIAS(STRING, const char*, alias, nam)
141#define DEFINE_ALIAS_ARGS(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam)
Steve Blocka7e24c12009-10-30 11:49:00 +0000142
143//
144// Flags in all modes.
145//
146#define FLAG FLAG_FULL
147
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100148// Flags for language modes and experimental language features.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000149DEFINE_BOOL(use_strict, false, "enforce strict mode")
150DEFINE_BOOL(es_staging, false, "enable upcoming ES6+ features")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100151
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000152DEFINE_BOOL(harmony_scoping, false, "enable harmony block scoping")
153DEFINE_BOOL(harmony_modules, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100154 "enable harmony modules (implies block scoping)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000155DEFINE_BOOL(harmony_proxies, false, "enable harmony proxies")
156DEFINE_BOOL(harmony_numeric_literals, false,
157 "enable harmony numeric literals (0o77, 0b11)")
158DEFINE_BOOL(harmony_strings, false, "enable harmony string")
159DEFINE_BOOL(harmony_arrays, false, "enable harmony arrays")
160DEFINE_BOOL(harmony_arrow_functions, false, "enable harmony arrow functions")
161DEFINE_BOOL(harmony_classes, false, "enable harmony classes")
162DEFINE_BOOL(harmony_object_literals, false,
163 "enable harmony object literal extensions")
164DEFINE_BOOL(harmony_regexps, false, "enable regexp-related harmony features")
165DEFINE_BOOL(harmony, false, "enable all harmony features (except proxies)")
166
167DEFINE_IMPLICATION(harmony, harmony_scoping)
168DEFINE_IMPLICATION(harmony, harmony_modules)
169// TODO(rossberg): Reenable when problems are sorted out.
170// DEFINE_IMPLICATION(harmony, harmony_proxies)
171DEFINE_IMPLICATION(harmony, harmony_numeric_literals)
172DEFINE_IMPLICATION(harmony, harmony_strings)
173DEFINE_IMPLICATION(harmony, harmony_arrays)
174DEFINE_IMPLICATION(harmony, harmony_arrow_functions)
175DEFINE_IMPLICATION(harmony, harmony_classes)
176DEFINE_IMPLICATION(harmony, harmony_object_literals)
177DEFINE_IMPLICATION(harmony, harmony_regexps)
178DEFINE_IMPLICATION(harmony_modules, harmony_scoping)
179DEFINE_IMPLICATION(harmony_classes, harmony_scoping)
180DEFINE_IMPLICATION(harmony_classes, harmony_object_literals)
181
182DEFINE_IMPLICATION(harmony, es_staging)
Ben Murdoch257744e2011-11-30 15:57:28 +0000183
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000184// Flags for experimental implementation features.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000185DEFINE_BOOL(compiled_keyed_generic_loads, false,
186 "use optimizing compiler to generate keyed generic load stubs")
187DEFINE_BOOL(clever_optimizations, true,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100188 "Optimize object size, Array shift, DOM strings and string +")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000189// TODO(hpayer): We will remove this flag as soon as we have pretenuring
190// support for specific allocation sites.
191DEFINE_BOOL(pretenuring_call_new, false, "pretenure call new")
192DEFINE_BOOL(allocation_site_pretenuring, true,
193 "pretenure with allocation sites")
194DEFINE_BOOL(trace_pretenuring, false,
195 "trace pretenuring decisions of HAllocate instructions")
196DEFINE_BOOL(trace_pretenuring_statistics, false,
197 "trace allocation site pretenuring statistics")
198DEFINE_BOOL(track_fields, true, "track fields with only smi values")
199DEFINE_BOOL(track_double_fields, true, "track fields with double values")
200DEFINE_BOOL(track_heap_object_fields, true, "track fields with heap values")
201DEFINE_BOOL(track_computed_fields, true, "track computed boilerplate fields")
202DEFINE_IMPLICATION(track_double_fields, track_fields)
203DEFINE_IMPLICATION(track_heap_object_fields, track_fields)
204DEFINE_IMPLICATION(track_computed_fields, track_fields)
205DEFINE_BOOL(track_field_types, true, "track field types")
206DEFINE_IMPLICATION(track_field_types, track_fields)
207DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
208DEFINE_BOOL(smi_binop, true, "support smi representation in binary operations")
209DEFINE_BOOL(vector_ics, false, "support vector-based ics")
210
211// Flags for optimization types.
212DEFINE_BOOL(optimize_for_size, false,
213 "Enables optimizations which favor memory size over execution "
214 "speed.")
215
216DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100217
218// Flags for data representation optimizations
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000219DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
220DEFINE_BOOL(string_slices, true, "use string slices")
Ben Murdoch5d4cdbf2012-04-11 10:23:59 +0100221
Ben Murdochb0fe1622011-05-05 13:52:32 +0100222// Flags for Crankshaft.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000223DEFINE_BOOL(crankshaft, true, "use crankshaft")
224DEFINE_STRING(hydrogen_filter, "*", "optimization filter")
225DEFINE_BOOL(use_gvn, true, "use hydrogen global value numbering")
226DEFINE_INT(gvn_iterations, 3, "maximum number of GVN fix-point iterations")
227DEFINE_BOOL(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
228DEFINE_BOOL(use_inlining, true, "use function inlining")
229DEFINE_BOOL(use_escape_analysis, true, "use hydrogen escape analysis")
230DEFINE_BOOL(use_allocation_folding, true, "use allocation folding")
231DEFINE_BOOL(use_local_allocation_folding, false, "only fold in basic blocks")
232DEFINE_BOOL(use_write_barrier_elimination, true,
233 "eliminate write barriers targeting allocations in optimized code")
234DEFINE_INT(max_inlining_levels, 5, "maximum number of inlining levels")
235DEFINE_INT(max_inlined_source_size, 600,
236 "maximum source size in bytes considered for a single inlining")
237DEFINE_INT(max_inlined_nodes, 196,
238 "maximum number of AST nodes considered for a single inlining")
239DEFINE_INT(max_inlined_nodes_cumulative, 400,
240 "maximum cumulative number of AST nodes considered for inlining")
241DEFINE_BOOL(loop_invariant_code_motion, true, "loop invariant code motion")
242DEFINE_BOOL(fast_math, true, "faster (but maybe less accurate) math functions")
243DEFINE_BOOL(collect_megamorphic_maps_from_stub_cache, true,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100244 "crankshaft harvests type feedback from stub cache")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000245DEFINE_BOOL(hydrogen_stats, false, "print statistics for hydrogen")
246DEFINE_BOOL(trace_check_elimination, false, "trace check elimination phase")
247DEFINE_BOOL(trace_hydrogen, false, "trace generated hydrogen to file")
248DEFINE_STRING(trace_hydrogen_filter, "*", "hydrogen tracing filter")
249DEFINE_BOOL(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs")
250DEFINE_STRING(trace_hydrogen_file, NULL, "trace hydrogen to given file name")
251DEFINE_STRING(trace_phase, "HLZ", "trace generated IR for specified phases")
252DEFINE_BOOL(trace_inlining, false, "trace inlining decisions")
253DEFINE_BOOL(trace_load_elimination, false, "trace load elimination")
254DEFINE_BOOL(trace_store_elimination, false, "trace store elimination")
255DEFINE_BOOL(trace_alloc, false, "trace register allocator")
256DEFINE_BOOL(trace_all_uses, false, "trace all use positions")
257DEFINE_BOOL(trace_range, false, "trace range analysis")
258DEFINE_BOOL(trace_gvn, false, "trace global value numbering")
259DEFINE_BOOL(trace_representation, false, "trace representation types")
260DEFINE_BOOL(trace_removable_simulates, false, "trace removable simulates")
261DEFINE_BOOL(trace_escape_analysis, false, "trace hydrogen escape analysis")
262DEFINE_BOOL(trace_allocation_folding, false, "trace allocation folding")
263DEFINE_BOOL(trace_track_allocation_sites, false,
264 "trace the tracking of allocation sites")
265DEFINE_BOOL(trace_migration, false, "trace object migration")
266DEFINE_BOOL(trace_generalization, false, "trace map generalization")
267DEFINE_BOOL(stress_pointer_maps, false, "pointer map for every instruction")
268DEFINE_BOOL(stress_environments, false, "environment for every instruction")
269DEFINE_INT(deopt_every_n_times, 0,
Ben Murdochb0fe1622011-05-05 13:52:32 +0100270 "deoptimize every n times a deopt point is passed")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000271DEFINE_INT(deopt_every_n_garbage_collections, 0,
272 "deoptimize every n garbage collections")
273DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points")
274DEFINE_BOOL(trap_on_deopt, false, "put a break point before deoptimizing")
275DEFINE_BOOL(trap_on_stub_deopt, false,
276 "put a break point before deoptimizing a stub")
277DEFINE_BOOL(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
278DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining")
279DEFINE_BOOL(use_osr, true, "use on-stack replacement")
280DEFINE_BOOL(array_bounds_checks_elimination, true,
281 "perform array bounds checks elimination")
282DEFINE_BOOL(trace_bce, false, "trace array bounds check elimination")
283DEFINE_BOOL(array_bounds_checks_hoisting, false,
284 "perform array bounds checks hoisting")
285DEFINE_BOOL(array_index_dehoisting, true, "perform array index dehoisting")
286DEFINE_BOOL(analyze_environment_liveness, true,
287 "analyze liveness of environment slots and zap dead values")
288DEFINE_BOOL(load_elimination, true, "use load elimination")
289DEFINE_BOOL(check_elimination, true, "use check elimination")
290DEFINE_BOOL(store_elimination, false, "use store elimination")
291DEFINE_BOOL(dead_code_elimination, true, "use dead code elimination")
292DEFINE_BOOL(fold_constants, true, "use constant folding")
293DEFINE_BOOL(trace_dead_code_elimination, false, "trace dead code elimination")
294DEFINE_BOOL(unreachable_code_elimination, true, "eliminate unreachable code")
295DEFINE_BOOL(trace_osr, false, "trace on-stack replacement")
296DEFINE_INT(stress_runs, 0, "number of stress runs")
297DEFINE_BOOL(lookup_sample_by_shared, true,
298 "when picking a function to optimize, watch for shared function "
299 "info, not JSFunction itself")
300DEFINE_BOOL(cache_optimized_code, true, "cache optimized code for closures")
301DEFINE_BOOL(flush_optimized_code_cache, true,
302 "flushes the cache of optimized code for closures on every GC")
303DEFINE_BOOL(inline_construct, true, "inline constructor calls")
304DEFINE_BOOL(inline_arguments, true, "inline functions with arguments object")
305DEFINE_BOOL(inline_accessors, true, "inline JavaScript accessors")
306DEFINE_INT(escape_analysis_iterations, 2,
307 "maximum number of escape analysis fix-point iterations")
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100308
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000309DEFINE_BOOL(optimize_for_in, true, "optimize functions containing for-in loops")
310DEFINE_BOOL(opt_safe_uint32_operations, true,
311 "allow uint32 values on optimize frames if they are used only in "
312 "safe operations")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100313
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000314DEFINE_BOOL(concurrent_recompilation, true,
315 "optimizing hot functions asynchronously on a separate thread")
316DEFINE_BOOL(trace_concurrent_recompilation, false,
317 "track concurrent recompilation")
318DEFINE_INT(concurrent_recompilation_queue_length, 8,
319 "the length of the concurrent compilation queue")
320DEFINE_INT(concurrent_recompilation_delay, 0,
321 "artificial compilation delay in ms")
322DEFINE_BOOL(block_concurrent_recompilation, false,
323 "block queued jobs until released")
324DEFINE_BOOL(concurrent_osr, true, "concurrent on-stack replacement")
325DEFINE_IMPLICATION(concurrent_osr, concurrent_recompilation)
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100326
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000327DEFINE_BOOL(omit_map_checks_for_leaf_maps, true,
328 "do not emit check maps for constant values that have a leaf map, "
329 "deoptimize the optimized code if the layout of the maps changes.")
330
331// Flags for TurboFan.
332DEFINE_STRING(turbo_filter, "~", "optimization filter for TurboFan compiler")
333DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR")
334DEFINE_BOOL(trace_turbo_types, true, "trace generated TurboFan types")
335DEFINE_BOOL(trace_turbo_scheduler, false, "trace generated TurboFan scheduler")
336DEFINE_BOOL(turbo_asm, false, "enable TurboFan for asm.js code")
337DEFINE_BOOL(turbo_verify, false, "verify TurboFan graphs at each phase")
338DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
339#if V8_TURBOFAN_BACKEND
340DEFINE_BOOL(turbo_types, true, "use typed lowering in TurboFan")
341#else
342DEFINE_BOOL(turbo_types, false, "use typed lowering in TurboFan")
343#endif
344DEFINE_BOOL(turbo_source_positions, false,
345 "track source code positions when building TurboFan IR")
346DEFINE_BOOL(context_specialization, false,
347 "enable context specialization in TurboFan")
348DEFINE_BOOL(turbo_deoptimization, false, "enable deoptimization in TurboFan")
349DEFINE_BOOL(turbo_inlining, false, "enable inlining in TurboFan")
350DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
351DEFINE_IMPLICATION(turbo_inlining, turbo_types)
352
353DEFINE_INT(typed_array_max_size_in_heap, 64,
354 "threshold for in-heap typed array")
355
356// Profiler flags.
357DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
358// 0x1800 fits in the immediate field of an ARM instruction.
359DEFINE_INT(interrupt_budget, 0x1800,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100360 "execution budget before interrupt is triggered")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000361DEFINE_INT(type_info_threshold, 25,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100362 "percentage of ICs that must have type info to allow optimization")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000363DEFINE_INT(generic_ic_threshold, 30,
364 "max percentage of megamorphic/generic ICs to allow optimization")
365DEFINE_INT(self_opt_count, 130, "call count before self-optimization")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100366
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000367DEFINE_BOOL(trace_opt_verbose, false, "extra verbose compilation tracing")
368DEFINE_IMPLICATION(trace_opt_verbose, trace_opt)
Ben Murdochb0fe1622011-05-05 13:52:32 +0100369
Steve Block3ce2e202009-11-05 08:53:23 +0000370// assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000371DEFINE_BOOL(debug_code, false, "generate extra code (assertions) for debugging")
372DEFINE_BOOL(code_comments, false, "emit comments in code disassembly")
373DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available")
374DEFINE_BOOL(enable_sse4_1, true,
Ben Murdochf87a2032010-10-22 12:50:53 +0100375 "enable use of SSE4.1 instructions if available")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000376DEFINE_BOOL(enable_sahf, true,
Steve Block3ce2e202009-11-05 08:53:23 +0000377 "enable use of SAHF instruction if available (X64 only)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000378DEFINE_BOOL(enable_vfp3, ENABLE_VFP3_DEFAULT,
379 "enable use of VFP3 instructions if available")
380DEFINE_BOOL(enable_armv7, ENABLE_ARMV7_DEFAULT,
Andrei Popescu31002712010-02-23 13:46:05 +0000381 "enable use of ARMv7 instructions if available (ARM only)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000382DEFINE_BOOL(enable_neon, ENABLE_NEON_DEFAULT,
383 "enable use of NEON instructions if available (ARM only)")
384DEFINE_BOOL(enable_sudiv, true,
385 "enable use of SDIV and UDIV instructions if available (ARM only)")
386DEFINE_BOOL(enable_mls, true,
387 "enable use of MLS instructions if available (ARM only)")
388DEFINE_BOOL(enable_movw_movt, false,
389 "enable loading 32-bit constant by means of movw/movt "
390 "instruction pairs (ARM only)")
391DEFINE_BOOL(enable_unaligned_accesses, true,
392 "enable unaligned accesses for ARMv7 (ARM only)")
393DEFINE_BOOL(enable_32dregs, ENABLE_32DREGS_DEFAULT,
394 "enable use of d16-d31 registers on ARM - this requires VFP3")
395DEFINE_BOOL(enable_vldr_imm, false,
396 "enable use of constant pools for double immediate (ARM only)")
397DEFINE_BOOL(force_long_branches, false,
398 "force all emitted branches to be in long mode (MIPS only)")
399
400// cpu-arm64.cc
401DEFINE_BOOL(enable_always_align_csp, true,
402 "enable alignment of csp to 16 bytes on platforms which prefer "
403 "the register to always be aligned (ARM64 only)")
Steve Blocka7e24c12009-10-30 11:49:00 +0000404
405// bootstrapper.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000406DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object")
407DEFINE_STRING(expose_debug_as, NULL, "expose debug in global object")
408DEFINE_BOOL(expose_free_buffer, false, "expose freeBuffer extension")
409DEFINE_BOOL(expose_gc, false, "expose gc extension")
410DEFINE_STRING(expose_gc_as, NULL,
411 "expose gc extension under the specified name")
412DEFINE_IMPLICATION(expose_gc_as, expose_gc)
413DEFINE_BOOL(expose_externalize_string, false,
Kristian Monsen9dcf7e22010-06-28 14:14:28 +0100414 "expose externalize string extension")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000415DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension")
416DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture")
417DEFINE_BOOL(builtins_in_stack_traces, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100418 "show built-in functions in stack traces")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000419DEFINE_BOOL(disable_native_files, false, "disable builtin natives files")
Steve Blocka7e24c12009-10-30 11:49:00 +0000420
421// builtins-ia32.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000422DEFINE_BOOL(inline_new, true, "use fast inline allocation")
Steve Blocka7e24c12009-10-30 11:49:00 +0000423
424// codegen-ia32.cc / codegen-arm.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000425DEFINE_BOOL(trace_codegen, false,
426 "print name of functions for which code is generated")
427DEFINE_BOOL(trace, false, "trace function calls")
428DEFINE_BOOL(mask_constants_with_cookie, true,
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -0800429 "use random jit cookie to mask large constants")
Steve Blocka7e24c12009-10-30 11:49:00 +0000430
431// codegen.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000432DEFINE_BOOL(lazy, true, "use lazy compilation")
433DEFINE_BOOL(trace_opt, false, "trace lazy optimization")
434DEFINE_BOOL(trace_opt_stats, false, "trace lazy optimization statistics")
435DEFINE_BOOL(opt, true, "use adaptive optimizations")
436DEFINE_BOOL(always_opt, false, "always try to optimize functions")
437DEFINE_BOOL(always_osr, false, "always try to OSR functions")
438DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt")
439DEFINE_BOOL(trace_deopt, false, "trace optimize function deoptimization")
440DEFINE_BOOL(trace_stub_failures, false,
441 "trace deoptimization of generated code stubs")
442
443DEFINE_BOOL(serialize_toplevel, false, "enable caching of toplevel scripts")
444DEFINE_BOOL(trace_code_serializer, false, "trace code serializer")
Steve Blocka7e24c12009-10-30 11:49:00 +0000445
446// compiler.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000447DEFINE_INT(min_preparse_length, 1024,
Steve Block3ce2e202009-11-05 08:53:23 +0000448 "minimum length for automatic enable preparsing")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000449DEFINE_INT(max_opt_count, 10,
450 "maximum number of optimization attempts before giving up.")
Steve Blocka7e24c12009-10-30 11:49:00 +0000451
452// compilation-cache.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000453DEFINE_BOOL(compilation_cache, true, "enable compilation cache")
Steve Blocka7e24c12009-10-30 11:49:00 +0000454
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000455DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions")
456
457// cpu-profiler.cc
458DEFINE_INT(cpu_profiler_sampling_interval, 1000,
459 "CPU profiler sampling interval in microseconds")
Steve Block053d10c2011-06-13 19:13:29 +0100460
Steve Blocka7e24c12009-10-30 11:49:00 +0000461// debug.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000462DEFINE_BOOL(trace_debug_json, false, "trace debugging JSON request/response")
463DEFINE_BOOL(trace_js_array_abuse, false,
464 "trace out-of-bounds accesses to JS arrays")
465DEFINE_BOOL(trace_external_array_abuse, false,
466 "trace out-of-bounds-accesses to external arrays")
467DEFINE_BOOL(trace_array_abuse, false,
468 "trace out-of-bounds accesses to all arrays")
469DEFINE_IMPLICATION(trace_array_abuse, trace_js_array_abuse)
470DEFINE_IMPLICATION(trace_array_abuse, trace_external_array_abuse)
471DEFINE_BOOL(enable_liveedit, true, "enable liveedit experimental feature")
472DEFINE_BOOL(hard_abort, true, "abort by crashing")
Steve Blocka7e24c12009-10-30 11:49:00 +0000473
Steve Block1e0659c2011-05-24 12:43:12 +0100474// execution.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000475DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100476 "default size of stack region v8 is allowed to use (in kBytes)")
Steve Block1e0659c2011-05-24 12:43:12 +0100477
Steve Blocka7e24c12009-10-30 11:49:00 +0000478// frames.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000479DEFINE_INT(max_stack_trace_source_length, 300,
Steve Blocka7e24c12009-10-30 11:49:00 +0000480 "maximum length of function source code printed in a stack trace.")
481
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100482// full-codegen.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000483DEFINE_BOOL(always_inline_smi_code, false,
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100484 "always inline smi code in non-opt code")
485
Steve Blocka7e24c12009-10-30 11:49:00 +0000486// heap.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000487DEFINE_INT(min_semi_space_size, 0,
488 "min size of a semi-space (in MBytes), the new space consists of two"
489 "semi-spaces")
490DEFINE_INT(max_semi_space_size, 0,
491 "max size of a semi-space (in MBytes), the new space consists of two"
492 "semi-spaces")
493DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)")
494DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
495DEFINE_BOOL(gc_global, false, "always perform global GCs")
496DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
497DEFINE_BOOL(trace_gc, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000498 "print one trace line following each garbage collection")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000499DEFINE_BOOL(trace_gc_nvp, false,
Leon Clarkef7060e22010-06-03 12:02:55 +0100500 "print one detailed trace line in name=value format "
501 "after each garbage collection")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000502DEFINE_BOOL(trace_gc_ignore_scavenger, false,
503 "do not print trace line after scavenger collection")
504DEFINE_BOOL(trace_idle_notification, false,
505 "print one trace line following each idle notification")
506DEFINE_BOOL(print_cumulative_gc_stat, false,
Leon Clarkef7060e22010-06-03 12:02:55 +0100507 "print cumulative GC statistics in name=value format on exit")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000508DEFINE_BOOL(print_max_heap_committed, false,
509 "print statistics of the maximum memory committed for the heap "
510 "in name=value format on exit")
511DEFINE_BOOL(trace_gc_verbose, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000512 "print more details following each garbage collection")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000513DEFINE_BOOL(trace_fragmentation, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100514 "report fragmentation for old pointer and data pages")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000515DEFINE_BOOL(collect_maps, true,
Steve Blocka7e24c12009-10-30 11:49:00 +0000516 "garbage collect maps from which no objects can be reached")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000517DEFINE_BOOL(weak_embedded_maps_in_ic, true,
518 "make maps embedded in inline cache stubs")
519DEFINE_BOOL(weak_embedded_maps_in_optimized_code, true,
520 "make maps embedded in optimized code weak")
521DEFINE_BOOL(weak_embedded_objects_in_optimized_code, true,
522 "make objects embedded in optimized code weak")
523DEFINE_BOOL(flush_code, true,
524 "flush code that we expect not to use again (during full gc)")
525DEFINE_BOOL(flush_code_incrementally, true,
526 "flush code that we expect not to use again (incrementally)")
527DEFINE_BOOL(trace_code_flushing, false, "trace code flushing progress")
528DEFINE_BOOL(age_code, true,
529 "track un-executed functions to age code and flush only "
530 "old code (required for code flushing)")
531DEFINE_BOOL(incremental_marking, true, "use incremental marking")
532DEFINE_BOOL(incremental_marking_steps, true, "do incremental marking steps")
533DEFINE_BOOL(trace_incremental_marking, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100534 "trace progress of the incremental marking")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000535DEFINE_BOOL(track_gc_object_stats, false,
536 "track object counts and memory usage")
537DEFINE_BOOL(parallel_sweeping, false, "enable parallel sweeping")
538DEFINE_BOOL(concurrent_sweeping, true, "enable concurrent sweeping")
539DEFINE_INT(sweeper_threads, 0,
540 "number of parallel and concurrent sweeping threads")
541DEFINE_BOOL(job_based_sweeping, true, "enable job based sweeping")
542#ifdef VERIFY_HEAP
543DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC")
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100544#endif
545
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000546
547// heap-snapshot-generator.cc
548DEFINE_BOOL(heap_profiler_trace_objects, false,
549 "Dump heap object allocations/movements/size_updates")
550
551
552// v8.cc
553DEFINE_BOOL(use_idle_notification, true,
554 "Use idle notification to reduce memory footprint.")
555// ic.cc
556DEFINE_BOOL(use_ic, true, "use inline caching")
557DEFINE_BOOL(trace_ic, false, "trace inline cache state transitions")
558
Steve Blocka7e24c12009-10-30 11:49:00 +0000559// macro-assembler-ia32.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000560DEFINE_BOOL(native_code_counters, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000561 "generate extra code for manipulating stats counters")
562
563// mark-compact.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000564DEFINE_BOOL(always_compact, false, "Perform compaction on every full GC")
565DEFINE_BOOL(never_compact, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000566 "Never perform compaction on full GC - testing only")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000567DEFINE_BOOL(compact_code_space, true,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100568 "Compact code space on full non-incremental collections")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000569DEFINE_BOOL(incremental_code_compaction, true,
570 "Compact code space on full incremental collections")
571DEFINE_BOOL(cleanup_code_caches_at_gc, true,
Ben Murdoch257744e2011-11-30 15:57:28 +0000572 "Flush inline caches prior to mark compact collection and "
573 "flush code caches in maps during mark compact cycle.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000574DEFINE_BOOL(use_marking_progress_bar, true,
575 "Use a progress bar to scan large objects in increments when "
576 "incremental marking is active.")
577DEFINE_BOOL(zap_code_space, true,
578 "Zap free memory in code space with 0xCC while sweeping.")
579DEFINE_INT(random_seed, 0,
Steve Block6ded16b2010-05-10 14:33:55 +0100580 "Default seed for initializing random generator "
581 "(0, the default, means to use system random).")
Steve Blocka7e24c12009-10-30 11:49:00 +0000582
Ben Murdochb0fe1622011-05-05 13:52:32 +0100583// objects.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000584DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
Ben Murdochb0fe1622011-05-05 13:52:32 +0100585
Steve Blocka7e24c12009-10-30 11:49:00 +0000586// parser.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000587DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
588DEFINE_BOOL(trace_parse, false, "trace parsing and preparsing")
Steve Blocka7e24c12009-10-30 11:49:00 +0000589
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000590// simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc
591DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
592DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator")
593DEFINE_BOOL(check_icache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100594 "Check icache flushes in ARM and MIPS simulator")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000595DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions")
596#if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64)
597DEFINE_INT(sim_stack_alignment, 16,
598 "Stack alignment in bytes in simulator. This must be a power of two "
599 "and it must be at least 16. 16 is default.")
600#else
601DEFINE_INT(sim_stack_alignment, 8,
Steve Block6ded16b2010-05-10 14:33:55 +0100602 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000603#endif
604DEFINE_INT(sim_stack_size, 2 * MB / KB,
605 "Stack size of the ARM64 and MIPS64 simulator "
606 "in kBytes (default is 2 MB)")
607DEFINE_BOOL(log_regs_modified, true,
608 "When logging register values, only print modified registers.")
609DEFINE_BOOL(log_colour, true, "When logging, try to use coloured output.")
610DEFINE_BOOL(ignore_asm_unimplemented_break, false,
611 "Don't break for ASM_UNIMPLEMENTED_BREAK macros.")
612DEFINE_BOOL(trace_sim_messages, false,
613 "Trace simulator debug messages. Implied by --trace-sim.")
Steve Blocka7e24c12009-10-30 11:49:00 +0000614
Ben Murdoch257744e2011-11-30 15:57:28 +0000615// isolate.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000616DEFINE_BOOL(stack_trace_on_illegal, false,
617 "print stack trace when an illegal exception is thrown")
618DEFINE_BOOL(abort_on_uncaught_exception, false,
619 "abort program (dump core) when an uncaught exception is thrown")
620DEFINE_BOOL(randomize_hashes, true,
Ben Murdochc7cc0282012-03-05 14:35:55 +0000621 "randomize hashes to avoid predictable hash collisions "
622 "(with snapshots this option cannot override the baked-in seed)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000623DEFINE_INT(hash_seed, 0,
Ben Murdochc7cc0282012-03-05 14:35:55 +0000624 "Fixed seed to use to hash property keys (0 means random)"
625 "(with snapshots this option cannot override the baked-in seed)")
Steve Blocka7e24c12009-10-30 11:49:00 +0000626
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000627// snapshot-common.cc
628DEFINE_BOOL(profile_deserialization, false,
629 "Print the time it takes to deserialize the snapshot.")
Steve Blocka7e24c12009-10-30 11:49:00 +0000630
631// Regexp
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000632DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code")
Steve Blocka7e24c12009-10-30 11:49:00 +0000633
634// Testing flags test/cctest/test-{flags,api,serialization}.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000635DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag")
636DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag")
637DEFINE_INT(testing_int_flag, 13, "testing_int_flag")
638DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag")
639DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag")
640DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness")
641#ifdef _WIN32
642DEFINE_STRING(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
Steve Blocka7e24c12009-10-30 11:49:00 +0000643 "file in which to testing_serialize heap")
644#else
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000645DEFINE_STRING(testing_serialization_file, "/tmp/serdes",
Steve Blocka7e24c12009-10-30 11:49:00 +0000646 "file in which to serialize heap")
647#endif
648
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000649// mksnapshot.cc
650DEFINE_STRING(extra_code, NULL,
651 "A filename with extra code to be included in"
652 " the snapshot (mksnapshot only)")
653DEFINE_STRING(raw_file, NULL,
654 "A file to write the raw snapshot bytes to. "
655 "(mksnapshot only)")
656DEFINE_STRING(raw_context_file, NULL,
657 "A file to write the raw context "
658 "snapshot bytes to. (mksnapshot only)")
659DEFINE_STRING(startup_blob, NULL,
660 "Write V8 startup blob file. "
661 "(mksnapshot only)")
662
663// code-stubs-hydrogen.cc
664DEFINE_BOOL(profile_hydrogen_code_stub_compilation, false,
665 "Print the time it takes to lazily compile hydrogen code stubs.")
666
667DEFINE_BOOL(predictable, false, "enable predictable mode")
668DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation)
669DEFINE_NEG_IMPLICATION(predictable, concurrent_osr)
670DEFINE_NEG_IMPLICATION(predictable, concurrent_sweeping)
671DEFINE_NEG_IMPLICATION(predictable, parallel_sweeping)
672
673
Steve Blocka7e24c12009-10-30 11:49:00 +0000674//
675// Dev shell flags
676//
677
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000678DEFINE_BOOL(help, false, "Print usage message, including flags, on console")
679DEFINE_BOOL(dump_counters, false, "Dump counters on exit")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100680
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000681DEFINE_BOOL(debugger, false, "Enable JavaScript debugger")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100682
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000683DEFINE_STRING(map_counters, "", "Map counters to a file")
684DEFINE_ARGS(js_arguments,
Steve Blocka7e24c12009-10-30 11:49:00 +0000685 "Pass all remaining arguments to the script. Alias for \"--\".")
686
Ben Murdochb8e0da22011-05-16 14:20:40 +0100687//
688// GDB JIT integration flags.
689//
690
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000691DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface (disables compacting GC)")
692DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects")
693DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk")
694DEFINE_STRING(gdbjit_dump_filter, "",
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000695 "dump only objects containing this substring")
Ben Murdochb8e0da22011-05-16 14:20:40 +0100696
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100697// mark-compact.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000698DEFINE_BOOL(force_marking_deque_overflows, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100699 "force overflows of marking deque by reducing it's size "
700 "to 64 words")
701
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000702DEFINE_BOOL(stress_compaction, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100703 "stress the GC compactor to flush out bugs (implies "
704 "--force_marking_deque_overflows)")
705
Steve Blocka7e24c12009-10-30 11:49:00 +0000706//
707// Debug only flags
708//
709#undef FLAG
710#ifdef DEBUG
711#define FLAG FLAG_FULL
712#else
713#define FLAG FLAG_READONLY
714#endif
715
716// checks.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000717#ifdef ENABLE_SLOW_DCHECKS
718DEFINE_BOOL(enable_slow_asserts, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000719 "enable asserts that are slow to execute")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000720#endif
Steve Blocka7e24c12009-10-30 11:49:00 +0000721
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000722// codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc
723DEFINE_BOOL(print_source, false, "pretty print source code")
724DEFINE_BOOL(print_builtin_source, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000725 "pretty print source code for builtins")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000726DEFINE_BOOL(print_ast, false, "print source AST")
727DEFINE_BOOL(print_builtin_ast, false, "print source AST for builtins")
728DEFINE_STRING(stop_at, "", "function name where to insert a breakpoint")
729DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints")
Steve Blocka7e24c12009-10-30 11:49:00 +0000730
731// compiler.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000732DEFINE_BOOL(print_builtin_scopes, false, "print scopes for builtins")
733DEFINE_BOOL(print_scopes, false, "print scopes")
Steve Blocka7e24c12009-10-30 11:49:00 +0000734
735// contexts.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000736DEFINE_BOOL(trace_contexts, false, "trace contexts operations")
Steve Blocka7e24c12009-10-30 11:49:00 +0000737
738// heap.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000739DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection")
740DEFINE_BOOL(heap_stats, false, "report heap statistics before and after GC")
741DEFINE_BOOL(code_stats, false, "report code statistics after GC")
742DEFINE_BOOL(verify_native_context_separation, false,
743 "verify that code holds on to at most one native context after GC")
744DEFINE_BOOL(print_handles, false, "report handles after GC")
745DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
Steve Blocka7e24c12009-10-30 11:49:00 +0000746
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000747// TurboFan debug-only flags.
748DEFINE_BOOL(print_turbo_replay, false,
749 "print C++ code to recreate TurboFan graphs")
Steve Blocka7e24c12009-10-30 11:49:00 +0000750
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100751// interface.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000752DEFINE_BOOL(print_interfaces, false, "print interfaces")
753DEFINE_BOOL(print_interface_details, false, "print interface inference details")
754DEFINE_INT(print_interface_depth, 5, "depth for printing interfaces")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100755
Steve Blocka7e24c12009-10-30 11:49:00 +0000756// objects.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000757DEFINE_BOOL(trace_normalization, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000758 "prints when objects are turned into dictionaries.")
759
760// runtime.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000761DEFINE_BOOL(trace_lazy, false, "trace lazy compilation")
Steve Blocka7e24c12009-10-30 11:49:00 +0000762
Steve Blocka7e24c12009-10-30 11:49:00 +0000763// spaces.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000764DEFINE_BOOL(collect_heap_spill_statistics, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000765 "report heap spill statistics along with heap_stats "
766 "(requires heap_stats)")
767
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000768DEFINE_BOOL(trace_isolates, false, "trace isolate state changes")
Ben Murdochb0fe1622011-05-05 13:52:32 +0100769
Steve Blocka7e24c12009-10-30 11:49:00 +0000770// Regexp
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000771DEFINE_BOOL(regexp_possessive_quantifier, false,
Leon Clarkee46be812010-01-19 14:06:41 +0000772 "enable possessive quantifier syntax for testing")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000773DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
774DEFINE_BOOL(trace_regexp_assembler, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000775 "trace regexp macro assembler calls.")
776
777//
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000778// Logging and profiling flags
Steve Blocka7e24c12009-10-30 11:49:00 +0000779//
780#undef FLAG
Steve Blocka7e24c12009-10-30 11:49:00 +0000781#define FLAG FLAG_FULL
Steve Blocka7e24c12009-10-30 11:49:00 +0000782
783// log.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000784DEFINE_BOOL(log, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000785 "Minimal logging (no API, code, GC, suspect, or handles samples).")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000786DEFINE_BOOL(log_all, false, "Log all events to the log file.")
787DEFINE_BOOL(log_api, false, "Log API events to the log file.")
788DEFINE_BOOL(log_code, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000789 "Log code events to the log file without profiling.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000790DEFINE_BOOL(log_gc, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000791 "Log heap samples on garbage collection for the hp2ps tool.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000792DEFINE_BOOL(log_handles, false, "Log global handle events.")
793DEFINE_BOOL(log_snapshot_positions, false,
Leon Clarkee46be812010-01-19 14:06:41 +0000794 "log positions of (de)serialized objects in the snapshot.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000795DEFINE_BOOL(log_suspect, false, "Log suspect operations.")
796DEFINE_BOOL(prof, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000797 "Log statistical profiling information (implies --log-code).")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000798DEFINE_BOOL(prof_browser_mode, true,
Steve Block6ded16b2010-05-10 14:33:55 +0100799 "Used with --prof, turns on browser-compatible mode for profiling.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000800DEFINE_BOOL(log_regexp, false, "Log regular expression execution.")
801DEFINE_STRING(logfile, "v8.log", "Specify the name of the log file.")
802DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
803DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
804DEFINE_BOOL(perf_basic_prof, false,
805 "Enable perf linux profiler (basic support).")
806DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
807DEFINE_BOOL(perf_jit_prof, false,
808 "Enable perf linux profiler (experimental annotate support).")
809DEFINE_NEG_IMPLICATION(perf_jit_prof, compact_code_space)
810DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
811 "Specify the name of the file for fake gc mmap used in ll_prof")
812DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")
813DEFINE_BOOL(log_timer_events, false,
814 "Time events including external callbacks.")
815DEFINE_IMPLICATION(log_timer_events, log_internal_timer_events)
816DEFINE_IMPLICATION(log_internal_timer_events, prof)
817DEFINE_BOOL(log_instruction_stats, false, "Log AArch64 instruction statistics.")
818DEFINE_STRING(log_instruction_file, "arm64_inst.csv",
819 "AArch64 instruction statistics log file.")
820DEFINE_INT(log_instruction_period, 1 << 22,
821 "AArch64 instruction statistics logging period.")
822
823DEFINE_BOOL(redirect_code_traces, false,
824 "output deopt information and disassembly into file "
825 "code-<pid>-<isolate id>.asm")
826DEFINE_STRING(redirect_code_traces_to, NULL,
827 "output deopt information and disassembly into the given file")
828
829DEFINE_BOOL(hydrogen_track_positions, false,
830 "track source code positions when building IR")
Steve Blocka7e24c12009-10-30 11:49:00 +0000831
832//
Steve Blocka7e24c12009-10-30 11:49:00 +0000833// Disassembler only flags
834//
835#undef FLAG
836#ifdef ENABLE_DISASSEMBLER
837#define FLAG FLAG_FULL
838#else
839#define FLAG FLAG_READONLY
840#endif
841
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100842// elements.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000843DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions")
844
845DEFINE_BOOL(trace_creation_allocation_sites, false,
846 "trace the creation of allocation sites")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100847
Steve Blocka7e24c12009-10-30 11:49:00 +0000848// code-stubs.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000849DEFINE_BOOL(print_code_stubs, false, "print code stubs")
850DEFINE_BOOL(test_secondary_stub_cache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100851 "test secondary stub cache by disabling the primary one")
852
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000853DEFINE_BOOL(test_primary_stub_cache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100854 "test primary stub cache by disabling the secondary one")
Steve Blocka7e24c12009-10-30 11:49:00 +0000855
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000856
Steve Blocka7e24c12009-10-30 11:49:00 +0000857// codegen-ia32.cc / codegen-arm.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000858DEFINE_BOOL(print_code, false, "print generated code")
859DEFINE_BOOL(print_opt_code, false, "print optimized code")
860DEFINE_BOOL(print_unopt_code, false,
861 "print unoptimized code before "
Ben Murdochb0fe1622011-05-05 13:52:32 +0100862 "printing optimized code based on it")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000863DEFINE_BOOL(print_code_verbose, false, "print more information for code")
864DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins")
Steve Blocka7e24c12009-10-30 11:49:00 +0000865
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100866#ifdef ENABLE_DISASSEMBLER
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000867DEFINE_BOOL(sodium, false,
868 "print generated code output suitable for use with "
869 "the Sodium code viewer")
870
871DEFINE_IMPLICATION(sodium, print_code_stubs)
872DEFINE_IMPLICATION(sodium, print_code)
873DEFINE_IMPLICATION(sodium, print_opt_code)
874DEFINE_IMPLICATION(sodium, hydrogen_track_positions)
875DEFINE_IMPLICATION(sodium, code_comments)
876
877DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code")
878DEFINE_IMPLICATION(print_all_code, print_code)
879DEFINE_IMPLICATION(print_all_code, print_opt_code)
880DEFINE_IMPLICATION(print_all_code, print_unopt_code)
881DEFINE_IMPLICATION(print_all_code, print_code_verbose)
882DEFINE_IMPLICATION(print_all_code, print_builtin_code)
883DEFINE_IMPLICATION(print_all_code, print_code_stubs)
884DEFINE_IMPLICATION(print_all_code, code_comments)
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100885#ifdef DEBUG
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000886DEFINE_IMPLICATION(print_all_code, trace_codegen)
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100887#endif
888#endif
889
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000890
891//
892// VERIFY_PREDICTABLE related flags
893//
894#undef FLAG
895
896#ifdef VERIFY_PREDICTABLE
897#define FLAG FLAG_FULL
898#else
899#define FLAG FLAG_READONLY
900#endif
901
902DEFINE_BOOL(verify_predictable, false,
903 "this mode is used for checking that V8 behaves predictably")
904DEFINE_INT(dump_allocations_digest_at_alloc, 0,
905 "dump allocations digest each n-th allocation")
906
907
908//
909// Read-only flags
910//
911#undef FLAG
912#define FLAG FLAG_READONLY
913
914// assembler-arm.h
915DEFINE_BOOL(enable_ool_constant_pool, V8_OOL_CONSTANT_POOL,
916 "enable use of out-of-line constant pools (ARM only)")
917
Steve Blocka7e24c12009-10-30 11:49:00 +0000918// Cleanup...
919#undef FLAG_FULL
920#undef FLAG_READONLY
921#undef FLAG
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000922#undef FLAG_ALIAS
Steve Blocka7e24c12009-10-30 11:49:00 +0000923
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000924#undef DEFINE_BOOL
925#undef DEFINE_MAYBE_BOOL
926#undef DEFINE_INT
927#undef DEFINE_STRING
928#undef DEFINE_FLOAT
929#undef DEFINE_ARGS
930#undef DEFINE_IMPLICATION
931#undef DEFINE_NEG_IMPLICATION
932#undef DEFINE_VALUE_IMPLICATION
933#undef DEFINE_ALIAS_BOOL
934#undef DEFINE_ALIAS_INT
935#undef DEFINE_ALIAS_STRING
936#undef DEFINE_ALIAS_FLOAT
937#undef DEFINE_ALIAS_ARGS
Steve Blocka7e24c12009-10-30 11:49:00 +0000938
939#undef FLAG_MODE_DECLARE
940#undef FLAG_MODE_DEFINE
941#undef FLAG_MODE_DEFINE_DEFAULTS
942#undef FLAG_MODE_META
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100943#undef FLAG_MODE_DEFINE_IMPLICATIONS
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000944
945#undef COMMA