blob: 841d326918f2c5d0e0ee81a876bf425b9466dfdf [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
Emily Bernierd0a1eb72015-03-24 16:35:39 -040019#define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \
20 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false)
21
Steve Blocka7e24c12009-10-30 11:49:00 +000022// We want to declare the names of the variables for the header file. Normally
23// this will just be an extern declaration, but for a readonly flag we let the
24// compiler make better optimizations by giving it the value.
25#if defined(FLAG_MODE_DECLARE)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000026#define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam;
Steve Blocka7e24c12009-10-30 11:49:00 +000027#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
28 static ctype const FLAG_##nam = def;
29
30// We want to supply the actual storage and value for the flag variable in the
31// .cc file. We only do this for writable flags.
32#elif defined(FLAG_MODE_DEFINE)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000033#define FLAG_FULL(ftype, ctype, nam, def, cmt) ctype FLAG_##nam = def;
Steve Blocka7e24c12009-10-30 11:49:00 +000034
35// We need to define all of our default values so that the Flag structure can
36// access them by pointer. These are just used internally inside of one .cc,
37// for MODE_META, so there is no impact on the flags interface.
38#elif defined(FLAG_MODE_DEFINE_DEFAULTS)
39#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
40 static ctype const FLAGDEFAULT_##nam = def;
Steve Blocka7e24c12009-10-30 11:49:00 +000041
42// We want to write entries into our meta data table, for internal parsing and
43// printing / etc in the flag parser code. We only do this for writable flags.
44#elif defined(FLAG_MODE_META)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000045#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
46 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false } \
47 ,
48#define FLAG_ALIAS(ftype, ctype, alias, nam) \
49 { \
50 Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \
51 "alias for --" #nam, false \
52 } \
53 ,
Ben Murdoch3ef787d2012-04-12 10:51:47 +010054
55// We produce the code to set flags when it is implied by another flag.
56#elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
Ben Murdochb8a8cc12014-11-26 15:28:44 +000057#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \
58 if (FLAG_##whenflag) FLAG_##thenflag = value;
Steve Blocka7e24c12009-10-30 11:49:00 +000059
Emily Bernierd0a1eb72015-03-24 16:35:39 -040060#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \
61 if (!FLAG_##whenflag) FLAG_##thenflag = value;
62
Steve Blocka7e24c12009-10-30 11:49:00 +000063#else
64#error No mode supplied when including flags.defs
65#endif
66
Ben Murdochb8a8cc12014-11-26 15:28:44 +000067// Dummy defines for modes where it is not relevant.
68#ifndef FLAG_FULL
69#define FLAG_FULL(ftype, ctype, nam, def, cmt)
70#endif
71
72#ifndef FLAG_READONLY
73#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
74#endif
75
76#ifndef FLAG_ALIAS
77#define FLAG_ALIAS(ftype, ctype, alias, nam)
78#endif
79
80#ifndef DEFINE_VALUE_IMPLICATION
81#define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value)
82#endif
83
Emily Bernierd0a1eb72015-03-24 16:35:39 -040084#ifndef DEFINE_NEG_VALUE_IMPLICATION
85#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value)
86#endif
87
Ben Murdochb8a8cc12014-11-26 15:28:44 +000088#define COMMA ,
89
Steve Blocka7e24c12009-10-30 11:49:00 +000090#ifdef FLAG_MODE_DECLARE
91// Structure used to hold a collection of arguments to the JavaScript code.
92struct JSArguments {
Ben Murdochb8a8cc12014-11-26 15:28:44 +000093 public:
94 inline const char*& operator[](int idx) const { return argv[idx]; }
Ben Murdoch3ef787d2012-04-12 10:51:47 +010095 static JSArguments Create(int argc, const char** argv) {
96 JSArguments args;
Ben Murdochb8a8cc12014-11-26 15:28:44 +000097 args.argc = argc;
98 args.argv = argv;
Ben Murdoch3ef787d2012-04-12 10:51:47 +010099 return args;
100 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000101 int argc;
102 const char** argv;
103};
104
105struct MaybeBoolFlag {
106 static MaybeBoolFlag Create(bool has_value, bool value) {
107 MaybeBoolFlag flag;
108 flag.has_value = has_value;
109 flag.value = value;
110 return flag;
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100111 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000112 bool has_value;
113 bool value;
Steve Blocka7e24c12009-10-30 11:49:00 +0000114};
115#endif
116
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000117#ifdef DEBUG
118#define DEBUG_BOOL true
119#else
120#define DEBUG_BOOL false
121#endif
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000122#if (defined CAN_USE_VFP3_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
123#define ENABLE_VFP3_DEFAULT true
124#else
125#define ENABLE_VFP3_DEFAULT false
126#endif
127#if (defined CAN_USE_ARMV7_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
128#define ENABLE_ARMV7_DEFAULT true
129#else
130#define ENABLE_ARMV7_DEFAULT false
131#endif
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400132#if (defined CAN_USE_ARMV8_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
133#define ENABLE_ARMV8_DEFAULT true
134#else
135#define ENABLE_ARMV8_DEFAULT false
136#endif
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000137#if (defined CAN_USE_VFP32DREGS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
138#define ENABLE_32DREGS_DEFAULT true
139#else
140#define ENABLE_32DREGS_DEFAULT false
141#endif
142#if (defined CAN_USE_NEON) || !(defined ARM_TEST_NO_FEATURE_PROBE)
143# define ENABLE_NEON_DEFAULT true
144#else
145# define ENABLE_NEON_DEFAULT false
146#endif
Ben Murdoch097c5b22016-05-18 11:27:45 +0100147#ifdef V8_OS_WIN
148# define ENABLE_LOG_COLOUR false
149#else
150# define ENABLE_LOG_COLOUR true
151#endif
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000152
153#define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400154#define DEFINE_BOOL_READONLY(nam, def, cmt) \
155 FLAG_READONLY(BOOL, bool, nam, def, cmt)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000156#define DEFINE_MAYBE_BOOL(nam, cmt) \
157 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt)
158#define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
159#define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
160#define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
161#define DEFINE_ARGS(nam, cmt) FLAG(ARGS, JSArguments, nam, {0 COMMA NULL}, cmt)
162
163#define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam)
164#define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam)
165#define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam)
166#define DEFINE_ALIAS_STRING(alias, nam) \
167 FLAG_ALIAS(STRING, const char*, alias, nam)
168#define DEFINE_ALIAS_ARGS(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam)
Steve Blocka7e24c12009-10-30 11:49:00 +0000169
170//
171// Flags in all modes.
172//
173#define FLAG FLAG_FULL
174
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000175DEFINE_BOOL(experimental_extras, false,
176 "enable code compiled in via v8_experimental_extra_library_files")
177
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100178// Flags for language modes and experimental language features.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000179DEFINE_BOOL(use_strict, false, "enforce strict mode")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000180
181DEFINE_BOOL(es_staging, false,
182 "enable test-worthy harmony features (for internal use only)")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400183DEFINE_BOOL(harmony, false, "enable all completed harmony features")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000184DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400185DEFINE_IMPLICATION(es_staging, harmony)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000186
Ben Murdochc5610432016-08-08 18:44:38 +0100187DEFINE_BOOL(promise_extra, false, "additional V8 Promise functions")
188// Removing extra Promise functions is shipped
189DEFINE_NEG_VALUE_IMPLICATION(harmony_shipping, promise_extra, true)
190
191DEFINE_BOOL(intl_extra, true, "additional V8 Intl functions")
192// Removing extra Intl functions is shipped
193DEFINE_NEG_VALUE_IMPLICATION(harmony_shipping, intl_extra, true)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000194
195// Activate on ClusterFuzz.
196DEFINE_IMPLICATION(es_staging, harmony_regexp_lookbehind)
197DEFINE_IMPLICATION(es_staging, move_object_start)
198
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400199// Features that are still work in progress (behind individual flags).
Ben Murdochc5610432016-08-08 18:44:38 +0100200#ifdef V8_I18N_SUPPORT
Ben Murdochda12d292016-06-02 14:46:10 +0100201#define HARMONY_INPROGRESS(V) \
Ben Murdochc5610432016-08-08 18:44:38 +0100202 V(harmony_array_prototype_values, "harmony Array.prototype.values") \
Ben Murdochda12d292016-06-02 14:46:10 +0100203 V(harmony_function_sent, "harmony function.sent") \
204 V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
205 V(harmony_simd, "harmony simd") \
206 V(harmony_do_expressions, "harmony do-expressions") \
207 V(harmony_regexp_property, "harmony unicode regexp property classes") \
Ben Murdochc5610432016-08-08 18:44:38 +0100208 V(icu_case_mapping, "case mapping with ICU rather than Unibrow") \
209 V(harmony_async_await, "harmony async-await")
210#else
211#define HARMONY_INPROGRESS(V) \
212 V(harmony_array_prototype_values, "harmony Array.prototype.values") \
213 V(harmony_function_sent, "harmony function.sent") \
214 V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
215 V(harmony_simd, "harmony simd") \
216 V(harmony_do_expressions, "harmony do-expressions") \
217 V(harmony_regexp_property, "harmony unicode regexp property classes") \
218 V(harmony_async_await, "harmony async-await")
219#endif
Ben Murdochda12d292016-06-02 14:46:10 +0100220
221// Features that are complete (but still behind --harmony/es-staging flag).
222#define HARMONY_STAGED(V) \
Ben Murdochc5610432016-08-08 18:44:38 +0100223 V(harmony_for_in, "harmony for-in syntax") \
Ben Murdochda12d292016-06-02 14:46:10 +0100224 V(harmony_regexp_lookbehind, "harmony regexp lookbehind") \
Ben Murdoch097c5b22016-05-18 11:27:45 +0100225 V(harmony_tailcalls, "harmony tail calls") \
Ben Murdochc5610432016-08-08 18:44:38 +0100226 V(harmony_explicit_tailcalls, "harmony explicit tail calls") \
Ben Murdoch097c5b22016-05-18 11:27:45 +0100227 V(harmony_object_values_entries, "harmony Object.values / Object.entries") \
228 V(harmony_object_own_property_descriptors, \
229 "harmony Object.getOwnPropertyDescriptors()") \
Ben Murdochc5610432016-08-08 18:44:38 +0100230 V(harmony_string_padding, "harmony String-padding methods")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400231
232// Features that are shipping (turned on by default, but internal flag remains).
Ben Murdochda12d292016-06-02 14:46:10 +0100233#define HARMONY_SHIPPING(V) \
Ben Murdochda12d292016-06-02 14:46:10 +0100234 V(harmony_function_name, "harmony Function name inference") \
235 V(harmony_instanceof, "harmony instanceof support") \
236 V(harmony_iterator_close, "harmony iterator finalization") \
237 V(harmony_unicode_regexps, "harmony unicode regexps") \
238 V(harmony_regexp_exec, "harmony RegExp exec override behavior") \
Ben Murdochda12d292016-06-02 14:46:10 +0100239 V(harmony_regexp_subclass, "harmony regexp subclassing") \
240 V(harmony_restrictive_declarations, \
241 "harmony limitations on sloppy mode function declarations") \
Ben Murdochc5610432016-08-08 18:44:38 +0100242 V(harmony_species, "harmony Symbol.species") \
243 V(harmony_exponentiation_operator, "harmony exponentiation operator `**`")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400244
245// Once a shipping feature has proved stable in the wild, it will be dropped
246// from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,
247// and associated tests are moved from the harmony directory to the appropriate
248// esN directory.
249
250
251#define FLAG_INPROGRESS_FEATURES(id, description) \
252 DEFINE_BOOL(id, false, "enable " #description " (in progress)")
253HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES)
254#undef FLAG_INPROGRESS_FEATURES
255
256#define FLAG_STAGED_FEATURES(id, description) \
257 DEFINE_BOOL(id, false, "enable " #description) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000258 DEFINE_IMPLICATION(harmony, id)
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400259HARMONY_STAGED(FLAG_STAGED_FEATURES)
260#undef FLAG_STAGED_FEATURES
261
262#define FLAG_SHIPPING_FEATURES(id, description) \
263 DEFINE_BOOL(id, true, "enable " #description) \
264 DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id)
265HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES)
266#undef FLAG_SHIPPING_FEATURES
267
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000268// Flags for experimental implementation features.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000269DEFINE_BOOL(compiled_keyed_generic_loads, false,
270 "use optimizing compiler to generate keyed generic load stubs")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000271DEFINE_BOOL(allocation_site_pretenuring, true,
272 "pretenure with allocation sites")
Ben Murdochc5610432016-08-08 18:44:38 +0100273DEFINE_BOOL(page_promotion, true, "promote pages based on utilization")
274DEFINE_INT(page_promotion_threshold, 70,
275 "min percentage of live bytes on a page to enable fast evacuation")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000276DEFINE_BOOL(trace_pretenuring, false,
277 "trace pretenuring decisions of HAllocate instructions")
278DEFINE_BOOL(trace_pretenuring_statistics, false,
279 "trace allocation site pretenuring statistics")
280DEFINE_BOOL(track_fields, true, "track fields with only smi values")
281DEFINE_BOOL(track_double_fields, true, "track fields with double values")
282DEFINE_BOOL(track_heap_object_fields, true, "track fields with heap values")
283DEFINE_BOOL(track_computed_fields, true, "track computed boilerplate fields")
284DEFINE_IMPLICATION(track_double_fields, track_fields)
285DEFINE_IMPLICATION(track_heap_object_fields, track_fields)
286DEFINE_IMPLICATION(track_computed_fields, track_fields)
287DEFINE_BOOL(track_field_types, true, "track field types")
288DEFINE_IMPLICATION(track_field_types, track_fields)
289DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
290DEFINE_BOOL(smi_binop, true, "support smi representation in binary operations")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000291
292// Flags for optimization types.
293DEFINE_BOOL(optimize_for_size, false,
294 "Enables optimizations which favor memory size over execution "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000295 "speed")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000296
297DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100298
299// Flags for data representation optimizations
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000300DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
301DEFINE_BOOL(string_slices, true, "use string slices")
Ben Murdoch5d4cdbf2012-04-11 10:23:59 +0100302
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000303// Flags for Ignition.
304DEFINE_BOOL(ignition, false, "use ignition interpreter")
Ben Murdochda12d292016-06-02 14:46:10 +0100305DEFINE_BOOL(ignition_eager, true, "eagerly compile and parse with ignition")
Ben Murdochc5610432016-08-08 18:44:38 +0100306DEFINE_BOOL(ignition_generators, false,
307 "enable experimental ignition support for generators")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000308DEFINE_STRING(ignition_filter, "*", "filter for ignition interpreter")
Ben Murdochc5610432016-08-08 18:44:38 +0100309DEFINE_BOOL(ignition_peephole, true, "use ignition peephole optimizer")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000310DEFINE_BOOL(print_bytecode, false,
311 "print bytecode generated by ignition interpreter")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100312DEFINE_BOOL(trace_ignition, false,
313 "trace the bytecodes executed by the ignition interpreter")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000314DEFINE_BOOL(trace_ignition_codegen, false,
315 "trace the codegen of ignition interpreter bytecode handlers")
Ben Murdochc5610432016-08-08 18:44:38 +0100316DEFINE_BOOL(trace_ignition_dispatches, false,
317 "traces the dispatches to bytecode handlers by the ignition "
318 "interpreter")
319DEFINE_STRING(trace_ignition_dispatches_output_file, nullptr,
320 "the file to which the bytecode handler dispatch table is "
321 "written (by default, the table is not written to a file)")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000322
Ben Murdochb0fe1622011-05-05 13:52:32 +0100323// Flags for Crankshaft.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000324DEFINE_BOOL(crankshaft, true, "use crankshaft")
325DEFINE_STRING(hydrogen_filter, "*", "optimization filter")
326DEFINE_BOOL(use_gvn, true, "use hydrogen global value numbering")
327DEFINE_INT(gvn_iterations, 3, "maximum number of GVN fix-point iterations")
328DEFINE_BOOL(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
329DEFINE_BOOL(use_inlining, true, "use function inlining")
330DEFINE_BOOL(use_escape_analysis, true, "use hydrogen escape analysis")
331DEFINE_BOOL(use_allocation_folding, true, "use allocation folding")
332DEFINE_BOOL(use_local_allocation_folding, false, "only fold in basic blocks")
333DEFINE_BOOL(use_write_barrier_elimination, true,
334 "eliminate write barriers targeting allocations in optimized code")
335DEFINE_INT(max_inlining_levels, 5, "maximum number of inlining levels")
336DEFINE_INT(max_inlined_source_size, 600,
337 "maximum source size in bytes considered for a single inlining")
338DEFINE_INT(max_inlined_nodes, 196,
339 "maximum number of AST nodes considered for a single inlining")
340DEFINE_INT(max_inlined_nodes_cumulative, 400,
341 "maximum cumulative number of AST nodes considered for inlining")
342DEFINE_BOOL(loop_invariant_code_motion, true, "loop invariant code motion")
343DEFINE_BOOL(fast_math, true, "faster (but maybe less accurate) math functions")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100344DEFINE_BOOL(collect_megamorphic_maps_from_stub_cache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100345 "crankshaft harvests type feedback from stub cache")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000346DEFINE_BOOL(hydrogen_stats, false, "print statistics for hydrogen")
347DEFINE_BOOL(trace_check_elimination, false, "trace check elimination phase")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000348DEFINE_BOOL(trace_environment_liveness, false,
349 "trace liveness of local variable slots")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000350DEFINE_BOOL(trace_hydrogen, false, "trace generated hydrogen to file")
351DEFINE_STRING(trace_hydrogen_filter, "*", "hydrogen tracing filter")
352DEFINE_BOOL(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs")
353DEFINE_STRING(trace_hydrogen_file, NULL, "trace hydrogen to given file name")
354DEFINE_STRING(trace_phase, "HLZ", "trace generated IR for specified phases")
355DEFINE_BOOL(trace_inlining, false, "trace inlining decisions")
356DEFINE_BOOL(trace_load_elimination, false, "trace load elimination")
357DEFINE_BOOL(trace_store_elimination, false, "trace store elimination")
358DEFINE_BOOL(trace_alloc, false, "trace register allocator")
359DEFINE_BOOL(trace_all_uses, false, "trace all use positions")
360DEFINE_BOOL(trace_range, false, "trace range analysis")
361DEFINE_BOOL(trace_gvn, false, "trace global value numbering")
362DEFINE_BOOL(trace_representation, false, "trace representation types")
363DEFINE_BOOL(trace_removable_simulates, false, "trace removable simulates")
364DEFINE_BOOL(trace_escape_analysis, false, "trace hydrogen escape analysis")
365DEFINE_BOOL(trace_allocation_folding, false, "trace allocation folding")
366DEFINE_BOOL(trace_track_allocation_sites, false,
367 "trace the tracking of allocation sites")
368DEFINE_BOOL(trace_migration, false, "trace object migration")
369DEFINE_BOOL(trace_generalization, false, "trace map generalization")
370DEFINE_BOOL(stress_pointer_maps, false, "pointer map for every instruction")
371DEFINE_BOOL(stress_environments, false, "environment for every instruction")
372DEFINE_INT(deopt_every_n_times, 0,
Ben Murdochb0fe1622011-05-05 13:52:32 +0100373 "deoptimize every n times a deopt point is passed")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000374DEFINE_INT(deopt_every_n_garbage_collections, 0,
375 "deoptimize every n garbage collections")
376DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points")
377DEFINE_BOOL(trap_on_deopt, false, "put a break point before deoptimizing")
378DEFINE_BOOL(trap_on_stub_deopt, false,
379 "put a break point before deoptimizing a stub")
380DEFINE_BOOL(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
381DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining")
382DEFINE_BOOL(use_osr, true, "use on-stack replacement")
383DEFINE_BOOL(array_bounds_checks_elimination, true,
384 "perform array bounds checks elimination")
385DEFINE_BOOL(trace_bce, false, "trace array bounds check elimination")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000386DEFINE_BOOL(array_index_dehoisting, true, "perform array index dehoisting")
387DEFINE_BOOL(analyze_environment_liveness, true,
388 "analyze liveness of environment slots and zap dead values")
389DEFINE_BOOL(load_elimination, true, "use load elimination")
390DEFINE_BOOL(check_elimination, true, "use check elimination")
391DEFINE_BOOL(store_elimination, false, "use store elimination")
392DEFINE_BOOL(dead_code_elimination, true, "use dead code elimination")
393DEFINE_BOOL(fold_constants, true, "use constant folding")
394DEFINE_BOOL(trace_dead_code_elimination, false, "trace dead code elimination")
395DEFINE_BOOL(unreachable_code_elimination, true, "eliminate unreachable code")
396DEFINE_BOOL(trace_osr, false, "trace on-stack replacement")
397DEFINE_INT(stress_runs, 0, "number of stress runs")
398DEFINE_BOOL(lookup_sample_by_shared, true,
399 "when picking a function to optimize, watch for shared function "
400 "info, not JSFunction itself")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000401DEFINE_BOOL(flush_optimized_code_cache, false,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000402 "flushes the cache of optimized code for closures on every GC")
403DEFINE_BOOL(inline_construct, true, "inline constructor calls")
404DEFINE_BOOL(inline_arguments, true, "inline functions with arguments object")
405DEFINE_BOOL(inline_accessors, true, "inline JavaScript accessors")
406DEFINE_INT(escape_analysis_iterations, 2,
407 "maximum number of escape analysis fix-point iterations")
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100408
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000409DEFINE_BOOL(concurrent_recompilation, true,
410 "optimizing hot functions asynchronously on a separate thread")
411DEFINE_BOOL(trace_concurrent_recompilation, false,
412 "track concurrent recompilation")
413DEFINE_INT(concurrent_recompilation_queue_length, 8,
414 "the length of the concurrent compilation queue")
415DEFINE_INT(concurrent_recompilation_delay, 0,
416 "artificial compilation delay in ms")
417DEFINE_BOOL(block_concurrent_recompilation, false,
418 "block queued jobs until released")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100419
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000420DEFINE_BOOL(omit_map_checks_for_leaf_maps, true,
421 "do not emit check maps for constant values that have a leaf map, "
422 "deoptimize the optimized code if the layout of the maps changes.")
423
424// Flags for TurboFan.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000425DEFINE_BOOL(turbo, false, "enable TurboFan compiler")
426DEFINE_IMPLICATION(turbo, turbo_asm_deoptimization)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000427DEFINE_BOOL(turbo_shipping, true, "enable TurboFan compiler on subset")
Ben Murdochc5610432016-08-08 18:44:38 +0100428DEFINE_BOOL(turbo_from_bytecode, false, "enable building graphs from bytecode")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000429DEFINE_BOOL(turbo_greedy_regalloc, false, "use the greedy register allocator")
430DEFINE_BOOL(turbo_sp_frame_access, false,
431 "use stack pointer-relative access to frame wherever possible")
432DEFINE_BOOL(turbo_preprocess_ranges, true,
433 "run pre-register allocation heuristics")
434DEFINE_BOOL(turbo_loop_stackcheck, true, "enable stack checks in loops")
435DEFINE_STRING(turbo_filter, "~~", "optimization filter for TurboFan compiler")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000436DEFINE_BOOL(trace_turbo, false, "trace generated TurboFan IR")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400437DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs")
438DEFINE_IMPLICATION(trace_turbo_graph, trace_turbo)
439DEFINE_STRING(trace_turbo_cfg_file, NULL,
440 "trace turbo cfg graph (for C1 visualizer) to a given file name")
441DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types")
442DEFINE_BOOL(trace_turbo_scheduler, false, "trace TurboFan's scheduler")
443DEFINE_BOOL(trace_turbo_reduction, false, "trace TurboFan's various reducers")
444DEFINE_BOOL(trace_turbo_jt, false, "trace TurboFan's jump threading")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000445DEFINE_BOOL(trace_turbo_ceq, false, "trace TurboFan's control equivalence")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400446DEFINE_BOOL(turbo_asm, true, "enable TurboFan for asm.js code")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000447DEFINE_BOOL(turbo_asm_deoptimization, false,
448 "enable deoptimization in TurboFan for asm.js code")
449DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000450DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000451DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000452DEFINE_BOOL(turbo_source_positions, false,
453 "track source code positions when building TurboFan IR")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000454DEFINE_IMPLICATION(trace_turbo, turbo_source_positions)
455DEFINE_BOOL(function_context_specialization, false,
456 "enable function context specialization in TurboFan")
457DEFINE_BOOL(native_context_specialization, true,
458 "enable native context specialization in TurboFan")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100459DEFINE_BOOL(turbo_inlining, true, "enable inlining in TurboFan")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000460DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400461DEFINE_BOOL(loop_assignment_analysis, true, "perform loop assignment analysis")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400462DEFINE_BOOL(turbo_profiling, false, "enable profiling in TurboFan")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000463DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL,
464 "verify register allocation in TurboFan")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400465DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000466DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000467DEFINE_BOOL(turbo_stress_loop_peeling, false,
468 "stress loop peeling optimization")
469DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan")
470DEFINE_BOOL(turbo_frame_elision, true, "elide frames in TurboFan")
471DEFINE_BOOL(turbo_cache_shared_code, true, "cache context-independent code")
472DEFINE_BOOL(turbo_preserve_shared_code, false, "keep context-independent code")
473DEFINE_BOOL(turbo_escape, false, "enable escape analysis")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000474DEFINE_BOOL(turbo_instruction_scheduling, false,
475 "enable instruction scheduling in TurboFan")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100476DEFINE_BOOL(turbo_stress_instruction_scheduling, false,
477 "randomly schedule instructions to stress dependency tracking")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000478
479// Flags for native WebAssembly.
480DEFINE_BOOL(expose_wasm, false, "expose WASM interface to JavaScript")
Ben Murdochc5610432016-08-08 18:44:38 +0100481DEFINE_INT(wasm_num_compilation_tasks, 0,
482 "number of parallel compilation tasks for wasm")
Ben Murdochda12d292016-06-02 14:46:10 +0100483DEFINE_BOOL(trace_wasm_encoder, false, "trace encoding of wasm code")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000484DEFINE_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code")
485DEFINE_BOOL(trace_wasm_decode_time, false, "trace decoding time of wasm code")
486DEFINE_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code")
Ben Murdochda12d292016-06-02 14:46:10 +0100487DEFINE_INT(trace_wasm_ast_start, 0,
488 "start function for WASM AST trace (inclusive)")
489DEFINE_INT(trace_wasm_ast_end, 0, "end function for WASM AST trace (exclusive)")
490DEFINE_INT(skip_compiling_wasm_funcs, 0, "start compiling at function N")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000491DEFINE_BOOL(wasm_break_on_decoder_error, false,
492 "debug break when wasm decoder encounters an error")
Ben Murdochda12d292016-06-02 14:46:10 +0100493DEFINE_BOOL(wasm_loop_assignment_analysis, true,
494 "perform loop assignment analysis for WASM")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000495
Ben Murdochc5610432016-08-08 18:44:38 +0100496DEFINE_BOOL(validate_asm, false, "validate asm.js modules before compiling")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100497DEFINE_BOOL(enable_simd_asmjs, false, "enable SIMD.js in asm.js stdlib")
498
Ben Murdochda12d292016-06-02 14:46:10 +0100499DEFINE_BOOL(dump_wasm_module, false, "dump WASM module bytes")
500DEFINE_STRING(dump_wasm_module_path, NULL, "directory to dump wasm modules to")
Ben Murdochc5610432016-08-08 18:44:38 +0100501DEFINE_BOOL(print_wasm_code_size, false,
502 "print the generated code size for each wasm module")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100503
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000504DEFINE_INT(typed_array_max_size_in_heap, 64,
505 "threshold for in-heap typed array")
506
507// Profiler flags.
508DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
509// 0x1800 fits in the immediate field of an ARM instruction.
510DEFINE_INT(interrupt_budget, 0x1800,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100511 "execution budget before interrupt is triggered")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000512DEFINE_INT(type_info_threshold, 25,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100513 "percentage of ICs that must have type info to allow optimization")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000514DEFINE_INT(generic_ic_threshold, 30,
515 "max percentage of megamorphic/generic ICs to allow optimization")
516DEFINE_INT(self_opt_count, 130, "call count before self-optimization")
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100517
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000518DEFINE_BOOL(trace_opt_verbose, false, "extra verbose compilation tracing")
519DEFINE_IMPLICATION(trace_opt_verbose, trace_opt)
Ben Murdochb0fe1622011-05-05 13:52:32 +0100520
Steve Block3ce2e202009-11-05 08:53:23 +0000521// assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000522DEFINE_BOOL(debug_code, false, "generate extra code (assertions) for debugging")
523DEFINE_BOOL(code_comments, false, "emit comments in code disassembly")
524DEFINE_BOOL(enable_sse3, true, "enable use of SSE3 instructions if available")
525DEFINE_BOOL(enable_sse4_1, true,
Ben Murdochf87a2032010-10-22 12:50:53 +0100526 "enable use of SSE4.1 instructions if available")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000527DEFINE_BOOL(enable_sahf, true,
Steve Block3ce2e202009-11-05 08:53:23 +0000528 "enable use of SAHF instruction if available (X64 only)")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400529DEFINE_BOOL(enable_avx, true, "enable use of AVX instructions if available")
530DEFINE_BOOL(enable_fma3, true, "enable use of FMA3 instructions if available")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000531DEFINE_BOOL(enable_bmi1, true, "enable use of BMI1 instructions if available")
532DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available")
533DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available")
534DEFINE_BOOL(enable_popcnt, true,
535 "enable use of POPCNT instruction if available")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000536DEFINE_BOOL(enable_vfp3, ENABLE_VFP3_DEFAULT,
537 "enable use of VFP3 instructions if available")
538DEFINE_BOOL(enable_armv7, ENABLE_ARMV7_DEFAULT,
Andrei Popescu31002712010-02-23 13:46:05 +0000539 "enable use of ARMv7 instructions if available (ARM only)")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400540DEFINE_BOOL(enable_armv8, ENABLE_ARMV8_DEFAULT,
541 "enable use of ARMv8 instructions if available (ARM 32-bit only)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000542DEFINE_BOOL(enable_neon, ENABLE_NEON_DEFAULT,
543 "enable use of NEON instructions if available (ARM only)")
544DEFINE_BOOL(enable_sudiv, true,
545 "enable use of SDIV and UDIV instructions if available (ARM only)")
546DEFINE_BOOL(enable_mls, true,
547 "enable use of MLS instructions if available (ARM only)")
548DEFINE_BOOL(enable_movw_movt, false,
549 "enable loading 32-bit constant by means of movw/movt "
550 "instruction pairs (ARM only)")
551DEFINE_BOOL(enable_unaligned_accesses, true,
552 "enable unaligned accesses for ARMv7 (ARM only)")
553DEFINE_BOOL(enable_32dregs, ENABLE_32DREGS_DEFAULT,
554 "enable use of d16-d31 registers on ARM - this requires VFP3")
555DEFINE_BOOL(enable_vldr_imm, false,
556 "enable use of constant pools for double immediate (ARM only)")
557DEFINE_BOOL(force_long_branches, false,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000558 "force all emitted branches to be in long mode (MIPS/PPC only)")
559DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu")
560
561DEFINE_IMPLICATION(enable_armv8, enable_vfp3)
562DEFINE_IMPLICATION(enable_armv8, enable_neon)
563DEFINE_IMPLICATION(enable_armv8, enable_32dregs)
564DEFINE_IMPLICATION(enable_armv8, enable_sudiv)
565DEFINE_IMPLICATION(enable_armv8, enable_mls)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000566
Steve Blocka7e24c12009-10-30 11:49:00 +0000567// bootstrapper.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000568DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object")
569DEFINE_STRING(expose_debug_as, NULL, "expose debug in global object")
570DEFINE_BOOL(expose_free_buffer, false, "expose freeBuffer extension")
571DEFINE_BOOL(expose_gc, false, "expose gc extension")
572DEFINE_STRING(expose_gc_as, NULL,
573 "expose gc extension under the specified name")
574DEFINE_IMPLICATION(expose_gc_as, expose_gc)
575DEFINE_BOOL(expose_externalize_string, false,
Kristian Monsen9dcf7e22010-06-28 14:14:28 +0100576 "expose externalize string extension")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000577DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension")
578DEFINE_INT(stack_trace_limit, 10, "number of stack frames to capture")
579DEFINE_BOOL(builtins_in_stack_traces, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100580 "show built-in functions in stack traces")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000581DEFINE_BOOL(disable_native_files, false, "disable builtin natives files")
Steve Blocka7e24c12009-10-30 11:49:00 +0000582
583// builtins-ia32.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000584DEFINE_BOOL(inline_new, true, "use fast inline allocation")
Steve Blocka7e24c12009-10-30 11:49:00 +0000585
586// codegen-ia32.cc / codegen-arm.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000587DEFINE_BOOL(trace_codegen, false,
588 "print name of functions for which code is generated")
589DEFINE_BOOL(trace, false, "trace function calls")
590DEFINE_BOOL(mask_constants_with_cookie, true,
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -0800591 "use random jit cookie to mask large constants")
Steve Blocka7e24c12009-10-30 11:49:00 +0000592
593// codegen.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000594DEFINE_BOOL(lazy, true, "use lazy compilation")
595DEFINE_BOOL(trace_opt, false, "trace lazy optimization")
596DEFINE_BOOL(trace_opt_stats, false, "trace lazy optimization statistics")
Ben Murdochc5610432016-08-08 18:44:38 +0100597DEFINE_BOOL(trace_file_names, false,
598 "include file names in trace-opt/trace-deopt output")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000599DEFINE_BOOL(opt, true, "use adaptive optimizations")
600DEFINE_BOOL(always_opt, false, "always try to optimize functions")
601DEFINE_BOOL(always_osr, false, "always try to OSR functions")
602DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt")
603DEFINE_BOOL(trace_deopt, false, "trace optimize function deoptimization")
604DEFINE_BOOL(trace_stub_failures, false,
605 "trace deoptimization of generated code stubs")
606
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400607DEFINE_BOOL(serialize_toplevel, true, "enable caching of toplevel scripts")
Ben Murdochda12d292016-06-02 14:46:10 +0100608DEFINE_BOOL(serialize_eager, false, "compile eagerly when caching scripts")
609DEFINE_BOOL(serialize_age_code, false, "pre age code in the code cache")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400610DEFINE_BOOL(trace_serializer, false, "print code serializer trace")
Steve Blocka7e24c12009-10-30 11:49:00 +0000611
612// compiler.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000613DEFINE_INT(min_preparse_length, 1024,
Steve Block3ce2e202009-11-05 08:53:23 +0000614 "minimum length for automatic enable preparsing")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000615DEFINE_INT(max_opt_count, 10,
616 "maximum number of optimization attempts before giving up.")
Steve Blocka7e24c12009-10-30 11:49:00 +0000617
618// compilation-cache.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000619DEFINE_BOOL(compilation_cache, true, "enable compilation cache")
Steve Blocka7e24c12009-10-30 11:49:00 +0000620
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000621DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions")
622
623// cpu-profiler.cc
624DEFINE_INT(cpu_profiler_sampling_interval, 1000,
625 "CPU profiler sampling interval in microseconds")
Steve Block053d10c2011-06-13 19:13:29 +0100626
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000627// Array abuse tracing
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000628DEFINE_BOOL(trace_js_array_abuse, false,
629 "trace out-of-bounds accesses to JS arrays")
630DEFINE_BOOL(trace_external_array_abuse, false,
631 "trace out-of-bounds-accesses to external arrays")
632DEFINE_BOOL(trace_array_abuse, false,
633 "trace out-of-bounds accesses to all arrays")
634DEFINE_IMPLICATION(trace_array_abuse, trace_js_array_abuse)
635DEFINE_IMPLICATION(trace_array_abuse, trace_external_array_abuse)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000636
637// debugger
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000638DEFINE_BOOL(trace_debug_json, false, "trace debugging JSON request/response")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000639DEFINE_BOOL(enable_liveedit, true, "enable liveedit experimental feature")
640DEFINE_BOOL(hard_abort, true, "abort by crashing")
Steve Blocka7e24c12009-10-30 11:49:00 +0000641
Steve Block1e0659c2011-05-24 12:43:12 +0100642// execution.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000643DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100644 "default size of stack region v8 is allowed to use (in kBytes)")
Steve Block1e0659c2011-05-24 12:43:12 +0100645
Steve Blocka7e24c12009-10-30 11:49:00 +0000646// frames.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000647DEFINE_INT(max_stack_trace_source_length, 300,
Steve Blocka7e24c12009-10-30 11:49:00 +0000648 "maximum length of function source code printed in a stack trace.")
649
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100650// full-codegen.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000651DEFINE_BOOL(always_inline_smi_code, false,
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100652 "always inline smi code in non-opt code")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100653DEFINE_BOOL(verify_operand_stack_depth, false,
654 "emit debug code that verifies the static tracking of the operand "
655 "stack depth")
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100656
Steve Blocka7e24c12009-10-30 11:49:00 +0000657// heap.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000658DEFINE_INT(min_semi_space_size, 0,
659 "min size of a semi-space (in MBytes), the new space consists of two"
660 "semi-spaces")
661DEFINE_INT(max_semi_space_size, 0,
662 "max size of a semi-space (in MBytes), the new space consists of two"
663 "semi-spaces")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400664DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
665DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
666 "Grow the new space based on the percentage of survivors instead "
667 "of their absolute value.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000668DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400669DEFINE_INT(initial_old_space_size, 0, "initial old space size (in Mbytes)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000670DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
671DEFINE_BOOL(gc_global, false, "always perform global GCs")
672DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000673DEFINE_INT(retain_maps_for_n_gc, 2,
674 "keeps maps alive for <n> old space garbage collections")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000675DEFINE_BOOL(trace_gc, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000676 "print one trace line following each garbage collection")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000677DEFINE_BOOL(trace_gc_nvp, false,
Leon Clarkef7060e22010-06-03 12:02:55 +0100678 "print one detailed trace line in name=value format "
679 "after each garbage collection")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000680DEFINE_BOOL(trace_gc_ignore_scavenger, false,
681 "do not print trace line after scavenger collection")
682DEFINE_BOOL(trace_idle_notification, false,
683 "print one trace line following each idle notification")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400684DEFINE_BOOL(trace_idle_notification_verbose, false,
685 "prints the heap state used by the idle notification")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000686DEFINE_BOOL(print_cumulative_gc_stat, false,
Leon Clarkef7060e22010-06-03 12:02:55 +0100687 "print cumulative GC statistics in name=value format on exit")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000688DEFINE_BOOL(print_max_heap_committed, false,
689 "print statistics of the maximum memory committed for the heap "
690 "in name=value format on exit")
691DEFINE_BOOL(trace_gc_verbose, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000692 "print more details following each garbage collection")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000693DEFINE_INT(trace_allocation_stack_interval, -1,
694 "print stack trace after <n> free-list allocations")
695DEFINE_BOOL(trace_fragmentation, false, "report fragmentation for old space")
696DEFINE_BOOL(trace_fragmentation_verbose, false,
697 "report fragmentation for old space (detailed)")
Ben Murdochda12d292016-06-02 14:46:10 +0100698DEFINE_BOOL(trace_evacuation, false, "report evacuation statistics")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000699DEFINE_BOOL(trace_mutator_utilization, false,
700 "print mutator utilization, allocation speed, gc speed")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000701DEFINE_BOOL(weak_embedded_maps_in_optimized_code, true,
702 "make maps embedded in optimized code weak")
703DEFINE_BOOL(weak_embedded_objects_in_optimized_code, true,
704 "make objects embedded in optimized code weak")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000705DEFINE_BOOL(flush_code, true, "flush code that we expect not to use again")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000706DEFINE_BOOL(trace_code_flushing, false, "trace code flushing progress")
707DEFINE_BOOL(age_code, true,
708 "track un-executed functions to age code and flush only "
709 "old code (required for code flushing)")
710DEFINE_BOOL(incremental_marking, true, "use incremental marking")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000711DEFINE_INT(min_progress_during_incremental_marking_finalization, 32,
712 "keep finalizing incremental marking as long as we discover at "
713 "least this many unmarked objects")
714DEFINE_INT(max_incremental_marking_finalization_rounds, 3,
715 "at most try this many times to finalize incremental marking")
Ben Murdochda12d292016-06-02 14:46:10 +0100716DEFINE_BOOL(black_allocation, true, "use black allocation")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400717DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000718DEFINE_BOOL(parallel_compaction, true, "use parallel compaction")
Ben Murdochda12d292016-06-02 14:46:10 +0100719DEFINE_BOOL(parallel_pointer_update, true,
720 "use parallel pointer update during compaction")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000721DEFINE_BOOL(trace_incremental_marking, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100722 "trace progress of the incremental marking")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000723DEFINE_BOOL(track_gc_object_stats, false,
724 "track object counts and memory usage")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000725DEFINE_BOOL(trace_gc_object_stats, false,
726 "trace object counts and memory usage")
727DEFINE_IMPLICATION(trace_gc_object_stats, track_gc_object_stats)
728DEFINE_BOOL(track_detached_contexts, true,
729 "track native contexts that are expected to be garbage collected")
730DEFINE_BOOL(trace_detached_contexts, false,
731 "trace native contexts that are expected to be garbage collected")
732DEFINE_IMPLICATION(trace_detached_contexts, track_detached_contexts)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000733#ifdef VERIFY_HEAP
734DEFINE_BOOL(verify_heap, false, "verify heap pointers before and after GC")
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100735#endif
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000736DEFINE_BOOL(move_object_start, true, "enable moving of object starts")
737DEFINE_BOOL(memory_reducer, true, "use memory reducer")
Ben Murdochda12d292016-06-02 14:46:10 +0100738DEFINE_BOOL(scavenge_reclaim_unmodified_objects, true,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000739 "remove unmodified and unreferenced objects")
740DEFINE_INT(heap_growing_percent, 0,
741 "specifies heap growing factor as (1 + heap_growing_percent/100)")
742
743// counters.cc
744DEFINE_INT(histogram_interval, 600000,
745 "time interval in ms for aggregating memory histograms")
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100746
Ben Murdochda12d292016-06-02 14:46:10 +0100747// global-handles.cc
748DEFINE_BOOL(trace_object_groups, false,
749 "print object groups detected during each garbage collection")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000750
751// heap-snapshot-generator.cc
752DEFINE_BOOL(heap_profiler_trace_objects, false,
753 "Dump heap object allocations/movements/size_updates")
754
755
Ben Murdoch097c5b22016-05-18 11:27:45 +0100756// sampling-heap-profiler.cc
757DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false,
758 "Use constant sample intervals to eliminate test flakiness")
759
760
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000761// v8.cc
762DEFINE_BOOL(use_idle_notification, true,
763 "Use idle notification to reduce memory footprint.")
764// ic.cc
765DEFINE_BOOL(use_ic, true, "use inline caching")
766DEFINE_BOOL(trace_ic, false, "trace inline cache state transitions")
767
Steve Blocka7e24c12009-10-30 11:49:00 +0000768// macro-assembler-ia32.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000769DEFINE_BOOL(native_code_counters, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000770 "generate extra code for manipulating stats counters")
771
772// mark-compact.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000773DEFINE_BOOL(always_compact, false, "Perform compaction on every full GC")
774DEFINE_BOOL(never_compact, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000775 "Never perform compaction on full GC - testing only")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000776DEFINE_BOOL(compact_code_space, true, "Compact code space on full collections")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000777DEFINE_BOOL(cleanup_code_caches_at_gc, true,
Ben Murdoch257744e2011-11-30 15:57:28 +0000778 "Flush inline caches prior to mark compact collection and "
779 "flush code caches in maps during mark compact cycle.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000780DEFINE_BOOL(use_marking_progress_bar, true,
781 "Use a progress bar to scan large objects in increments when "
782 "incremental marking is active.")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000783DEFINE_BOOL(zap_code_space, DEBUG_BOOL,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000784 "Zap free memory in code space with 0xCC while sweeping.")
785DEFINE_INT(random_seed, 0,
Steve Block6ded16b2010-05-10 14:33:55 +0100786 "Default seed for initializing random generator "
787 "(0, the default, means to use system random).")
Steve Blocka7e24c12009-10-30 11:49:00 +0000788
Ben Murdochb0fe1622011-05-05 13:52:32 +0100789// objects.cc
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000790DEFINE_BOOL(trace_weak_arrays, false, "Trace WeakFixedArray usage")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400791DEFINE_BOOL(track_prototype_users, false,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000792 "Keep track of which maps refer to a given prototype object")
793DEFINE_BOOL(trace_prototype_users, false,
794 "Trace updates to prototype user tracking")
795DEFINE_BOOL(eliminate_prototype_chain_checks, true,
796 "Collapse prototype chain checks into single-cell checks")
797DEFINE_IMPLICATION(eliminate_prototype_chain_checks, track_prototype_users)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000798DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
Ben Murdochda12d292016-06-02 14:46:10 +0100799DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths")
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400800#if TRACE_MAPS
801DEFINE_BOOL(trace_maps, false, "trace map creation")
802#endif
Ben Murdochb0fe1622011-05-05 13:52:32 +0100803
Steve Blocka7e24c12009-10-30 11:49:00 +0000804// parser.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000805DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
806DEFINE_BOOL(trace_parse, false, "trace parsing and preparsing")
Steve Blocka7e24c12009-10-30 11:49:00 +0000807
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000808// simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc
809DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
810DEFINE_BOOL(debug_sim, false, "Enable debugging the simulator")
811DEFINE_BOOL(check_icache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100812 "Check icache flushes in ARM and MIPS simulator")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000813DEFINE_INT(stop_sim_at, 0, "Simulator stop after x number of instructions")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000814#if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \
815 defined(V8_TARGET_ARCH_PPC64)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000816DEFINE_INT(sim_stack_alignment, 16,
817 "Stack alignment in bytes in simulator. This must be a power of two "
818 "and it must be at least 16. 16 is default.")
819#else
820DEFINE_INT(sim_stack_alignment, 8,
Steve Block6ded16b2010-05-10 14:33:55 +0100821 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000822#endif
823DEFINE_INT(sim_stack_size, 2 * MB / KB,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000824 "Stack size of the ARM64, MIPS64 and PPC64 simulator "
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000825 "in kBytes (default is 2 MB)")
826DEFINE_BOOL(log_regs_modified, true,
827 "When logging register values, only print modified registers.")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100828DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR,
829 "When logging, try to use coloured output.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000830DEFINE_BOOL(ignore_asm_unimplemented_break, false,
831 "Don't break for ASM_UNIMPLEMENTED_BREAK macros.")
832DEFINE_BOOL(trace_sim_messages, false,
833 "Trace simulator debug messages. Implied by --trace-sim.")
Steve Blocka7e24c12009-10-30 11:49:00 +0000834
Ben Murdoch257744e2011-11-30 15:57:28 +0000835// isolate.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000836DEFINE_BOOL(stack_trace_on_illegal, false,
837 "print stack trace when an illegal exception is thrown")
838DEFINE_BOOL(abort_on_uncaught_exception, false,
839 "abort program (dump core) when an uncaught exception is thrown")
840DEFINE_BOOL(randomize_hashes, true,
Ben Murdochc7cc0282012-03-05 14:35:55 +0000841 "randomize hashes to avoid predictable hash collisions "
842 "(with snapshots this option cannot override the baked-in seed)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000843DEFINE_INT(hash_seed, 0,
Ben Murdochc7cc0282012-03-05 14:35:55 +0000844 "Fixed seed to use to hash property keys (0 means random)"
845 "(with snapshots this option cannot override the baked-in seed)")
Steve Blocka7e24c12009-10-30 11:49:00 +0000846
Ben Murdoch097c5b22016-05-18 11:27:45 +0100847// runtime.cc
848DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times")
849
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000850// snapshot-common.cc
851DEFINE_BOOL(profile_deserialization, false,
852 "Print the time it takes to deserialize the snapshot.")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000853DEFINE_BOOL(serialization_statistics, false,
854 "Collect statistics on serialized objects.")
Steve Blocka7e24c12009-10-30 11:49:00 +0000855
856// Regexp
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000857DEFINE_BOOL(regexp_optimization, true, "generate optimized regexp code")
Steve Blocka7e24c12009-10-30 11:49:00 +0000858
859// Testing flags test/cctest/test-{flags,api,serialization}.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000860DEFINE_BOOL(testing_bool_flag, true, "testing_bool_flag")
861DEFINE_MAYBE_BOOL(testing_maybe_bool_flag, "testing_maybe_bool_flag")
862DEFINE_INT(testing_int_flag, 13, "testing_int_flag")
863DEFINE_FLOAT(testing_float_flag, 2.5, "float-flag")
864DEFINE_STRING(testing_string_flag, "Hello, world!", "string-flag")
865DEFINE_INT(testing_prng_seed, 42, "Seed used for threading test randomness")
866#ifdef _WIN32
867DEFINE_STRING(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
Steve Blocka7e24c12009-10-30 11:49:00 +0000868 "file in which to testing_serialize heap")
869#else
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000870DEFINE_STRING(testing_serialization_file, "/tmp/serdes",
Steve Blocka7e24c12009-10-30 11:49:00 +0000871 "file in which to serialize heap")
872#endif
873
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000874// mksnapshot.cc
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000875DEFINE_STRING(startup_src, NULL,
876 "Write V8 startup as C++ src. (mksnapshot only)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000877DEFINE_STRING(startup_blob, NULL,
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400878 "Write V8 startup blob file. (mksnapshot only)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000879
880// code-stubs-hydrogen.cc
881DEFINE_BOOL(profile_hydrogen_code_stub_compilation, false,
882 "Print the time it takes to lazily compile hydrogen code stubs.")
883
884DEFINE_BOOL(predictable, false, "enable predictable mode")
885DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation)
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000886DEFINE_NEG_IMPLICATION(predictable, concurrent_sweeping)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000887DEFINE_NEG_IMPLICATION(predictable, parallel_compaction)
888DEFINE_NEG_IMPLICATION(predictable, memory_reducer)
Ben Murdochb8e0da22011-05-16 14:20:40 +0100889
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100890// mark-compact.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000891DEFINE_BOOL(force_marking_deque_overflows, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100892 "force overflows of marking deque by reducing it's size "
893 "to 64 words")
894
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000895DEFINE_BOOL(stress_compaction, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100896 "stress the GC compactor to flush out bugs (implies "
897 "--force_marking_deque_overflows)")
898
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000899DEFINE_BOOL(manual_evacuation_candidates_selection, false,
900 "Test mode only flag. It allows an unit test to select evacuation "
901 "candidates pages (requires --stress_compaction).")
902
903// api.cc
904DEFINE_INT(external_allocation_limit_incremental_time, 1,
905 "Time spent in incremental marking steps (in ms) once the external "
906 "allocation limit is reached")
907
Ben Murdoch097c5b22016-05-18 11:27:45 +0100908DEFINE_BOOL(disable_old_api_accessors, false,
909 "Disable old-style API accessors whose setters trigger through the "
910 "prototype chain")
911
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000912//
913// Dev shell flags
914//
915
916DEFINE_BOOL(help, false, "Print usage message, including flags, on console")
917DEFINE_BOOL(dump_counters, false, "Dump counters on exit")
918
919DEFINE_STRING(map_counters, "", "Map counters to a file")
920DEFINE_ARGS(js_arguments,
921 "Pass all remaining arguments to the script. Alias for \"--\".")
922
923//
924// GDB JIT integration flags.
925//
926#undef FLAG
927#ifdef ENABLE_GDB_JIT_INTERFACE
928#define FLAG FLAG_FULL
929#else
930#define FLAG FLAG_READONLY
931#endif
932
933DEFINE_BOOL(gdbjit, false, "enable GDBJIT interface")
934DEFINE_BOOL(gdbjit_full, false, "enable GDBJIT interface for all code objects")
935DEFINE_BOOL(gdbjit_dump, false, "dump elf objects with debug info to disk")
936DEFINE_STRING(gdbjit_dump_filter, "",
937 "dump only objects containing this substring")
938
939#ifdef ENABLE_GDB_JIT_INTERFACE
940DEFINE_IMPLICATION(gdbjit_full, gdbjit)
941DEFINE_IMPLICATION(gdbjit_dump, gdbjit)
942#endif
943DEFINE_NEG_IMPLICATION(gdbjit, compact_code_space)
944
Steve Blocka7e24c12009-10-30 11:49:00 +0000945//
946// Debug only flags
947//
948#undef FLAG
949#ifdef DEBUG
950#define FLAG FLAG_FULL
951#else
952#define FLAG FLAG_READONLY
953#endif
954
955// checks.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000956#ifdef ENABLE_SLOW_DCHECKS
957DEFINE_BOOL(enable_slow_asserts, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000958 "enable asserts that are slow to execute")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000959#endif
Steve Blocka7e24c12009-10-30 11:49:00 +0000960
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000961// codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc
962DEFINE_BOOL(print_source, false, "pretty print source code")
963DEFINE_BOOL(print_builtin_source, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000964 "pretty print source code for builtins")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000965DEFINE_BOOL(print_ast, false, "print source AST")
966DEFINE_BOOL(print_builtin_ast, false, "print source AST for builtins")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000967DEFINE_BOOL(trap_on_abort, false, "replace aborts by breakpoints")
Steve Blocka7e24c12009-10-30 11:49:00 +0000968
969// compiler.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000970DEFINE_BOOL(print_builtin_scopes, false, "print scopes for builtins")
971DEFINE_BOOL(print_scopes, false, "print scopes")
Steve Blocka7e24c12009-10-30 11:49:00 +0000972
973// contexts.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000974DEFINE_BOOL(trace_contexts, false, "trace contexts operations")
Steve Blocka7e24c12009-10-30 11:49:00 +0000975
976// heap.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000977DEFINE_BOOL(gc_verbose, false, "print stuff during garbage collection")
978DEFINE_BOOL(heap_stats, false, "report heap statistics before and after GC")
979DEFINE_BOOL(code_stats, false, "report code statistics after GC")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000980DEFINE_BOOL(print_handles, false, "report handles after GC")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000981DEFINE_BOOL(check_handle_count, false,
982 "Check that there are not too many handles at GC")
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000983DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
Steve Blocka7e24c12009-10-30 11:49:00 +0000984
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000985// TurboFan debug-only flags.
986DEFINE_BOOL(print_turbo_replay, false,
987 "print C++ code to recreate TurboFan graphs")
Ben Murdoch097c5b22016-05-18 11:27:45 +0100988DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
Steve Blocka7e24c12009-10-30 11:49:00 +0000989
990// objects.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000991DEFINE_BOOL(trace_normalization, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000992 "prints when objects are turned into dictionaries.")
993
994// runtime.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000995DEFINE_BOOL(trace_lazy, false, "trace lazy compilation")
Steve Blocka7e24c12009-10-30 11:49:00 +0000996
Steve Blocka7e24c12009-10-30 11:49:00 +0000997// spaces.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000998DEFINE_BOOL(collect_heap_spill_statistics, false,
Steve Blocka7e24c12009-10-30 11:49:00 +0000999 "report heap spill statistics along with heap_stats "
1000 "(requires heap_stats)")
Ben Murdoch097c5b22016-05-18 11:27:45 +01001001DEFINE_BOOL(trace_live_bytes, false,
1002 "trace incrementing and resetting of live bytes")
Steve Blocka7e24c12009-10-30 11:49:00 +00001003
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001004DEFINE_BOOL(trace_isolates, false, "trace isolate state changes")
Ben Murdochb0fe1622011-05-05 13:52:32 +01001005
Steve Blocka7e24c12009-10-30 11:49:00 +00001006// Regexp
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001007DEFINE_BOOL(regexp_possessive_quantifier, false,
Leon Clarkee46be812010-01-19 14:06:41 +00001008 "enable possessive quantifier syntax for testing")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001009DEFINE_BOOL(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
1010DEFINE_BOOL(trace_regexp_assembler, false,
Steve Blocka7e24c12009-10-30 11:49:00 +00001011 "trace regexp macro assembler calls.")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001012DEFINE_BOOL(trace_regexp_parser, false, "trace regexp parsing")
Steve Blocka7e24c12009-10-30 11:49:00 +00001013
Ben Murdochda12d292016-06-02 14:46:10 +01001014// Debugger
1015DEFINE_BOOL(print_break_location, false, "print source location on debug break")
1016
Steve Blocka7e24c12009-10-30 11:49:00 +00001017//
Ben Murdoch3fb3ca82011-12-02 17:19:32 +00001018// Logging and profiling flags
Steve Blocka7e24c12009-10-30 11:49:00 +00001019//
1020#undef FLAG
Steve Blocka7e24c12009-10-30 11:49:00 +00001021#define FLAG FLAG_FULL
Steve Blocka7e24c12009-10-30 11:49:00 +00001022
1023// log.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001024DEFINE_BOOL(log, false,
Steve Blocka7e24c12009-10-30 11:49:00 +00001025 "Minimal logging (no API, code, GC, suspect, or handles samples).")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001026DEFINE_BOOL(log_all, false, "Log all events to the log file.")
1027DEFINE_BOOL(log_api, false, "Log API events to the log file.")
1028DEFINE_BOOL(log_code, false,
Steve Blocka7e24c12009-10-30 11:49:00 +00001029 "Log code events to the log file without profiling.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001030DEFINE_BOOL(log_gc, false,
Steve Blocka7e24c12009-10-30 11:49:00 +00001031 "Log heap samples on garbage collection for the hp2ps tool.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001032DEFINE_BOOL(log_handles, false, "Log global handle events.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001033DEFINE_BOOL(log_suspect, false, "Log suspect operations.")
1034DEFINE_BOOL(prof, false,
Steve Blocka7e24c12009-10-30 11:49:00 +00001035 "Log statistical profiling information (implies --log-code).")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001036DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.")
1037DEFINE_IMPLICATION(prof, prof_cpp)
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001038DEFINE_BOOL(prof_browser_mode, true,
Steve Block6ded16b2010-05-10 14:33:55 +01001039 "Used with --prof, turns on browser-compatible mode for profiling.")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001040DEFINE_BOOL(log_regexp, false, "Log regular expression execution.")
1041DEFINE_STRING(logfile, "v8.log", "Specify the name of the log file.")
1042DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
1043DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
1044DEFINE_BOOL(perf_basic_prof, false,
1045 "Enable perf linux profiler (basic support).")
1046DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001047DEFINE_BOOL(perf_basic_prof_only_functions, false,
1048 "Only report function code ranges to perf (i.e. no stubs).")
1049DEFINE_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof)
Ben Murdochda12d292016-06-02 14:46:10 +01001050DEFINE_BOOL(perf_prof, false,
1051 "Enable perf linux profiler (experimental annotate support).")
1052DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space)
1053DEFINE_BOOL(perf_prof_debug_info, false,
1054 "Enable debug info for perf linux profiler (experimental).")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001055DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
1056 "Specify the name of the file for fake gc mmap used in ll_prof")
1057DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")
1058DEFINE_BOOL(log_timer_events, false,
1059 "Time events including external callbacks.")
1060DEFINE_IMPLICATION(log_timer_events, log_internal_timer_events)
1061DEFINE_IMPLICATION(log_internal_timer_events, prof)
1062DEFINE_BOOL(log_instruction_stats, false, "Log AArch64 instruction statistics.")
1063DEFINE_STRING(log_instruction_file, "arm64_inst.csv",
1064 "AArch64 instruction statistics log file.")
1065DEFINE_INT(log_instruction_period, 1 << 22,
1066 "AArch64 instruction statistics logging period.")
1067
1068DEFINE_BOOL(redirect_code_traces, false,
1069 "output deopt information and disassembly into file "
1070 "code-<pid>-<isolate id>.asm")
1071DEFINE_STRING(redirect_code_traces_to, NULL,
1072 "output deopt information and disassembly into the given file")
1073
1074DEFINE_BOOL(hydrogen_track_positions, false,
1075 "track source code positions when building IR")
Steve Blocka7e24c12009-10-30 11:49:00 +00001076
1077//
Steve Blocka7e24c12009-10-30 11:49:00 +00001078// Disassembler only flags
1079//
1080#undef FLAG
1081#ifdef ENABLE_DISASSEMBLER
1082#define FLAG FLAG_FULL
1083#else
1084#define FLAG FLAG_READONLY
1085#endif
1086
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001087// elements.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001088DEFINE_BOOL(trace_elements_transitions, false, "trace elements transitions")
1089
1090DEFINE_BOOL(trace_creation_allocation_sites, false,
1091 "trace the creation of allocation sites")
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001092
Steve Blocka7e24c12009-10-30 11:49:00 +00001093// code-stubs.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001094DEFINE_BOOL(print_code_stubs, false, "print code stubs")
1095DEFINE_BOOL(test_secondary_stub_cache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001096 "test secondary stub cache by disabling the primary one")
1097
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001098DEFINE_BOOL(test_primary_stub_cache, false,
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001099 "test primary stub cache by disabling the secondary one")
Steve Blocka7e24c12009-10-30 11:49:00 +00001100
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001101
Steve Blocka7e24c12009-10-30 11:49:00 +00001102// codegen-ia32.cc / codegen-arm.cc
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001103DEFINE_BOOL(print_code, false, "print generated code")
1104DEFINE_BOOL(print_opt_code, false, "print optimized code")
1105DEFINE_BOOL(print_unopt_code, false,
1106 "print unoptimized code before "
Ben Murdochb0fe1622011-05-05 13:52:32 +01001107 "printing optimized code based on it")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001108DEFINE_BOOL(print_code_verbose, false, "print more information for code")
1109DEFINE_BOOL(print_builtin_code, false, "print generated code for builtins")
Steve Blocka7e24c12009-10-30 11:49:00 +00001110
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001111#ifdef ENABLE_DISASSEMBLER
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001112DEFINE_BOOL(sodium, false,
1113 "print generated code output suitable for use with "
1114 "the Sodium code viewer")
1115
1116DEFINE_IMPLICATION(sodium, print_code_stubs)
1117DEFINE_IMPLICATION(sodium, print_code)
1118DEFINE_IMPLICATION(sodium, print_opt_code)
1119DEFINE_IMPLICATION(sodium, hydrogen_track_positions)
1120DEFINE_IMPLICATION(sodium, code_comments)
1121
1122DEFINE_BOOL(print_all_code, false, "enable all flags related to printing code")
1123DEFINE_IMPLICATION(print_all_code, print_code)
1124DEFINE_IMPLICATION(print_all_code, print_opt_code)
1125DEFINE_IMPLICATION(print_all_code, print_unopt_code)
1126DEFINE_IMPLICATION(print_all_code, print_code_verbose)
1127DEFINE_IMPLICATION(print_all_code, print_builtin_code)
1128DEFINE_IMPLICATION(print_all_code, print_code_stubs)
1129DEFINE_IMPLICATION(print_all_code, code_comments)
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001130#ifdef DEBUG
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001131DEFINE_IMPLICATION(print_all_code, trace_codegen)
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001132#endif
1133#endif
1134
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001135
1136//
1137// VERIFY_PREDICTABLE related flags
1138//
1139#undef FLAG
1140
1141#ifdef VERIFY_PREDICTABLE
1142#define FLAG FLAG_FULL
1143#else
1144#define FLAG FLAG_READONLY
1145#endif
1146
1147DEFINE_BOOL(verify_predictable, false,
1148 "this mode is used for checking that V8 behaves predictably")
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001149DEFINE_INT(dump_allocations_digest_at_alloc, -1,
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001150 "dump allocations digest each n-th allocation")
1151
1152
1153//
1154// Read-only flags
1155//
1156#undef FLAG
1157#define FLAG FLAG_READONLY
1158
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001159// assembler.h
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001160DEFINE_BOOL(enable_embedded_constant_pool, V8_EMBEDDED_CONSTANT_POOL,
1161 "enable use of embedded constant pools (ARM/PPC only)")
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001162
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001163DEFINE_BOOL(unbox_double_fields, V8_DOUBLE_FIELDS_UNBOXING,
1164 "enable in-object double fields unboxing (64-bit only)")
1165DEFINE_IMPLICATION(unbox_double_fields, track_double_fields)
1166
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001167DEFINE_BOOL(global_var_shortcuts, false, "use ic-less global loads and stores")
1168
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001169
Steve Blocka7e24c12009-10-30 11:49:00 +00001170// Cleanup...
1171#undef FLAG_FULL
1172#undef FLAG_READONLY
1173#undef FLAG
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001174#undef FLAG_ALIAS
Steve Blocka7e24c12009-10-30 11:49:00 +00001175
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001176#undef DEFINE_BOOL
1177#undef DEFINE_MAYBE_BOOL
1178#undef DEFINE_INT
1179#undef DEFINE_STRING
1180#undef DEFINE_FLOAT
1181#undef DEFINE_ARGS
1182#undef DEFINE_IMPLICATION
1183#undef DEFINE_NEG_IMPLICATION
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001184#undef DEFINE_NEG_VALUE_IMPLICATION
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001185#undef DEFINE_VALUE_IMPLICATION
1186#undef DEFINE_ALIAS_BOOL
1187#undef DEFINE_ALIAS_INT
1188#undef DEFINE_ALIAS_STRING
1189#undef DEFINE_ALIAS_FLOAT
1190#undef DEFINE_ALIAS_ARGS
Steve Blocka7e24c12009-10-30 11:49:00 +00001191
1192#undef FLAG_MODE_DECLARE
1193#undef FLAG_MODE_DEFINE
1194#undef FLAG_MODE_DEFINE_DEFAULTS
1195#undef FLAG_MODE_META
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001196#undef FLAG_MODE_DEFINE_IMPLICATIONS
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001197
1198#undef COMMA