blob: 7fc4741c0b60fca8f304ba95857d0f71009b2fdd [file] [log] [blame]
danno@chromium.orgfa458e42012-02-01 10:48:36 +00001// Copyright 2012 the V8 project authors. All rights reserved.
kasperl@chromium.orgb9123622008-09-17 14:05:56 +00002// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28// This file defines all of the flags. It is separated into different section,
29// for Debug, Release, Logging and Profiling, etc. To add a new flag, find the
30// correct section, and use one of the DEFINE_ macros, without a trailing ';'.
31//
32// This include does not have a guard, because it is a template-style include,
33// which can be included multiple times in different modes. It expects to have
34// a mode defined before it's included. The modes are FLAG_MODE_... below:
35
36// We want to declare the names of the variables for the header file. Normally
37// this will just be an extern declaration, but for a readonly flag we let the
38// compiler make better optimizations by giving it the value.
39#if defined(FLAG_MODE_DECLARE)
40#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
41 extern ctype FLAG_##nam;
42#define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
43 static ctype const FLAG_##nam = def;
ricow@chromium.org7ad65222011-12-19 12:13:11 +000044#define DEFINE_implication(whenflag, thenflag)
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000045
46// We want to supply the actual storage and value for the flag variable in the
47// .cc file. We only do this for writable flags.
48#elif defined(FLAG_MODE_DEFINE)
49#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
50 ctype FLAG_##nam = def;
51#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
ricow@chromium.org7ad65222011-12-19 12:13:11 +000052#define DEFINE_implication(whenflag, thenflag)
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000053
54// We need to define all of our default values so that the Flag structure can
55// access them by pointer. These are just used internally inside of one .cc,
56// for MODE_META, so there is no impact on the flags interface.
57#elif defined(FLAG_MODE_DEFINE_DEFAULTS)
58#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
59 static ctype const FLAGDEFAULT_##nam = def;
60#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
ricow@chromium.org7ad65222011-12-19 12:13:11 +000061#define DEFINE_implication(whenflag, thenflag)
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000062
63// We want to write entries into our meta data table, for internal parsing and
64// printing / etc in the flag parser code. We only do this for writable flags.
65#elif defined(FLAG_MODE_META)
66#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
ager@chromium.org41826e72009-03-30 13:30:57 +000067 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false },
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000068#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
ricow@chromium.org7ad65222011-12-19 12:13:11 +000069#define DEFINE_implication(whenflag, thenflag)
70
71// We produce the code to set flags when it is implied by another flag.
72#elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
73#define FLAG_FULL(ftype, ctype, nam, def, cmt)
74#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
75#define DEFINE_implication(whenflag, thenflag) \
76 if (FLAG_##whenflag) FLAG_##thenflag = true;
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000077
78#else
79#error No mode supplied when including flags.defs
80#endif
81
ager@chromium.org3bf7b912008-11-17 09:09:45 +000082#ifdef FLAG_MODE_DECLARE
83// Structure used to hold a collection of arguments to the JavaScript code.
jkummerow@chromium.org1456e702012-03-30 08:38:13 +000084#define JSARGUMENTS_INIT {{}}
ager@chromium.org3bf7b912008-11-17 09:09:45 +000085struct JSArguments {
86public:
jkummerow@chromium.org1456e702012-03-30 08:38:13 +000087 inline int argc() const {
88 return static_cast<int>(storage_[0]);
89 }
90 inline const char** argv() const {
91 return reinterpret_cast<const char**>(storage_[1]);
92 }
93 inline const char*& operator[] (int idx) const {
94 return argv()[idx];
95 }
96 inline JSArguments& operator=(JSArguments args) {
97 set_argc(args.argc());
98 set_argv(args.argv());
99 return *this;
100 }
101 static JSArguments Create(int argc, const char** argv) {
102 JSArguments args;
103 args.set_argc(argc);
104 args.set_argv(argv);
105 return args;
106 }
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000107private:
jkummerow@chromium.org1456e702012-03-30 08:38:13 +0000108 void set_argc(int argc) {
109 storage_[0] = argc;
110 }
111 void set_argv(const char** argv) {
112 storage_[1] = reinterpret_cast<AtomicWord>(argv);
113 }
114public:
115 // Contains argc and argv. Unfortunately we have to store these two fields
116 // into a single one to avoid making the initialization macro (which would be
117 // "{ 0, NULL }") contain a coma.
118 AtomicWord storage_[2];
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000119};
120#endif
121
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000122#define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
123#define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
124#define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
125#define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000126#define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt)
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000127
128//
129// Flags in all modes.
130//
131#define FLAG FLAG_FULL
132
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000133// Flags for language modes and experimental language features.
134DEFINE_bool(use_strict, false, "enforce strict mode")
jkummerow@chromium.org78502a92012-09-06 13:50:42 +0000135DEFINE_bool(es5_readonly, true,
mmassi@chromium.org7028c052012-06-13 11:51:58 +0000136 "activate correct semantics for inheriting readonliness")
rossberg@chromium.org657d53b2012-07-12 11:06:03 +0000137DEFINE_bool(es52_globals, true,
mstarzinger@chromium.org88d326b2012-04-23 12:57:22 +0000138 "activate new semantics for global var declarations")
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000139
whesse@chromium.org4acdc2c2011-08-15 13:01:23 +0000140DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof")
rossberg@chromium.orgb4b2aa62011-10-13 09:49:59 +0000141DEFINE_bool(harmony_scoping, false, "enable harmony block scoping")
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000142DEFINE_bool(harmony_modules, false,
143 "enable harmony modules (implies block scoping)")
danno@chromium.org160a7b02011-04-18 15:51:38 +0000144DEFINE_bool(harmony_proxies, false, "enable harmony proxies")
erik.corry@gmail.com394dbcf2011-10-27 07:38:48 +0000145DEFINE_bool(harmony_collections, false,
146 "enable harmony collections (sets, maps, and weak maps)")
mvstanton@chromium.orge4ac3ef2012-11-12 14:53:34 +0000147DEFINE_bool(harmony_observation, false,
danno@chromium.org72204d52012-10-31 10:02:10 +0000148 "enable harmony object observation (implies harmony collections")
danno@chromium.orgfa458e42012-02-01 10:48:36 +0000149DEFINE_bool(harmony, false, "enable all harmony features (except typeof)")
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000150DEFINE_implication(harmony, harmony_scoping)
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000151DEFINE_implication(harmony, harmony_modules)
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000152DEFINE_implication(harmony, harmony_proxies)
153DEFINE_implication(harmony, harmony_collections)
mvstanton@chromium.orge4ac3ef2012-11-12 14:53:34 +0000154DEFINE_implication(harmony, harmony_observation)
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000155DEFINE_implication(harmony_modules, harmony_scoping)
mvstanton@chromium.orge4ac3ef2012-11-12 14:53:34 +0000156DEFINE_implication(harmony_observation, harmony_collections)
danno@chromium.org160a7b02011-04-18 15:51:38 +0000157
svenpanne@chromium.org6d786c92011-06-15 10:58:27 +0000158// Flags for experimental implementation features.
yangguo@chromium.org304cc332012-07-24 07:59:48 +0000159DEFINE_bool(packed_arrays, true, "optimizes arrays that have no holes")
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000160DEFINE_bool(smi_only_arrays, true, "tracks arrays with only smi values")
danno@chromium.org94b0d6f2013-02-04 13:33:20 +0000161DEFINE_bool(compiled_transitions, false, "use optimizing compiler to "
162 "generate array elements transition stubs")
rossberg@chromium.orgb4b2aa62011-10-13 09:49:59 +0000163DEFINE_bool(clever_optimizations,
164 true,
165 "Optimize object size, Array shift, DOM strings and string +")
svenpanne@chromium.org6d786c92011-06-15 10:58:27 +0000166
danno@chromium.orgfa458e42012-02-01 10:48:36 +0000167// Flags for data representation optimizations
168DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles")
169DEFINE_bool(string_slices, true, "use string slices")
170
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000171// Flags for Crankshaft.
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000172DEFINE_bool(crankshaft, true, "use crankshaft")
mstarzinger@chromium.org3233d2f2012-03-14 11:16:03 +0000173DEFINE_string(hydrogen_filter, "", "optimization filter")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000174DEFINE_bool(use_range, true, "use hydrogen range analysis")
175DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis")
176DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000177DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
178DEFINE_bool(use_inlining, true, "use function inlining")
mstarzinger@chromium.org88d326b2012-04-23 12:57:22 +0000179DEFINE_int(max_inlined_source_size, 600,
180 "maximum source size in bytes considered for a single inlining")
181DEFINE_int(max_inlined_nodes, 196,
182 "maximum number of AST nodes considered for a single inlining")
183DEFINE_int(max_inlined_nodes_cumulative, 196,
184 "maximum cumulative number of AST nodes considered for inlining")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000185DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion")
danno@chromium.org1f34ad32012-11-26 14:53:56 +0000186DEFINE_bool(fast_math, true, "faster (but maybe less accurate) math functions")
erikcorry0ad885c2011-11-21 13:51:57 +0000187DEFINE_bool(collect_megamorphic_maps_from_stub_cache,
188 true,
189 "crankshaft harvests type feedback from stub cache")
whesse@chromium.orgb08986c2011-03-14 16:13:42 +0000190DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000191DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
fschneider@chromium.org35814e52012-03-01 15:43:35 +0000192DEFINE_string(trace_phase, "Z", "trace generated IR for specified phases")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000193DEFINE_bool(trace_inlining, false, "trace inlining decisions")
194DEFINE_bool(trace_alloc, false, "trace register allocator")
fschneider@chromium.org3a5fd782011-02-24 10:10:44 +0000195DEFINE_bool(trace_all_uses, false, "trace all use positions")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000196DEFINE_bool(trace_range, false, "trace range analysis")
197DEFINE_bool(trace_gvn, false, "trace global value numbering")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000198DEFINE_bool(trace_representation, false, "trace representation types")
yangguo@chromium.org46a2a512013-01-18 16:29:40 +0000199DEFINE_bool(trace_track_allocation_sites, false,
200 "trace the tracking of allocation sites")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000201DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction")
202DEFINE_bool(stress_environments, false, "environment for every instruction")
203DEFINE_int(deopt_every_n_times,
204 0,
205 "deoptimize every n times a deopt point is passed")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000206DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing")
207DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
208DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000209DEFINE_bool(use_osr, true, "use on-stack replacement")
danno@chromium.org94b0d6f2013-02-04 13:33:20 +0000210DEFINE_bool(idefs, false, "use informative definitions")
ulan@chromium.org56c14af2012-09-20 12:51:09 +0000211DEFINE_bool(array_bounds_checks_elimination, true,
yangguo@chromium.orgefdb9d72012-04-26 08:21:05 +0000212 "perform array bounds checks elimination")
ulan@chromium.org56c14af2012-09-20 12:51:09 +0000213DEFINE_bool(array_index_dehoisting, true,
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000214 "perform array index dehoisting")
jkummerow@chromium.orgc1956672012-10-11 15:57:38 +0000215DEFINE_bool(dead_code_elimination, true, "use dead code elimination")
216DEFINE_bool(trace_dead_code_elimination, false, "trace dead code elimination")
yangguo@chromium.org28381b42013-01-21 14:39:38 +0000217DEFINE_bool(unreachable_code_elimination, false,
218 "eliminate unreachable code (hidden behind soft deopts)")
jkummerow@chromium.org59297c72013-01-09 16:32:23 +0000219DEFINE_bool(track_allocation_sites, true,
220 "Use allocation site info to reduce transitions")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000221DEFINE_bool(trace_osr, false, "trace on-stack replacement")
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000222DEFINE_int(stress_runs, 0, "number of stress runs")
sgjesse@chromium.orgc6c57182011-01-17 12:24:25 +0000223DEFINE_bool(optimize_closures, true, "optimize closures")
yangguo@chromium.org5a11aaf2012-06-20 11:29:00 +0000224DEFINE_bool(lookup_sample_by_shared, true,
225 "when picking a function to optimize, watch for shared function "
226 "info, not JSFunction itself")
ulan@chromium.orgd9e468a2012-06-25 09:47:40 +0000227DEFINE_bool(cache_optimized_code, true,
yangguo@chromium.org5a11aaf2012-06-20 11:29:00 +0000228 "cache optimized code for closures")
rossberg@chromium.org2c067b12012-03-19 11:01:52 +0000229DEFINE_bool(inline_construct, true, "inline constructor calls")
yangguo@chromium.org154ff992012-03-13 08:09:54 +0000230DEFINE_bool(inline_arguments, true, "inline functions with arguments object")
mstarzinger@chromium.orgde886792012-09-11 13:22:37 +0000231DEFINE_bool(inline_accessors, true, "inline JavaScript accessors")
danno@chromium.orgfa458e42012-02-01 10:48:36 +0000232DEFINE_int(loop_weight, 1, "loop weight for representation inference")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000233
ulan@chromium.org967e2702012-02-28 09:49:15 +0000234DEFINE_bool(optimize_for_in, true,
yangguo@chromium.orga7d3df92012-02-27 11:46:55 +0000235 "optimize functions containing for-in loops")
yangguo@chromium.org46839fb2012-08-28 09:06:19 +0000236DEFINE_bool(opt_safe_uint32_operations, true,
yangguo@chromium.orgfb377212012-11-16 14:43:43 +0000237 "allow uint32 values on optimize frames if they are used only in "
yangguo@chromium.org46839fb2012-08-28 09:06:19 +0000238 "safe operations")
yangguo@chromium.orga7d3df92012-02-27 11:46:55 +0000239
yangguo@chromium.org304cc332012-07-24 07:59:48 +0000240DEFINE_bool(parallel_recompilation, false,
241 "optimizing hot functions asynchronously on a separate thread")
242DEFINE_bool(trace_parallel_recompilation, false, "track parallel recompilation")
243DEFINE_int(parallel_recompilation_queue_length, 2,
244 "the length of the parallel compilation queue")
yangguo@chromium.orgfb377212012-11-16 14:43:43 +0000245DEFINE_bool(manual_parallel_recompilation, false,
246 "disable automatic optimization")
247DEFINE_implication(manual_parallel_recompilation, parallel_recompilation)
yangguo@chromium.org304cc332012-07-24 07:59:48 +0000248
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000249// Experimental profiler changes.
jkummerow@chromium.org531dfe82012-03-20 13:01:16 +0000250DEFINE_bool(experimental_profiler, true, "enable all profiler experiments")
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000251DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability")
svenpanne@chromium.org4efbdb12012-03-12 08:18:42 +0000252DEFINE_int(frame_count, 1, "number of stack frames inspected by the profiler")
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000253DEFINE_bool(self_optimization, false,
254 "primitive functions trigger their own optimization")
svenpanne@chromium.org4efbdb12012-03-12 08:18:42 +0000255DEFINE_bool(direct_self_opt, false,
256 "call recompile stub directly when self-optimizing")
257DEFINE_bool(retry_self_opt, false, "re-try self-optimization if it failed")
kmillikin@chromium.orgbe6bd102012-02-23 08:45:21 +0000258DEFINE_bool(interrupt_at_exit, false,
259 "insert an interrupt check at function exit")
yangguo@chromium.org56454712012-02-16 15:33:53 +0000260DEFINE_bool(weighted_back_edges, false,
261 "weight back edges by jump distance for interrupt triggering")
mstarzinger@chromium.org471f2f12012-08-10 14:46:33 +0000262 // 0x1700 fits in the immediate field of an ARM instruction.
263DEFINE_int(interrupt_budget, 0x1700,
yangguo@chromium.org56454712012-02-16 15:33:53 +0000264 "execution budget before interrupt is triggered")
mstarzinger@chromium.org3233d2f2012-03-14 11:16:03 +0000265DEFINE_int(type_info_threshold, 15,
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000266 "percentage of ICs that must have type info to allow optimization")
svenpanne@chromium.org4efbdb12012-03-12 08:18:42 +0000267DEFINE_int(self_opt_count, 130, "call count before self-optimization")
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000268
269DEFINE_implication(experimental_profiler, watch_ic_patching)
270DEFINE_implication(experimental_profiler, self_optimization)
svenpanne@chromium.org4efbdb12012-03-12 08:18:42 +0000271// Not implying direct_self_opt here because it seems to be a bad idea.
272DEFINE_implication(experimental_profiler, retry_self_opt)
kmillikin@chromium.orgbe6bd102012-02-23 08:45:21 +0000273DEFINE_implication(experimental_profiler, interrupt_at_exit)
yangguo@chromium.org56454712012-02-16 15:33:53 +0000274DEFINE_implication(experimental_profiler, weighted_back_edges)
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000275
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000276DEFINE_bool(trace_opt_verbose, false, "extra verbose compilation tracing")
277DEFINE_implication(trace_opt_verbose, trace_opt)
278
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000279// assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000280DEFINE_bool(debug_code, false,
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000281 "generate extra code (assertions) for debugging")
282DEFINE_bool(code_comments, false, "emit comments in code disassembly")
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000283DEFINE_bool(enable_sse2, true,
284 "enable use of SSE2 instructions if available")
285DEFINE_bool(enable_sse3, true,
286 "enable use of SSE3 instructions if available")
kmillikin@chromium.orgf05f2912010-09-30 10:07:24 +0000287DEFINE_bool(enable_sse4_1, true,
288 "enable use of SSE4.1 instructions if available")
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000289DEFINE_bool(enable_cmov, true,
290 "enable use of CMOV instruction if available")
291DEFINE_bool(enable_rdtsc, true,
292 "enable use of RDTSC instruction if available")
293DEFINE_bool(enable_sahf, true,
294 "enable use of SAHF instruction if available (X64 only)")
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000295DEFINE_bool(enable_vfp3, true,
ager@chromium.orga9aa5fa2011-04-13 08:46:07 +0000296 "enable use of VFP3 instructions if available - this implies "
verwaest@chromium.orgb6d052d2012-07-27 08:03:27 +0000297 "enabling ARMv7 and VFP2 instructions (ARM only)")
298DEFINE_bool(enable_vfp2, true,
299 "enable use of VFP2 instructions if available")
ager@chromium.org5c838252010-02-19 08:53:10 +0000300DEFINE_bool(enable_armv7, true,
301 "enable use of ARMv7 instructions if available (ARM only)")
verwaest@chromium.org33e09c82012-10-10 17:07:22 +0000302DEFINE_bool(enable_sudiv, true,
303 "enable use of SDIV and UDIV instructions if available (ARM only)")
rossberg@chromium.org89e18f52012-10-22 13:09:53 +0000304DEFINE_bool(enable_movw_movt, false,
305 "enable loading 32-bit constant by means of movw/movt "
306 "instruction pairs (ARM only)")
307DEFINE_bool(enable_unaligned_accesses, true,
308 "enable unaligned accesses for ARMv7 (ARM only)")
yangguo@chromium.org003650e2013-01-24 16:31:08 +0000309DEFINE_bool(enable_32dregs, true,
310 "enable use of d16-d31 registers on ARM - this requires VFP3")
lrn@chromium.org7516f052011-03-30 08:52:27 +0000311DEFINE_bool(enable_fpu, true,
312 "enable use of MIPS FPU instructions if available (MIPS only)")
yangguo@chromium.org4cd70b42013-01-04 08:57:54 +0000313DEFINE_bool(enable_vldr_imm, false,
314 "enable use of constant pools for double immediate (ARM only)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000315
316// bootstrapper.cc
317DEFINE_string(expose_natives_as, NULL, "expose natives in global object")
318DEFINE_string(expose_debug_as, NULL, "expose debug in global object")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000319DEFINE_bool(expose_gc, false, "expose gc extension")
ricow@chromium.org5ad5ace2010-06-23 09:06:43 +0000320DEFINE_bool(expose_externalize_string, false,
321 "expose externalize string extension")
kasperl@chromium.org86f77b72009-07-06 08:21:57 +0000322DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture")
erik.corry@gmail.com394dbcf2011-10-27 07:38:48 +0000323DEFINE_bool(builtins_in_stack_traces, false,
324 "show built-in functions in stack traces")
kmillikin@chromium.org5d8f0e62010-03-24 08:21:20 +0000325DEFINE_bool(disable_native_files, false, "disable builtin natives files")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000326
327// builtins-ia32.cc
328DEFINE_bool(inline_new, true, "use fast inline allocation")
329
330// checks.cc
331DEFINE_bool(stack_trace_on_abort, true,
332 "print a stack trace if an assertion failure occurs")
333
334// codegen-ia32.cc / codegen-arm.cc
335DEFINE_bool(trace, false, "trace function calls")
fschneider@chromium.orge03fb642010-11-01 12:34:09 +0000336DEFINE_bool(mask_constants_with_cookie,
337 true,
338 "use random jit cookie to mask large constants")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000339
340// codegen.cc
341DEFINE_bool(lazy, true, "use lazy compilation")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000342DEFINE_bool(trace_opt, false, "trace lazy optimization")
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000343DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000344DEFINE_bool(opt, true, "use adaptive optimizations")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000345DEFINE_bool(always_opt, false, "always try to optimize functions")
346DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt")
mmassi@chromium.org2f0efde2013-02-06 14:12:58 +0000347DEFINE_bool(trace_deopt, false, "trace optimize function deoptimization")
348DEFINE_bool(trace_stub_failures, false,
349 "trace deoptimization of generated code stubs")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000350
351// compiler.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000352DEFINE_int(min_preparse_length, 1024,
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000353 "minimum length for automatic enable preparsing")
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +0000354DEFINE_bool(always_full_compiler, false,
355 "try to use the dedicated run-once backend for all code")
verwaest@chromium.orgde64f722012-08-16 15:44:54 +0000356DEFINE_int(max_opt_count, 10,
357 "maximum number of optimization attempts before giving up.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000358
kasperl@chromium.org71affb52009-05-26 05:44:31 +0000359// compilation-cache.cc
360DEFINE_bool(compilation_cache, true, "enable compilation cache")
361
erik.corry@gmail.com3847bd52011-04-27 10:38:56 +0000362DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions")
363
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000364// debug.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000365DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response")
hpayer@chromium.org7c3372b2013-02-13 17:26:04 +0000366DEFINE_bool(trace_js_array_abuse, false,
367 "trace out-of-bounds accesses to JS arrays")
368DEFINE_bool(trace_external_array_abuse, false,
369 "trace out-of-bounds-accesses to external arrays")
370DEFINE_bool(trace_array_abuse, false,
371 "trace out-of-bounds accesses to all arrays")
372DEFINE_implication(trace_array_abuse, trace_js_array_abuse)
373DEFINE_implication(trace_array_abuse, trace_external_array_abuse)
sgjesse@chromium.orgac6aa172009-12-04 12:29:05 +0000374DEFINE_bool(debugger_auto_break, true,
ager@chromium.orgbb29dc92009-03-24 13:25:23 +0000375 "automatically set the debug break flag when debugger commands are "
sgjesse@chromium.orgac6aa172009-12-04 12:29:05 +0000376 "in the queue")
ager@chromium.orgce5e87b2010-03-10 10:24:18 +0000377DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature")
rossberg@chromium.org2c067b12012-03-19 11:01:52 +0000378DEFINE_bool(break_on_abort, true, "always cause a debug break before aborting")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000379
sgjesse@chromium.org496c03a2011-02-14 12:05:43 +0000380// execution.cc
fschneider@chromium.org7d10be52012-04-10 12:30:14 +0000381// Slightly less than 1MB on 64-bit, since Windows' default stack size for
382// the main execution thread is 1MB for both 32 and 64-bit.
383DEFINE_int(stack_size, kPointerSize * 123,
danno@chromium.orgfa458e42012-02-01 10:48:36 +0000384 "default size of stack region v8 is allowed to use (in kBytes)")
sgjesse@chromium.org496c03a2011-02-14 12:05:43 +0000385
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000386// frames.cc
387DEFINE_int(max_stack_trace_source_length, 300,
388 "maximum length of function source code printed in a stack trace.")
389
erik.corry@gmail.comd88afa22010-09-15 12:33:05 +0000390// full-codegen.cc
391DEFINE_bool(always_inline_smi_code, false,
392 "always inline smi code in non-opt code")
393
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000394// heap.cc
kmillikin@chromium.orgf05f2912010-09-30 10:07:24 +0000395DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)")
396DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)")
ager@chromium.org01fe7df2010-11-10 11:59:11 +0000397DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000398DEFINE_bool(gc_global, false, "always perform global GCs")
399DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
400DEFINE_bool(trace_gc, false,
401 "print one trace line following each garbage collection")
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +0000402DEFINE_bool(trace_gc_nvp, false,
403 "print one detailed trace line in name=value format "
404 "after each garbage collection")
mstarzinger@chromium.org471f2f12012-08-10 14:46:33 +0000405DEFINE_bool(trace_gc_ignore_scavenger, false,
406 "do not print trace line after scavenger collection")
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +0000407DEFINE_bool(print_cumulative_gc_stat, false,
408 "print cumulative GC statistics in name=value format on exit")
kasperl@chromium.orge959c182009-07-27 08:59:04 +0000409DEFINE_bool(trace_gc_verbose, false,
410 "print more details following each garbage collection")
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000411DEFINE_bool(trace_fragmentation, false,
412 "report fragmentation for old pointer and data pages")
mstarzinger@chromium.org471f2f12012-08-10 14:46:33 +0000413DEFINE_bool(trace_external_memory, false,
414 "print amount of external allocated memory after each time "
415 "it is adjusted.")
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000416DEFINE_bool(collect_maps, true,
kasperl@chromium.org9bbf9682008-10-30 11:53:07 +0000417 "garbage collect maps from which no objects can be reached")
ulan@chromium.org6ba1fd02013-02-14 14:56:11 +0000418DEFINE_bool(weak_embedded_maps_in_optimized_code, true,
mstarzinger@chromium.org068ea0a2013-01-30 09:39:44 +0000419 "make maps embedded in optimized code weak")
ricow@chromium.org5ad5ace2010-06-23 09:06:43 +0000420DEFINE_bool(flush_code, true,
verwaest@chromium.orge4ee6de2012-11-06 12:13:00 +0000421 "flush code that we expect not to use again (during full gc)")
mmassi@chromium.org49a44672012-12-04 13:52:03 +0000422DEFINE_bool(flush_code_incrementally, true,
verwaest@chromium.orge4ee6de2012-11-06 12:13:00 +0000423 "flush code that we expect not to use again (incrementally)")
svenpanne@chromium.org83130cf2012-11-30 10:13:25 +0000424DEFINE_bool(age_code, true,
mvstanton@chromium.orge4ac3ef2012-11-12 14:53:34 +0000425 "track un-executed functions to age code and flush only "
426 "old code")
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000427DEFINE_bool(incremental_marking, true, "use incremental marking")
428DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps")
429DEFINE_bool(trace_incremental_marking, false,
430 "trace progress of the incremental marking")
jkummerow@chromium.org28583c92012-07-16 11:31:55 +0000431DEFINE_bool(track_gc_object_stats, false,
432 "track object counts and memory usage")
hpayer@chromium.org7c3372b2013-02-13 17:26:04 +0000433DEFINE_bool(parallel_sweeping, true, "enable parallel sweeping")
mstarzinger@chromium.orge3b8d0f2013-02-01 09:06:41 +0000434DEFINE_bool(concurrent_sweeping, false, "enable concurrent sweeping")
435DEFINE_int(sweeper_threads, 1,
436 "number of parallel and concurrent sweeping threads")
437DEFINE_bool(parallel_marking, false, "enable parallel marking")
438DEFINE_int(marking_threads, 1, "number of parallel marking threads")
svenpanne@chromium.orgc859c4f2012-10-15 11:51:39 +0000439#ifdef VERIFY_HEAP
440DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
441#endif
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000442
ager@chromium.orgadd848f2009-08-13 12:44:13 +0000443// v8.cc
444DEFINE_bool(use_idle_notification, true,
445 "Use idle notification to reduce memory footprint.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000446// ic.cc
447DEFINE_bool(use_ic, true, "use inline caching")
448
449// macro-assembler-ia32.cc
450DEFINE_bool(native_code_counters, false,
451 "generate extra code for manipulating stats counters")
452
453// mark-compact.cc
454DEFINE_bool(always_compact, false, "Perform compaction on every full GC")
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000455DEFINE_bool(lazy_sweeping, true,
456 "Use lazy sweeping for old pointer and data spaces")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000457DEFINE_bool(never_compact, false,
458 "Never perform compaction on full GC - testing only")
yangguo@chromium.org78d1ad42012-02-09 13:53:47 +0000459DEFINE_bool(compact_code_space, true,
jkummerow@chromium.orgab7dad42012-02-07 12:07:34 +0000460 "Compact code space on full non-incremental collections")
ulan@chromium.org56c14af2012-09-20 12:51:09 +0000461DEFINE_bool(incremental_code_compaction, true,
462 "Compact code space on full incremental collections")
ager@chromium.orgea91cc52011-05-23 06:06:11 +0000463DEFINE_bool(cleanup_code_caches_at_gc, true,
464 "Flush inline caches prior to mark compact collection and "
465 "flush code caches in maps during mark compact cycle.")
ulan@chromium.org8e8d8822012-11-23 14:36:46 +0000466DEFINE_bool(use_marking_progress_bar, true,
yangguo@chromium.orgfb377212012-11-16 14:43:43 +0000467 "Use a progress bar to scan large objects in increments when "
468 "incremental marking is active.")
sgjesse@chromium.orgdf7a2842010-03-25 14:34:15 +0000469DEFINE_int(random_seed, 0,
470 "Default seed for initializing random generator "
471 "(0, the default, means to use system random).")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000472
whesse@chromium.org023421e2010-12-21 12:19:12 +0000473// objects.cc
474DEFINE_bool(use_verbose_printer, true, "allows verbose printing")
475
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000476// parser.cc
477DEFINE_bool(allow_natives_syntax, false, "allow natives syntax")
yangguo@chromium.org304cc332012-07-24 07:59:48 +0000478DEFINE_bool(trace_parse, false, "trace parsing and preparsing")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000479
ager@chromium.org5c838252010-02-19 08:53:10 +0000480// simulator-arm.cc and simulator-mips.cc
ricow@chromium.orgc9c80822010-04-21 08:22:37 +0000481DEFINE_bool(trace_sim, false, "Trace simulator execution")
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000482DEFINE_bool(check_icache, false,
483 "Check icache flushes in ARM and MIPS simulator")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000484DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions")
ricow@chromium.orgc9c80822010-04-21 08:22:37 +0000485DEFINE_int(sim_stack_alignment, 8,
486 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000487
vegorov@chromium.org7304bca2011-05-16 12:14:13 +0000488// isolate.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000489DEFINE_bool(trace_exception, false,
490 "print stack trace when throwing exceptions")
491DEFINE_bool(preallocate_message_memory, false,
492 "preallocate some memory to build stack traces.")
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +0000493DEFINE_bool(randomize_hashes,
rossberg@chromium.orgfab14982012-01-05 15:02:15 +0000494 true,
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +0000495 "randomize hashes to avoid predictable hash collisions "
rossberg@chromium.orgfab14982012-01-05 15:02:15 +0000496 "(with snapshots this option cannot override the baked-in seed)")
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +0000497DEFINE_int(hash_seed,
rossberg@chromium.orgfab14982012-01-05 15:02:15 +0000498 0,
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +0000499 "Fixed seed to use to hash property keys (0 means random)"
rossberg@chromium.orgfab14982012-01-05 15:02:15 +0000500 "(with snapshots this option cannot override the baked-in seed)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000501
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000502// v8.cc
503DEFINE_bool(preemption, false,
504 "activate a 100ms timer that switches between V8 threads")
505
ager@chromium.org381abbb2009-02-25 13:23:22 +0000506// Regexp
ager@chromium.org381abbb2009-02-25 13:23:22 +0000507DEFINE_bool(regexp_optimization, true, "generate optimized regexp code")
ager@chromium.orga74f0da2008-12-03 16:05:52 +0000508
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000509// Testing flags test/cctest/test-{flags,api,serialization}.cc
510DEFINE_bool(testing_bool_flag, true, "testing_bool_flag")
511DEFINE_int(testing_int_flag, 13, "testing_int_flag")
512DEFINE_float(testing_float_flag, 2.5, "float-flag")
513DEFINE_string(testing_string_flag, "Hello, world!", "string-flag")
514DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness")
515#ifdef WIN32
516DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
517 "file in which to testing_serialize heap")
518#else
519DEFINE_string(testing_serialization_file, "/tmp/serdes",
520 "file in which to serialize heap")
521#endif
522
yangguo@chromium.org5a11aaf2012-06-20 11:29:00 +0000523// mksnapshot.cc
524DEFINE_string(extra_code, NULL, "A filename with extra code to be included in"
525 " the snapshot (mksnapshot only)")
526
kasperl@chromium.org5a8ca6c2008-10-23 13:57:19 +0000527//
528// Dev shell flags
529//
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000530
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000531DEFINE_bool(help, false, "Print usage message, including flags, on console")
kasperl@chromium.org5a8ca6c2008-10-23 13:57:19 +0000532DEFINE_bool(dump_counters, false, "Dump counters on exit")
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000533
534#ifdef ENABLE_DEBUGGER_SUPPORT
vegorov@chromium.org2356e6f2010-06-09 09:38:56 +0000535DEFINE_bool(debugger, false, "Enable JavaScript debugger")
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000536DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the "
537 "debugger agent in another process")
538DEFINE_bool(debugger_agent, false, "Enable debugger agent")
539DEFINE_int(debugger_port, 5858, "Port to use for remote debugging")
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000540#endif // ENABLE_DEBUGGER_SUPPORT
541
ager@chromium.org9ee27ae2011-03-02 13:43:26 +0000542DEFINE_string(map_counters, "", "Map counters to a file")
jkummerow@chromium.org1456e702012-03-30 08:38:13 +0000543DEFINE_args(js_arguments, JSARGUMENTS_INIT,
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000544 "Pass all remaining arguments to the script. Alias for \"--\".")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000545
kmillikin@chromium.orgd2c22f02011-01-10 08:15:37 +0000546#if defined(WEBOS__)
547DEFINE_bool(debug_compile_events, false, "Enable debugger compile events")
548DEFINE_bool(debug_script_collected_events, false,
549 "Enable debugger script collected events")
550#else
551DEFINE_bool(debug_compile_events, true, "Enable debugger compile events")
552DEFINE_bool(debug_script_collected_events, true,
553 "Enable debugger script collected events")
554#endif
555
erik.corry@gmail.com0511e242011-01-19 11:11:08 +0000556
557//
558// GDB JIT integration flags.
559//
560
561DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)")
562DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects")
kmillikin@chromium.org49edbdf2011-02-16 12:32:18 +0000563DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk")
ricow@chromium.org4f693d62011-07-04 14:01:31 +0000564DEFINE_string(gdbjit_dump_filter, "",
565 "dump only objects containing this substring")
erik.corry@gmail.com0511e242011-01-19 11:11:08 +0000566
rossberg@chromium.orgb4b2aa62011-10-13 09:49:59 +0000567// mark-compact.cc
568DEFINE_bool(force_marking_deque_overflows, false,
569 "force overflows of marking deque by reducing it's size "
570 "to 64 words")
571
572DEFINE_bool(stress_compaction, false,
573 "stress the GC compactor to flush out bugs (implies "
574 "--force_marking_deque_overflows)")
575
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000576//
577// Debug only flags
578//
579#undef FLAG
580#ifdef DEBUG
581#define FLAG FLAG_FULL
582#else
583#define FLAG FLAG_READONLY
584#endif
585
586// checks.cc
587DEFINE_bool(enable_slow_asserts, false,
588 "enable asserts that are slow to execute")
589
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000590// codegen-ia32.cc / codegen-arm.cc
591DEFINE_bool(trace_codegen, false,
592 "print name of functions for which code is generated")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000593DEFINE_bool(print_source, false, "pretty print source code")
594DEFINE_bool(print_builtin_source, false,
595 "pretty print source code for builtins")
596DEFINE_bool(print_ast, false, "print source AST")
597DEFINE_bool(print_builtin_ast, false, "print source AST for builtins")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000598DEFINE_string(stop_at, "", "function name where to insert a breakpoint")
599
600// compiler.cc
601DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins")
602DEFINE_bool(print_scopes, false, "print scopes")
603
604// contexts.cc
605DEFINE_bool(trace_contexts, false, "trace contexts operations")
606
607// heap.cc
608DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations")
609DEFINE_bool(gc_verbose, false, "print stuff during garbage collection")
610DEFINE_bool(heap_stats, false, "report heap statistics before and after GC")
611DEFINE_bool(code_stats, false, "report code statistics after GC")
yangguo@chromium.org46839fb2012-08-28 09:06:19 +0000612DEFINE_bool(verify_native_context_separation, false,
613 "verify that code holds on to at most one native context after GC")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000614DEFINE_bool(print_handles, false, "report handles after GC")
615DEFINE_bool(print_global_handles, false, "report global handles after GC")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000616
617// ic.cc
618DEFINE_bool(trace_ic, false, "trace inline cache state transitions")
619
erik.corry@gmail.combbceb572012-03-09 10:52:05 +0000620// interface.cc
621DEFINE_bool(print_interfaces, false, "print interfaces")
622DEFINE_bool(print_interface_details, false, "print interface inference details")
623DEFINE_int(print_interface_depth, 5, "depth for printing interfaces")
624
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000625// objects.cc
626DEFINE_bool(trace_normalization,
627 false,
628 "prints when objects are turned into dictionaries.")
629
630// runtime.cc
631DEFINE_bool(trace_lazy, false, "trace lazy compilation")
632
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000633// spaces.cc
634DEFINE_bool(collect_heap_spill_statistics, false,
635 "report heap spill statistics along with heap_stats "
636 "(requires heap_stats)")
637
sgjesse@chromium.orgea88ce92011-03-23 11:19:56 +0000638DEFINE_bool(trace_isolates, false, "trace isolate state changes")
639
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000640// VM state
641DEFINE_bool(log_state_changes, false, "Log state changes.")
642
ager@chromium.org381abbb2009-02-25 13:23:22 +0000643// Regexp
fschneider@chromium.org0c20e672010-01-14 15:28:53 +0000644DEFINE_bool(regexp_possessive_quantifier,
645 false,
646 "enable possessive quantifier syntax for testing")
ager@chromium.org381abbb2009-02-25 13:23:22 +0000647DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
648DEFINE_bool(trace_regexp_assembler,
649 false,
650 "trace regexp macro assembler calls.")
ager@chromium.orga74f0da2008-12-03 16:05:52 +0000651
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000652//
whesse@chromium.org030d38e2011-07-13 13:23:34 +0000653// Logging and profiling flags
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000654//
655#undef FLAG
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000656#define FLAG FLAG_FULL
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000657
658// log.cc
659DEFINE_bool(log, false,
660 "Minimal logging (no API, code, GC, suspect, or handles samples).")
661DEFINE_bool(log_all, false, "Log all events to the log file.")
ager@chromium.org381abbb2009-02-25 13:23:22 +0000662DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000663DEFINE_bool(log_api, false, "Log API events to the log file.")
664DEFINE_bool(log_code, false,
665 "Log code events to the log file without profiling.")
666DEFINE_bool(log_gc, false,
667 "Log heap samples on garbage collection for the hp2ps tool.")
668DEFINE_bool(log_handles, false, "Log global handle events.")
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +0000669DEFINE_bool(log_snapshot_positions, false,
670 "log positions of (de)serialized objects in the snapshot.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000671DEFINE_bool(log_suspect, false, "Log suspect operations.")
672DEFINE_bool(prof, false,
673 "Log statistical profiling information (implies --log-code).")
iposva@chromium.org245aa852009-02-10 00:49:54 +0000674DEFINE_bool(prof_auto, true,
675 "Used with --prof, starts profiling automatically")
kasperl@chromium.org71affb52009-05-26 05:44:31 +0000676DEFINE_bool(prof_lazy, false,
677 "Used with --prof, only does sampling and logging"
678 " when profiler is active (implies --noprof_auto).")
ager@chromium.org357bf652010-04-12 11:30:10 +0000679DEFINE_bool(prof_browser_mode, true,
680 "Used with --prof, turns on browser-compatible mode for profiling.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000681DEFINE_bool(log_regexp, false, "Log regular expression execution.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000682DEFINE_string(logfile, "v8.log", "Specify the name of the log file.")
whesse@chromium.org4a5224e2010-10-20 12:37:07 +0000683DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.")
mstarzinger@chromium.orgde886792012-09-11 13:22:37 +0000684DEFINE_string(gc_fake_mmap, "/tmp/__v8_gc__",
685 "Specify the name of the file for fake gc mmap used in ll_prof")
mstarzinger@chromium.org32280cf2012-12-06 17:32:37 +0000686DEFINE_bool(log_internal_timer_events, false, "Time internal events.")
687DEFINE_bool(log_timer_events, false,
688 "Time events including external callbacks.")
689DEFINE_implication(log_timer_events, log_internal_timer_events)
yangguo@chromium.org5a11aaf2012-06-20 11:29:00 +0000690
kasperl@chromium.orgf5aa8372009-03-24 14:47:14 +0000691//
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000692// Disassembler only flags
693//
694#undef FLAG
695#ifdef ENABLE_DISASSEMBLER
696#define FLAG FLAG_FULL
697#else
698#define FLAG FLAG_READONLY
699#endif
700
erik.corry@gmail.com394dbcf2011-10-27 07:38:48 +0000701// elements.cc
702DEFINE_bool(trace_elements_transitions, false, "trace elements transitions")
703
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000704// code-stubs.cc
705DEFINE_bool(print_code_stubs, false, "print code stubs")
ulan@chromium.org812308e2012-02-29 15:58:45 +0000706DEFINE_bool(test_secondary_stub_cache,
707 false,
708 "test secondary stub cache by disabling the primary one")
709
710DEFINE_bool(test_primary_stub_cache,
711 false,
712 "test primary stub cache by disabling the secondary one")
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000713
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000714// codegen-ia32.cc / codegen-arm.cc
715DEFINE_bool(print_code, false, "print generated code")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000716DEFINE_bool(print_opt_code, false, "print optimized code")
whesse@chromium.org023421e2010-12-21 12:19:12 +0000717DEFINE_bool(print_unopt_code, false, "print unoptimized code before "
718 "printing optimized code based on it")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000719DEFINE_bool(print_code_verbose, false, "print more information for code")
ager@chromium.org8bb60582008-12-11 12:02:20 +0000720DEFINE_bool(print_builtin_code, false, "print generated code for builtins")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000721
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000722#ifdef ENABLE_DISASSEMBLER
723DEFINE_bool(print_all_code, false, "enable all flags related to printing code")
724DEFINE_implication(print_all_code, print_code)
725DEFINE_implication(print_all_code, print_opt_code)
726DEFINE_implication(print_all_code, print_unopt_code)
727DEFINE_implication(print_all_code, print_code_verbose)
728DEFINE_implication(print_all_code, print_builtin_code)
729DEFINE_implication(print_all_code, print_code_stubs)
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000730DEFINE_implication(print_all_code, code_comments)
danno@chromium.orgbf0c8202011-12-27 10:09:42 +0000731#ifdef DEBUG
732DEFINE_implication(print_all_code, trace_codegen)
733#endif
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000734#endif
735
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000736// Cleanup...
737#undef FLAG_FULL
738#undef FLAG_READONLY
739#undef FLAG
740
741#undef DEFINE_bool
742#undef DEFINE_int
743#undef DEFINE_string
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000744#undef DEFINE_implication
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000745
746#undef FLAG_MODE_DECLARE
747#undef FLAG_MODE_DEFINE
748#undef FLAG_MODE_DEFINE_DEFAULTS
749#undef FLAG_MODE_META
ricow@chromium.org7ad65222011-12-19 12:13:11 +0000750#undef FLAG_MODE_DEFINE_IMPLICATIONS