blob: 2d8f6fa95a281f1064e15eee4673a2ddb760a0d0 [file] [log] [blame]
kmillikin@chromium.orgc36ce6e2011-04-04 08:25:31 +00001// Copyright 2011 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;
44
45// We want to supply the actual storage and value for the flag variable in the
46// .cc file. We only do this for writable flags.
47#elif defined(FLAG_MODE_DEFINE)
48#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
49 ctype FLAG_##nam = def;
50#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
51
52// We need to define all of our default values so that the Flag structure can
53// access them by pointer. These are just used internally inside of one .cc,
54// for MODE_META, so there is no impact on the flags interface.
55#elif defined(FLAG_MODE_DEFINE_DEFAULTS)
56#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
57 static ctype const FLAGDEFAULT_##nam = def;
58#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
59
60
61// We want to write entries into our meta data table, for internal parsing and
62// printing / etc in the flag parser code. We only do this for writable flags.
63#elif defined(FLAG_MODE_META)
64#define FLAG_FULL(ftype, ctype, nam, def, cmt) \
ager@chromium.org41826e72009-03-30 13:30:57 +000065 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false },
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000066#define FLAG_READONLY(ftype, ctype, nam, def, cmt)
67
68#else
69#error No mode supplied when including flags.defs
70#endif
71
ager@chromium.org3bf7b912008-11-17 09:09:45 +000072#ifdef FLAG_MODE_DECLARE
73// Structure used to hold a collection of arguments to the JavaScript code.
74struct JSArguments {
75public:
76 JSArguments();
77 JSArguments(int argc, const char** argv);
78 int argc() const;
79 const char** argv();
80 const char*& operator[](int idx);
81 JSArguments& operator=(JSArguments args);
82private:
83 int argc_;
84 const char** argv_;
85};
86#endif
87
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000088#define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
89#define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
90#define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
91#define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
ager@chromium.org3bf7b912008-11-17 09:09:45 +000092#define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt)
kasperl@chromium.orgb9123622008-09-17 14:05:56 +000093
94//
95// Flags in all modes.
96//
97#define FLAG FLAG_FULL
98
danno@chromium.org160a7b02011-04-18 15:51:38 +000099// Flags for experimental language features.
whesse@chromium.org4acdc2c2011-08-15 13:01:23 +0000100DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof")
danno@chromium.org160a7b02011-04-18 15:51:38 +0000101DEFINE_bool(harmony_proxies, false, "enable harmony proxies")
kmillikin@chromium.org7c2628c2011-08-10 11:27:35 +0000102DEFINE_bool(harmony_weakmaps, false, "enable harmony weak maps")
whesse@chromium.org4acdc2c2011-08-15 13:01:23 +0000103DEFINE_bool(harmony_block_scoping, false, "enable harmony block scoping")
danno@chromium.org160a7b02011-04-18 15:51:38 +0000104
svenpanne@chromium.org6d786c92011-06-15 10:58:27 +0000105// Flags for experimental implementation features.
ricow@chromium.org2c99e282011-07-28 09:15:17 +0000106DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles")
svenpanne@chromium.org6d786c92011-06-15 10:58:27 +0000107
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000108// Flags for Crankshaft.
lrn@chromium.org7516f052011-03-30 08:52:27 +0000109#ifdef V8_TARGET_ARCH_MIPS
110 DEFINE_bool(crankshaft, false, "use crankshaft")
111#else
112 DEFINE_bool(crankshaft, true, "use crankshaft")
113#endif
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000114DEFINE_string(hydrogen_filter, "", "hydrogen use/trace filter")
115DEFINE_bool(use_hydrogen, true, "use generated hydrogen for compilation")
116DEFINE_bool(build_lithium, true, "use lithium chunk builder")
117DEFINE_bool(alloc_lithium, true, "use lithium register allocator")
118DEFINE_bool(use_lithium, true, "use lithium code generator")
119DEFINE_bool(use_range, true, "use hydrogen range analysis")
120DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis")
121DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000122DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
123DEFINE_bool(use_inlining, true, "use function inlining")
124DEFINE_bool(limit_inlining, true, "limit code size growth from inlining")
125DEFINE_bool(eliminate_empty_blocks, true, "eliminate empty blocks")
126DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion")
whesse@chromium.orgb08986c2011-03-14 16:13:42 +0000127DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000128DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
129DEFINE_bool(trace_inlining, false, "trace inlining decisions")
130DEFINE_bool(trace_alloc, false, "trace register allocator")
fschneider@chromium.org3a5fd782011-02-24 10:10:44 +0000131DEFINE_bool(trace_all_uses, false, "trace all use positions")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000132DEFINE_bool(trace_range, false, "trace range analysis")
133DEFINE_bool(trace_gvn, false, "trace global value numbering")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000134DEFINE_bool(trace_representation, false, "trace representation types")
135DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction")
136DEFINE_bool(stress_environments, false, "environment for every instruction")
137DEFINE_int(deopt_every_n_times,
138 0,
139 "deoptimize every n times a deopt point is passed")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000140DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing")
141DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
142DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000143DEFINE_bool(use_osr, true, "use on-stack replacement")
vegorov@chromium.org5d6c1f52011-02-28 13:13:38 +0000144
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000145DEFINE_bool(trace_osr, false, "trace on-stack replacement")
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000146DEFINE_int(stress_runs, 0, "number of stress runs")
sgjesse@chromium.orgc6c57182011-01-17 12:24:25 +0000147DEFINE_bool(optimize_closures, true, "optimize closures")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000148
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000149// assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000150DEFINE_bool(debug_code, false,
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000151 "generate extra code (assertions) for debugging")
152DEFINE_bool(code_comments, false, "emit comments in code disassembly")
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +0000153DEFINE_bool(peephole_optimization, true,
154 "perform peephole optimizations in assembly code")
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000155DEFINE_bool(enable_sse2, true,
156 "enable use of SSE2 instructions if available")
157DEFINE_bool(enable_sse3, true,
158 "enable use of SSE3 instructions if available")
kmillikin@chromium.orgf05f2912010-09-30 10:07:24 +0000159DEFINE_bool(enable_sse4_1, true,
160 "enable use of SSE4.1 instructions if available")
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000161DEFINE_bool(enable_cmov, true,
162 "enable use of CMOV instruction if available")
163DEFINE_bool(enable_rdtsc, true,
164 "enable use of RDTSC instruction if available")
165DEFINE_bool(enable_sahf, true,
166 "enable use of SAHF instruction if available (X64 only)")
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000167DEFINE_bool(enable_vfp3, true,
ager@chromium.orga9aa5fa2011-04-13 08:46:07 +0000168 "enable use of VFP3 instructions if available - this implies "
169 "enabling ARMv7 instructions (ARM only)")
ager@chromium.org5c838252010-02-19 08:53:10 +0000170DEFINE_bool(enable_armv7, true,
171 "enable use of ARMv7 instructions if available (ARM only)")
lrn@chromium.org7516f052011-03-30 08:52:27 +0000172DEFINE_bool(enable_fpu, true,
173 "enable use of MIPS FPU instructions if available (MIPS only)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000174
175// bootstrapper.cc
176DEFINE_string(expose_natives_as, NULL, "expose natives in global object")
177DEFINE_string(expose_debug_as, NULL, "expose debug in global object")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000178DEFINE_bool(expose_gc, false, "expose gc extension")
ricow@chromium.org5ad5ace2010-06-23 09:06:43 +0000179DEFINE_bool(expose_externalize_string, false,
180 "expose externalize string extension")
kasperl@chromium.org86f77b72009-07-06 08:21:57 +0000181DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture")
kmillikin@chromium.org5d8f0e62010-03-24 08:21:20 +0000182DEFINE_bool(disable_native_files, false, "disable builtin natives files")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000183
184// builtins-ia32.cc
185DEFINE_bool(inline_new, true, "use fast inline allocation")
186
187// checks.cc
188DEFINE_bool(stack_trace_on_abort, true,
189 "print a stack trace if an assertion failure occurs")
190
191// codegen-ia32.cc / codegen-arm.cc
192DEFINE_bool(trace, false, "trace function calls")
fschneider@chromium.orge03fb642010-11-01 12:34:09 +0000193DEFINE_bool(mask_constants_with_cookie,
194 true,
195 "use random jit cookie to mask large constants")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000196
197// codegen.cc
198DEFINE_bool(lazy, true, "use lazy compilation")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000199DEFINE_bool(trace_opt, false, "trace lazy optimization")
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000200DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000201DEFINE_bool(opt, true, "use adaptive optimizations")
202DEFINE_bool(opt_eagerly, false, "be more eager when adaptively optimizing")
203DEFINE_bool(always_opt, false, "always try to optimize functions")
204DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000205DEFINE_bool(deopt, true, "support deoptimization")
206DEFINE_bool(trace_deopt, false, "trace deoptimization")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000207
208// compiler.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000209DEFINE_int(min_preparse_length, 1024,
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000210 "minimum length for automatic enable preparsing")
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +0000211DEFINE_bool(always_full_compiler, false,
212 "try to use the dedicated run-once backend for all code")
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +0000213DEFINE_bool(trace_bailout, false,
214 "print reasons for falling back to using the classic V8 backend")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000215
kasperl@chromium.org71affb52009-05-26 05:44:31 +0000216// compilation-cache.cc
217DEFINE_bool(compilation_cache, true, "enable compilation cache")
218
erik.corry@gmail.com3847bd52011-04-27 10:38:56 +0000219DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions")
220
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000221// debug.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000222DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response")
sgjesse@chromium.orgac6aa172009-12-04 12:29:05 +0000223DEFINE_bool(debugger_auto_break, true,
ager@chromium.orgbb29dc92009-03-24 13:25:23 +0000224 "automatically set the debug break flag when debugger commands are "
sgjesse@chromium.orgac6aa172009-12-04 12:29:05 +0000225 "in the queue")
ager@chromium.orgce5e87b2010-03-10 10:24:18 +0000226DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000227
sgjesse@chromium.org496c03a2011-02-14 12:05:43 +0000228// execution.cc
229DEFINE_int(stack_size, kPointerSize * 128,
230 "default size of stack region v8 is allowed to use (in KkBytes)")
231
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000232// frames.cc
233DEFINE_int(max_stack_trace_source_length, 300,
234 "maximum length of function source code printed in a stack trace.")
235
erik.corry@gmail.comd88afa22010-09-15 12:33:05 +0000236// full-codegen.cc
237DEFINE_bool(always_inline_smi_code, false,
238 "always inline smi code in non-opt code")
239
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000240// heap.cc
kmillikin@chromium.orgf05f2912010-09-30 10:07:24 +0000241DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)")
242DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)")
ager@chromium.org01fe7df2010-11-10 11:59:11 +0000243DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000244DEFINE_bool(gc_global, false, "always perform global GCs")
245DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
246DEFINE_bool(trace_gc, false,
247 "print one trace line following each garbage collection")
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +0000248DEFINE_bool(trace_gc_nvp, false,
249 "print one detailed trace line in name=value format "
250 "after each garbage collection")
251DEFINE_bool(print_cumulative_gc_stat, false,
252 "print cumulative GC statistics in name=value format on exit")
kasperl@chromium.orge959c182009-07-27 08:59:04 +0000253DEFINE_bool(trace_gc_verbose, false,
254 "print more details following each garbage collection")
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000255DEFINE_bool(collect_maps, true,
kasperl@chromium.org9bbf9682008-10-30 11:53:07 +0000256 "garbage collect maps from which no objects can be reached")
ricow@chromium.org5ad5ace2010-06-23 09:06:43 +0000257DEFINE_bool(flush_code, true,
ricow@chromium.org61255552010-06-11 07:46:10 +0000258 "flush code that we expect not to use again before full gc")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000259
ager@chromium.orgadd848f2009-08-13 12:44:13 +0000260// v8.cc
261DEFINE_bool(use_idle_notification, true,
262 "Use idle notification to reduce memory footprint.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000263// ic.cc
264DEFINE_bool(use_ic, true, "use inline caching")
265
ager@chromium.org9ee27ae2011-03-02 13:43:26 +0000266#ifdef LIVE_OBJECT_LIST
267// liveobjectlist.cc
268DEFINE_string(lol_workdir, NULL, "path for lol temp files")
269DEFINE_bool(verify_lol, false, "perform debugging verification for lol")
270#endif
271
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000272// macro-assembler-ia32.cc
273DEFINE_bool(native_code_counters, false,
274 "generate extra code for manipulating stats counters")
275
276// mark-compact.cc
277DEFINE_bool(always_compact, false, "Perform compaction on every full GC")
278DEFINE_bool(never_compact, false,
279 "Never perform compaction on full GC - testing only")
ager@chromium.orgea91cc52011-05-23 06:06:11 +0000280DEFINE_bool(cleanup_code_caches_at_gc, true,
281 "Flush inline caches prior to mark compact collection and "
282 "flush code caches in maps during mark compact cycle.")
sgjesse@chromium.orgdf7a2842010-03-25 14:34:15 +0000283DEFINE_int(random_seed, 0,
284 "Default seed for initializing random generator "
285 "(0, the default, means to use system random).")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000286
ager@chromium.org236ad962008-09-25 09:45:57 +0000287DEFINE_bool(canonicalize_object_literal_maps, true,
288 "Canonicalize maps for object literals.")
289
fschneider@chromium.org0c20e672010-01-14 15:28:53 +0000290DEFINE_bool(use_big_map_space, true,
291 "Use big map space, but don't compact if it grew too big.")
292
kasperl@chromium.orgeac059f2010-01-25 11:02:06 +0000293DEFINE_int(max_map_space_pages, MapSpace::kMaxMapPageIndex - 1,
294 "Maximum number of pages in map space which still allows to encode "
295 "forwarding pointers. That's actually a constant, but it's useful "
296 "to control it with a flag for better testing.")
297
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000298// mksnapshot.cc
299DEFINE_bool(h, false, "print this message")
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000300DEFINE_bool(new_snapshot, true, "use new snapshot implementation")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000301
whesse@chromium.org023421e2010-12-21 12:19:12 +0000302// objects.cc
303DEFINE_bool(use_verbose_printer, true, "allows verbose printing")
304
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000305// parser.cc
306DEFINE_bool(allow_natives_syntax, false, "allow natives syntax")
vegorov@chromium.org0a4e9012011-01-24 12:33:13 +0000307DEFINE_bool(strict_mode, true, "allow strict mode directives")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000308
ager@chromium.org5c838252010-02-19 08:53:10 +0000309// simulator-arm.cc and simulator-mips.cc
ricow@chromium.orgc9c80822010-04-21 08:22:37 +0000310DEFINE_bool(trace_sim, false, "Trace simulator execution")
lrn@chromium.orgc34f5802010-04-28 12:53:43 +0000311DEFINE_bool(check_icache, false, "Check icache flushes in ARM simulator")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000312DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions")
ricow@chromium.orgc9c80822010-04-21 08:22:37 +0000313DEFINE_int(sim_stack_alignment, 8,
314 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000315
vegorov@chromium.org7304bca2011-05-16 12:14:13 +0000316// isolate.cc
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000317DEFINE_bool(trace_exception, false,
318 "print stack trace when throwing exceptions")
319DEFINE_bool(preallocate_message_memory, false,
320 "preallocate some memory to build stack traces.")
321
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000322// v8.cc
323DEFINE_bool(preemption, false,
324 "activate a 100ms timer that switches between V8 threads")
325
ager@chromium.org381abbb2009-02-25 13:23:22 +0000326// Regexp
ager@chromium.org381abbb2009-02-25 13:23:22 +0000327DEFINE_bool(regexp_optimization, true, "generate optimized regexp code")
fschneider@chromium.org0c20e672010-01-14 15:28:53 +0000328DEFINE_bool(regexp_entry_native, true, "use native code to enter regexp")
ager@chromium.orga74f0da2008-12-03 16:05:52 +0000329
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000330// Testing flags test/cctest/test-{flags,api,serialization}.cc
331DEFINE_bool(testing_bool_flag, true, "testing_bool_flag")
332DEFINE_int(testing_int_flag, 13, "testing_int_flag")
333DEFINE_float(testing_float_flag, 2.5, "float-flag")
334DEFINE_string(testing_string_flag, "Hello, world!", "string-flag")
335DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness")
336#ifdef WIN32
337DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
338 "file in which to testing_serialize heap")
339#else
340DEFINE_string(testing_serialization_file, "/tmp/serdes",
341 "file in which to serialize heap")
342#endif
343
kasperl@chromium.org5a8ca6c2008-10-23 13:57:19 +0000344//
345// Dev shell flags
346//
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000347
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000348DEFINE_bool(help, false, "Print usage message, including flags, on console")
kasperl@chromium.org5a8ca6c2008-10-23 13:57:19 +0000349DEFINE_bool(dump_counters, false, "Dump counters on exit")
vegorov@chromium.org2356e6f2010-06-09 09:38:56 +0000350DEFINE_bool(debugger, false, "Enable JavaScript debugger")
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000351DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the "
352 "debugger agent in another process")
353DEFINE_bool(debugger_agent, false, "Enable debugger agent")
354DEFINE_int(debugger_port, 5858, "Port to use for remote debugging")
ager@chromium.org9ee27ae2011-03-02 13:43:26 +0000355DEFINE_string(map_counters, "", "Map counters to a file")
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000356DEFINE_args(js_arguments, JSArguments(),
357 "Pass all remaining arguments to the script. Alias for \"--\".")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000358
kmillikin@chromium.orgd2c22f02011-01-10 08:15:37 +0000359#if defined(WEBOS__)
360DEFINE_bool(debug_compile_events, false, "Enable debugger compile events")
361DEFINE_bool(debug_script_collected_events, false,
362 "Enable debugger script collected events")
363#else
364DEFINE_bool(debug_compile_events, true, "Enable debugger compile events")
365DEFINE_bool(debug_script_collected_events, true,
366 "Enable debugger script collected events")
367#endif
368
erik.corry@gmail.com0511e242011-01-19 11:11:08 +0000369
370//
371// GDB JIT integration flags.
372//
373
374DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)")
375DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects")
kmillikin@chromium.org49edbdf2011-02-16 12:32:18 +0000376DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk")
ricow@chromium.org4f693d62011-07-04 14:01:31 +0000377DEFINE_string(gdbjit_dump_filter, "",
378 "dump only objects containing this substring")
erik.corry@gmail.com0511e242011-01-19 11:11:08 +0000379
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000380//
381// Debug only flags
382//
383#undef FLAG
384#ifdef DEBUG
385#define FLAG FLAG_FULL
386#else
387#define FLAG FLAG_READONLY
388#endif
389
390// checks.cc
391DEFINE_bool(enable_slow_asserts, false,
392 "enable asserts that are slow to execute")
393
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000394// codegen-ia32.cc / codegen-arm.cc
395DEFINE_bool(trace_codegen, false,
396 "print name of functions for which code is generated")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000397DEFINE_bool(print_source, false, "pretty print source code")
398DEFINE_bool(print_builtin_source, false,
399 "pretty print source code for builtins")
400DEFINE_bool(print_ast, false, "print source AST")
401DEFINE_bool(print_builtin_ast, false, "print source AST for builtins")
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000402DEFINE_bool(print_json_ast, false, "print source AST as JSON")
403DEFINE_bool(print_builtin_json_ast, false,
404 "print source AST for builtins as JSON")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000405DEFINE_string(stop_at, "", "function name where to insert a breakpoint")
vegorov@chromium.org7943d462011-08-01 11:41:52 +0000406DEFINE_bool(verify_stack_height, false, "verify stack height tracing on ia32")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000407
408// compiler.cc
409DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins")
410DEFINE_bool(print_scopes, false, "print scopes")
411
412// contexts.cc
413DEFINE_bool(trace_contexts, false, "trace contexts operations")
414
415// heap.cc
416DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations")
417DEFINE_bool(gc_verbose, false, "print stuff during garbage collection")
418DEFINE_bool(heap_stats, false, "report heap statistics before and after GC")
419DEFINE_bool(code_stats, false, "report code statistics after GC")
420DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
421DEFINE_bool(print_handles, false, "report handles after GC")
422DEFINE_bool(print_global_handles, false, "report global handles after GC")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000423
424// ic.cc
425DEFINE_bool(trace_ic, false, "trace inline cache state transitions")
426
427// objects.cc
428DEFINE_bool(trace_normalization,
429 false,
430 "prints when objects are turned into dictionaries.")
431
432// runtime.cc
433DEFINE_bool(trace_lazy, false, "trace lazy compilation")
434
435// serialize.cc
436DEFINE_bool(debug_serialization, false,
437 "write debug information into the snapshot.")
438
439// spaces.cc
440DEFINE_bool(collect_heap_spill_statistics, false,
441 "report heap spill statistics along with heap_stats "
442 "(requires heap_stats)")
443
sgjesse@chromium.orgea88ce92011-03-23 11:19:56 +0000444DEFINE_bool(trace_isolates, false, "trace isolate state changes")
445
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000446// VM state
447DEFINE_bool(log_state_changes, false, "Log state changes.")
448
ager@chromium.org381abbb2009-02-25 13:23:22 +0000449// Regexp
fschneider@chromium.org0c20e672010-01-14 15:28:53 +0000450DEFINE_bool(regexp_possessive_quantifier,
451 false,
452 "enable possessive quantifier syntax for testing")
ager@chromium.org381abbb2009-02-25 13:23:22 +0000453DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
454DEFINE_bool(trace_regexp_assembler,
455 false,
456 "trace regexp macro assembler calls.")
ager@chromium.orga74f0da2008-12-03 16:05:52 +0000457
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000458//
whesse@chromium.org030d38e2011-07-13 13:23:34 +0000459// Logging and profiling flags
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000460//
461#undef FLAG
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000462#define FLAG FLAG_FULL
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000463
464// log.cc
465DEFINE_bool(log, false,
466 "Minimal logging (no API, code, GC, suspect, or handles samples).")
467DEFINE_bool(log_all, false, "Log all events to the log file.")
ager@chromium.org381abbb2009-02-25 13:23:22 +0000468DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000469DEFINE_bool(log_api, false, "Log API events to the log file.")
470DEFINE_bool(log_code, false,
471 "Log code events to the log file without profiling.")
472DEFINE_bool(log_gc, false,
473 "Log heap samples on garbage collection for the hp2ps tool.")
474DEFINE_bool(log_handles, false, "Log global handle events.")
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +0000475DEFINE_bool(log_snapshot_positions, false,
476 "log positions of (de)serialized objects in the snapshot.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000477DEFINE_bool(log_suspect, false, "Log suspect operations.")
478DEFINE_bool(prof, false,
479 "Log statistical profiling information (implies --log-code).")
iposva@chromium.org245aa852009-02-10 00:49:54 +0000480DEFINE_bool(prof_auto, true,
481 "Used with --prof, starts profiling automatically")
kasperl@chromium.org71affb52009-05-26 05:44:31 +0000482DEFINE_bool(prof_lazy, false,
483 "Used with --prof, only does sampling and logging"
484 " when profiler is active (implies --noprof_auto).")
ager@chromium.org357bf652010-04-12 11:30:10 +0000485DEFINE_bool(prof_browser_mode, true,
486 "Used with --prof, turns on browser-compatible mode for profiling.")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000487DEFINE_bool(log_regexp, false, "Log regular expression execution.")
488DEFINE_bool(sliding_state_window, false,
489 "Update sliding state window counters.")
490DEFINE_string(logfile, "v8.log", "Specify the name of the log file.")
whesse@chromium.org4a5224e2010-10-20 12:37:07 +0000491DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.")
kasperl@chromium.orgf5aa8372009-03-24 14:47:14 +0000492
493//
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000494// Disassembler only flags
495//
496#undef FLAG
497#ifdef ENABLE_DISASSEMBLER
498#define FLAG FLAG_FULL
499#else
500#define FLAG FLAG_READONLY
501#endif
502
kasperl@chromium.org7be3c992009-03-12 07:19:55 +0000503// code-stubs.cc
504DEFINE_bool(print_code_stubs, false, "print code stubs")
505
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000506// codegen-ia32.cc / codegen-arm.cc
507DEFINE_bool(print_code, false, "print generated code")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000508DEFINE_bool(print_opt_code, false, "print optimized code")
whesse@chromium.org023421e2010-12-21 12:19:12 +0000509DEFINE_bool(print_unopt_code, false, "print unoptimized code before "
510 "printing optimized code based on it")
kasperl@chromium.orga5551262010-12-07 12:49:48 +0000511DEFINE_bool(print_code_verbose, false, "print more information for code")
ager@chromium.org8bb60582008-12-11 12:02:20 +0000512DEFINE_bool(print_builtin_code, false, "print generated code for builtins")
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000513
kasperl@chromium.orgb9123622008-09-17 14:05:56 +0000514// Cleanup...
515#undef FLAG_FULL
516#undef FLAG_READONLY
517#undef FLAG
518
519#undef DEFINE_bool
520#undef DEFINE_int
521#undef DEFINE_string
522
523#undef FLAG_MODE_DECLARE
524#undef FLAG_MODE_DEFINE
525#undef FLAG_MODE_DEFINE_DEFAULTS
526#undef FLAG_MODE_META