kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 2 | // 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.org | 41826e7 | 2009-03-30 13:30:57 +0000 | [diff] [blame] | 65 | { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false }, |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 66 | #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.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 72 | #ifdef FLAG_MODE_DECLARE |
| 73 | // Structure used to hold a collection of arguments to the JavaScript code. |
| 74 | struct JSArguments { |
| 75 | public: |
| 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); |
| 82 | private: |
| 83 | int argc_; |
| 84 | const char** argv_; |
| 85 | }; |
| 86 | #endif |
| 87 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 88 | #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.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 92 | #define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt) |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 93 | |
| 94 | // |
| 95 | // Flags in all modes. |
| 96 | // |
| 97 | #define FLAG FLAG_FULL |
| 98 | |
danno@chromium.org | 160a7b0 | 2011-04-18 15:51:38 +0000 | [diff] [blame] | 99 | // Flags for experimental language features. |
whesse@chromium.org | 4acdc2c | 2011-08-15 13:01:23 +0000 | [diff] [blame^] | 100 | DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof") |
danno@chromium.org | 160a7b0 | 2011-04-18 15:51:38 +0000 | [diff] [blame] | 101 | DEFINE_bool(harmony_proxies, false, "enable harmony proxies") |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 102 | DEFINE_bool(harmony_weakmaps, false, "enable harmony weak maps") |
whesse@chromium.org | 4acdc2c | 2011-08-15 13:01:23 +0000 | [diff] [blame^] | 103 | DEFINE_bool(harmony_block_scoping, false, "enable harmony block scoping") |
danno@chromium.org | 160a7b0 | 2011-04-18 15:51:38 +0000 | [diff] [blame] | 104 | |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 105 | // Flags for experimental implementation features. |
ricow@chromium.org | 2c99e28 | 2011-07-28 09:15:17 +0000 | [diff] [blame] | 106 | DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles") |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 107 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 108 | // Flags for Crankshaft. |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 109 | #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.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 114 | DEFINE_string(hydrogen_filter, "", "hydrogen use/trace filter") |
| 115 | DEFINE_bool(use_hydrogen, true, "use generated hydrogen for compilation") |
| 116 | DEFINE_bool(build_lithium, true, "use lithium chunk builder") |
| 117 | DEFINE_bool(alloc_lithium, true, "use lithium register allocator") |
| 118 | DEFINE_bool(use_lithium, true, "use lithium code generator") |
| 119 | DEFINE_bool(use_range, true, "use hydrogen range analysis") |
| 120 | DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis") |
| 121 | DEFINE_bool(use_gvn, true, "use hydrogen global value numbering") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 122 | DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") |
| 123 | DEFINE_bool(use_inlining, true, "use function inlining") |
| 124 | DEFINE_bool(limit_inlining, true, "limit code size growth from inlining") |
| 125 | DEFINE_bool(eliminate_empty_blocks, true, "eliminate empty blocks") |
| 126 | DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion") |
whesse@chromium.org | b08986c | 2011-03-14 16:13:42 +0000 | [diff] [blame] | 127 | DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 128 | DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") |
| 129 | DEFINE_bool(trace_inlining, false, "trace inlining decisions") |
| 130 | DEFINE_bool(trace_alloc, false, "trace register allocator") |
fschneider@chromium.org | 3a5fd78 | 2011-02-24 10:10:44 +0000 | [diff] [blame] | 131 | DEFINE_bool(trace_all_uses, false, "trace all use positions") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 132 | DEFINE_bool(trace_range, false, "trace range analysis") |
| 133 | DEFINE_bool(trace_gvn, false, "trace global value numbering") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 134 | DEFINE_bool(trace_representation, false, "trace representation types") |
| 135 | DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction") |
| 136 | DEFINE_bool(stress_environments, false, "environment for every instruction") |
| 137 | DEFINE_int(deopt_every_n_times, |
| 138 | 0, |
| 139 | "deoptimize every n times a deopt point is passed") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 140 | DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing") |
| 141 | DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases") |
| 142 | DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 143 | DEFINE_bool(use_osr, true, "use on-stack replacement") |
vegorov@chromium.org | 5d6c1f5 | 2011-02-28 13:13:38 +0000 | [diff] [blame] | 144 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 145 | DEFINE_bool(trace_osr, false, "trace on-stack replacement") |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 146 | DEFINE_int(stress_runs, 0, "number of stress runs") |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 147 | DEFINE_bool(optimize_closures, true, "optimize closures") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 148 | |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 149 | // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 150 | DEFINE_bool(debug_code, false, |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 151 | "generate extra code (assertions) for debugging") |
| 152 | DEFINE_bool(code_comments, false, "emit comments in code disassembly") |
erik.corry@gmail.com | 9dfbea4 | 2010-05-21 12:58:28 +0000 | [diff] [blame] | 153 | DEFINE_bool(peephole_optimization, true, |
| 154 | "perform peephole optimizations in assembly code") |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 155 | DEFINE_bool(enable_sse2, true, |
| 156 | "enable use of SSE2 instructions if available") |
| 157 | DEFINE_bool(enable_sse3, true, |
| 158 | "enable use of SSE3 instructions if available") |
kmillikin@chromium.org | f05f291 | 2010-09-30 10:07:24 +0000 | [diff] [blame] | 159 | DEFINE_bool(enable_sse4_1, true, |
| 160 | "enable use of SSE4.1 instructions if available") |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 161 | DEFINE_bool(enable_cmov, true, |
| 162 | "enable use of CMOV instruction if available") |
| 163 | DEFINE_bool(enable_rdtsc, true, |
| 164 | "enable use of RDTSC instruction if available") |
| 165 | DEFINE_bool(enable_sahf, true, |
| 166 | "enable use of SAHF instruction if available (X64 only)") |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 167 | DEFINE_bool(enable_vfp3, true, |
ager@chromium.org | a9aa5fa | 2011-04-13 08:46:07 +0000 | [diff] [blame] | 168 | "enable use of VFP3 instructions if available - this implies " |
| 169 | "enabling ARMv7 instructions (ARM only)") |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 170 | DEFINE_bool(enable_armv7, true, |
| 171 | "enable use of ARMv7 instructions if available (ARM only)") |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 172 | DEFINE_bool(enable_fpu, true, |
| 173 | "enable use of MIPS FPU instructions if available (MIPS only)") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 174 | |
| 175 | // bootstrapper.cc |
| 176 | DEFINE_string(expose_natives_as, NULL, "expose natives in global object") |
| 177 | DEFINE_string(expose_debug_as, NULL, "expose debug in global object") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 178 | DEFINE_bool(expose_gc, false, "expose gc extension") |
ricow@chromium.org | 5ad5ace | 2010-06-23 09:06:43 +0000 | [diff] [blame] | 179 | DEFINE_bool(expose_externalize_string, false, |
| 180 | "expose externalize string extension") |
kasperl@chromium.org | 86f77b7 | 2009-07-06 08:21:57 +0000 | [diff] [blame] | 181 | DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture") |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 182 | DEFINE_bool(disable_native_files, false, "disable builtin natives files") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 183 | |
| 184 | // builtins-ia32.cc |
| 185 | DEFINE_bool(inline_new, true, "use fast inline allocation") |
| 186 | |
| 187 | // checks.cc |
| 188 | DEFINE_bool(stack_trace_on_abort, true, |
| 189 | "print a stack trace if an assertion failure occurs") |
| 190 | |
| 191 | // codegen-ia32.cc / codegen-arm.cc |
| 192 | DEFINE_bool(trace, false, "trace function calls") |
fschneider@chromium.org | e03fb64 | 2010-11-01 12:34:09 +0000 | [diff] [blame] | 193 | DEFINE_bool(mask_constants_with_cookie, |
| 194 | true, |
| 195 | "use random jit cookie to mask large constants") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 196 | |
| 197 | // codegen.cc |
| 198 | DEFINE_bool(lazy, true, "use lazy compilation") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 199 | DEFINE_bool(trace_opt, false, "trace lazy optimization") |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 200 | DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 201 | DEFINE_bool(opt, true, "use adaptive optimizations") |
| 202 | DEFINE_bool(opt_eagerly, false, "be more eager when adaptively optimizing") |
| 203 | DEFINE_bool(always_opt, false, "always try to optimize functions") |
| 204 | DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 205 | DEFINE_bool(deopt, true, "support deoptimization") |
| 206 | DEFINE_bool(trace_deopt, false, "trace deoptimization") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 207 | |
| 208 | // compiler.cc |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 209 | DEFINE_int(min_preparse_length, 1024, |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 210 | "minimum length for automatic enable preparsing") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 211 | DEFINE_bool(always_full_compiler, false, |
| 212 | "try to use the dedicated run-once backend for all code") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 213 | DEFINE_bool(trace_bailout, false, |
| 214 | "print reasons for falling back to using the classic V8 backend") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 215 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 216 | // compilation-cache.cc |
| 217 | DEFINE_bool(compilation_cache, true, "enable compilation cache") |
| 218 | |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 219 | DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions") |
| 220 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 221 | // debug.cc |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 222 | DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response") |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 223 | DEFINE_bool(debugger_auto_break, true, |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 224 | "automatically set the debug break flag when debugger commands are " |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 225 | "in the queue") |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 226 | DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 227 | |
sgjesse@chromium.org | 496c03a | 2011-02-14 12:05:43 +0000 | [diff] [blame] | 228 | // execution.cc |
| 229 | DEFINE_int(stack_size, kPointerSize * 128, |
| 230 | "default size of stack region v8 is allowed to use (in KkBytes)") |
| 231 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 232 | // frames.cc |
| 233 | DEFINE_int(max_stack_trace_source_length, 300, |
| 234 | "maximum length of function source code printed in a stack trace.") |
| 235 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 236 | // full-codegen.cc |
| 237 | DEFINE_bool(always_inline_smi_code, false, |
| 238 | "always inline smi code in non-opt code") |
| 239 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 240 | // heap.cc |
kmillikin@chromium.org | f05f291 | 2010-09-30 10:07:24 +0000 | [diff] [blame] | 241 | DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") |
| 242 | DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)") |
ager@chromium.org | 01fe7df | 2010-11-10 11:59:11 +0000 | [diff] [blame] | 243 | DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 244 | DEFINE_bool(gc_global, false, "always perform global GCs") |
| 245 | DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations") |
| 246 | DEFINE_bool(trace_gc, false, |
| 247 | "print one trace line following each garbage collection") |
erik.corry@gmail.com | 9dfbea4 | 2010-05-21 12:58:28 +0000 | [diff] [blame] | 248 | DEFINE_bool(trace_gc_nvp, false, |
| 249 | "print one detailed trace line in name=value format " |
| 250 | "after each garbage collection") |
| 251 | DEFINE_bool(print_cumulative_gc_stat, false, |
| 252 | "print cumulative GC statistics in name=value format on exit") |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 253 | DEFINE_bool(trace_gc_verbose, false, |
| 254 | "print more details following each garbage collection") |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 255 | DEFINE_bool(collect_maps, true, |
kasperl@chromium.org | 9bbf968 | 2008-10-30 11:53:07 +0000 | [diff] [blame] | 256 | "garbage collect maps from which no objects can be reached") |
ricow@chromium.org | 5ad5ace | 2010-06-23 09:06:43 +0000 | [diff] [blame] | 257 | DEFINE_bool(flush_code, true, |
ricow@chromium.org | 6125555 | 2010-06-11 07:46:10 +0000 | [diff] [blame] | 258 | "flush code that we expect not to use again before full gc") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 259 | |
ager@chromium.org | add848f | 2009-08-13 12:44:13 +0000 | [diff] [blame] | 260 | // v8.cc |
| 261 | DEFINE_bool(use_idle_notification, true, |
| 262 | "Use idle notification to reduce memory footprint.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 263 | // ic.cc |
| 264 | DEFINE_bool(use_ic, true, "use inline caching") |
| 265 | |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 266 | #ifdef LIVE_OBJECT_LIST |
| 267 | // liveobjectlist.cc |
| 268 | DEFINE_string(lol_workdir, NULL, "path for lol temp files") |
| 269 | DEFINE_bool(verify_lol, false, "perform debugging verification for lol") |
| 270 | #endif |
| 271 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 272 | // macro-assembler-ia32.cc |
| 273 | DEFINE_bool(native_code_counters, false, |
| 274 | "generate extra code for manipulating stats counters") |
| 275 | |
| 276 | // mark-compact.cc |
| 277 | DEFINE_bool(always_compact, false, "Perform compaction on every full GC") |
| 278 | DEFINE_bool(never_compact, false, |
| 279 | "Never perform compaction on full GC - testing only") |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 280 | DEFINE_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.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 283 | DEFINE_int(random_seed, 0, |
| 284 | "Default seed for initializing random generator " |
| 285 | "(0, the default, means to use system random).") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 286 | |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 287 | DEFINE_bool(canonicalize_object_literal_maps, true, |
| 288 | "Canonicalize maps for object literals.") |
| 289 | |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 290 | DEFINE_bool(use_big_map_space, true, |
| 291 | "Use big map space, but don't compact if it grew too big.") |
| 292 | |
kasperl@chromium.org | eac059f | 2010-01-25 11:02:06 +0000 | [diff] [blame] | 293 | DEFINE_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.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 298 | // mksnapshot.cc |
| 299 | DEFINE_bool(h, false, "print this message") |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 300 | DEFINE_bool(new_snapshot, true, "use new snapshot implementation") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 301 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 302 | // objects.cc |
| 303 | DEFINE_bool(use_verbose_printer, true, "allows verbose printing") |
| 304 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 305 | // parser.cc |
| 306 | DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") |
vegorov@chromium.org | 0a4e901 | 2011-01-24 12:33:13 +0000 | [diff] [blame] | 307 | DEFINE_bool(strict_mode, true, "allow strict mode directives") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 308 | |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 309 | // simulator-arm.cc and simulator-mips.cc |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 310 | DEFINE_bool(trace_sim, false, "Trace simulator execution") |
lrn@chromium.org | c34f580 | 2010-04-28 12:53:43 +0000 | [diff] [blame] | 311 | DEFINE_bool(check_icache, false, "Check icache flushes in ARM simulator") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 312 | DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 313 | DEFINE_int(sim_stack_alignment, 8, |
| 314 | "Stack alingment in bytes in simulator (4 or 8, 8 is default)") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 315 | |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 316 | // isolate.cc |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 317 | DEFINE_bool(trace_exception, false, |
| 318 | "print stack trace when throwing exceptions") |
| 319 | DEFINE_bool(preallocate_message_memory, false, |
| 320 | "preallocate some memory to build stack traces.") |
| 321 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 322 | // v8.cc |
| 323 | DEFINE_bool(preemption, false, |
| 324 | "activate a 100ms timer that switches between V8 threads") |
| 325 | |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 326 | // Regexp |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 327 | DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 328 | DEFINE_bool(regexp_entry_native, true, "use native code to enter regexp") |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 329 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 330 | // Testing flags test/cctest/test-{flags,api,serialization}.cc |
| 331 | DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") |
| 332 | DEFINE_int(testing_int_flag, 13, "testing_int_flag") |
| 333 | DEFINE_float(testing_float_flag, 2.5, "float-flag") |
| 334 | DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") |
| 335 | DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") |
| 336 | #ifdef WIN32 |
| 337 | DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", |
| 338 | "file in which to testing_serialize heap") |
| 339 | #else |
| 340 | DEFINE_string(testing_serialization_file, "/tmp/serdes", |
| 341 | "file in which to serialize heap") |
| 342 | #endif |
| 343 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 344 | // |
| 345 | // Dev shell flags |
| 346 | // |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 347 | |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 348 | DEFINE_bool(help, false, "Print usage message, including flags, on console") |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 349 | DEFINE_bool(dump_counters, false, "Dump counters on exit") |
vegorov@chromium.org | 2356e6f | 2010-06-09 09:38:56 +0000 | [diff] [blame] | 350 | DEFINE_bool(debugger, false, "Enable JavaScript debugger") |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 351 | DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the " |
| 352 | "debugger agent in another process") |
| 353 | DEFINE_bool(debugger_agent, false, "Enable debugger agent") |
| 354 | DEFINE_int(debugger_port, 5858, "Port to use for remote debugging") |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 355 | DEFINE_string(map_counters, "", "Map counters to a file") |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 356 | DEFINE_args(js_arguments, JSArguments(), |
| 357 | "Pass all remaining arguments to the script. Alias for \"--\".") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 358 | |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 359 | #if defined(WEBOS__) |
| 360 | DEFINE_bool(debug_compile_events, false, "Enable debugger compile events") |
| 361 | DEFINE_bool(debug_script_collected_events, false, |
| 362 | "Enable debugger script collected events") |
| 363 | #else |
| 364 | DEFINE_bool(debug_compile_events, true, "Enable debugger compile events") |
| 365 | DEFINE_bool(debug_script_collected_events, true, |
| 366 | "Enable debugger script collected events") |
| 367 | #endif |
| 368 | |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 369 | |
| 370 | // |
| 371 | // GDB JIT integration flags. |
| 372 | // |
| 373 | |
| 374 | DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)") |
| 375 | DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects") |
kmillikin@chromium.org | 49edbdf | 2011-02-16 12:32:18 +0000 | [diff] [blame] | 376 | DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk") |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 377 | DEFINE_string(gdbjit_dump_filter, "", |
| 378 | "dump only objects containing this substring") |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 379 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 380 | // |
| 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 |
| 391 | DEFINE_bool(enable_slow_asserts, false, |
| 392 | "enable asserts that are slow to execute") |
| 393 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 394 | // codegen-ia32.cc / codegen-arm.cc |
| 395 | DEFINE_bool(trace_codegen, false, |
| 396 | "print name of functions for which code is generated") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 397 | DEFINE_bool(print_source, false, "pretty print source code") |
| 398 | DEFINE_bool(print_builtin_source, false, |
| 399 | "pretty print source code for builtins") |
| 400 | DEFINE_bool(print_ast, false, "print source AST") |
| 401 | DEFINE_bool(print_builtin_ast, false, "print source AST for builtins") |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 402 | DEFINE_bool(print_json_ast, false, "print source AST as JSON") |
| 403 | DEFINE_bool(print_builtin_json_ast, false, |
| 404 | "print source AST for builtins as JSON") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 405 | DEFINE_string(stop_at, "", "function name where to insert a breakpoint") |
vegorov@chromium.org | 7943d46 | 2011-08-01 11:41:52 +0000 | [diff] [blame] | 406 | DEFINE_bool(verify_stack_height, false, "verify stack height tracing on ia32") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 407 | |
| 408 | // compiler.cc |
| 409 | DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins") |
| 410 | DEFINE_bool(print_scopes, false, "print scopes") |
| 411 | |
| 412 | // contexts.cc |
| 413 | DEFINE_bool(trace_contexts, false, "trace contexts operations") |
| 414 | |
| 415 | // heap.cc |
| 416 | DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations") |
| 417 | DEFINE_bool(gc_verbose, false, "print stuff during garbage collection") |
| 418 | DEFINE_bool(heap_stats, false, "report heap statistics before and after GC") |
| 419 | DEFINE_bool(code_stats, false, "report code statistics after GC") |
| 420 | DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC") |
| 421 | DEFINE_bool(print_handles, false, "report handles after GC") |
| 422 | DEFINE_bool(print_global_handles, false, "report global handles after GC") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 423 | |
| 424 | // ic.cc |
| 425 | DEFINE_bool(trace_ic, false, "trace inline cache state transitions") |
| 426 | |
| 427 | // objects.cc |
| 428 | DEFINE_bool(trace_normalization, |
| 429 | false, |
| 430 | "prints when objects are turned into dictionaries.") |
| 431 | |
| 432 | // runtime.cc |
| 433 | DEFINE_bool(trace_lazy, false, "trace lazy compilation") |
| 434 | |
| 435 | // serialize.cc |
| 436 | DEFINE_bool(debug_serialization, false, |
| 437 | "write debug information into the snapshot.") |
| 438 | |
| 439 | // spaces.cc |
| 440 | DEFINE_bool(collect_heap_spill_statistics, false, |
| 441 | "report heap spill statistics along with heap_stats " |
| 442 | "(requires heap_stats)") |
| 443 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 444 | DEFINE_bool(trace_isolates, false, "trace isolate state changes") |
| 445 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 446 | // VM state |
| 447 | DEFINE_bool(log_state_changes, false, "Log state changes.") |
| 448 | |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 449 | // Regexp |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 450 | DEFINE_bool(regexp_possessive_quantifier, |
| 451 | false, |
| 452 | "enable possessive quantifier syntax for testing") |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 453 | DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution") |
| 454 | DEFINE_bool(trace_regexp_assembler, |
| 455 | false, |
| 456 | "trace regexp macro assembler calls.") |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 457 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 458 | // |
whesse@chromium.org | 030d38e | 2011-07-13 13:23:34 +0000 | [diff] [blame] | 459 | // Logging and profiling flags |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 460 | // |
| 461 | #undef FLAG |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 462 | #define FLAG FLAG_FULL |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 463 | |
| 464 | // log.cc |
| 465 | DEFINE_bool(log, false, |
| 466 | "Minimal logging (no API, code, GC, suspect, or handles samples).") |
| 467 | DEFINE_bool(log_all, false, "Log all events to the log file.") |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 468 | DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 469 | DEFINE_bool(log_api, false, "Log API events to the log file.") |
| 470 | DEFINE_bool(log_code, false, |
| 471 | "Log code events to the log file without profiling.") |
| 472 | DEFINE_bool(log_gc, false, |
| 473 | "Log heap samples on garbage collection for the hp2ps tool.") |
| 474 | DEFINE_bool(log_handles, false, "Log global handle events.") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 475 | DEFINE_bool(log_snapshot_positions, false, |
| 476 | "log positions of (de)serialized objects in the snapshot.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 477 | DEFINE_bool(log_suspect, false, "Log suspect operations.") |
| 478 | DEFINE_bool(prof, false, |
| 479 | "Log statistical profiling information (implies --log-code).") |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 480 | DEFINE_bool(prof_auto, true, |
| 481 | "Used with --prof, starts profiling automatically") |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 482 | DEFINE_bool(prof_lazy, false, |
| 483 | "Used with --prof, only does sampling and logging" |
| 484 | " when profiler is active (implies --noprof_auto).") |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 485 | DEFINE_bool(prof_browser_mode, true, |
| 486 | "Used with --prof, turns on browser-compatible mode for profiling.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 487 | DEFINE_bool(log_regexp, false, "Log regular expression execution.") |
| 488 | DEFINE_bool(sliding_state_window, false, |
| 489 | "Update sliding state window counters.") |
| 490 | DEFINE_string(logfile, "v8.log", "Specify the name of the log file.") |
whesse@chromium.org | 4a5224e | 2010-10-20 12:37:07 +0000 | [diff] [blame] | 491 | DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.") |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 492 | |
| 493 | // |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 494 | // 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.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 503 | // code-stubs.cc |
| 504 | DEFINE_bool(print_code_stubs, false, "print code stubs") |
| 505 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 506 | // codegen-ia32.cc / codegen-arm.cc |
| 507 | DEFINE_bool(print_code, false, "print generated code") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 508 | DEFINE_bool(print_opt_code, false, "print optimized code") |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 509 | DEFINE_bool(print_unopt_code, false, "print unoptimized code before " |
| 510 | "printing optimized code based on it") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 511 | DEFINE_bool(print_code_verbose, false, "print more information for code") |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 512 | DEFINE_bool(print_builtin_code, false, "print generated code for builtins") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 513 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 514 | // 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 |