kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 1 | // Copyright 2010 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 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 99 | // Flags for Crankshaft. |
| 100 | #ifdef V8_TARGET_ARCH_IA32 |
| 101 | DEFINE_bool(crankshaft, true, "use crankshaft") |
| 102 | #else |
| 103 | DEFINE_bool(crankshaft, false, "use crankshaft") |
| 104 | #endif |
| 105 | DEFINE_string(hydrogen_filter, "", "hydrogen use/trace filter") |
| 106 | DEFINE_bool(use_hydrogen, true, "use generated hydrogen for compilation") |
| 107 | DEFINE_bool(build_lithium, true, "use lithium chunk builder") |
| 108 | DEFINE_bool(alloc_lithium, true, "use lithium register allocator") |
| 109 | DEFINE_bool(use_lithium, true, "use lithium code generator") |
| 110 | DEFINE_bool(use_range, true, "use hydrogen range analysis") |
| 111 | DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis") |
| 112 | DEFINE_bool(use_gvn, true, "use hydrogen global value numbering") |
| 113 | DEFINE_bool(use_peeling, false, "use loop peeling") |
| 114 | DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") |
| 115 | DEFINE_bool(use_inlining, true, "use function inlining") |
| 116 | DEFINE_bool(limit_inlining, true, "limit code size growth from inlining") |
| 117 | DEFINE_bool(eliminate_empty_blocks, true, "eliminate empty blocks") |
| 118 | DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion") |
| 119 | DEFINE_bool(time_hydrogen, false, "timing for hydrogen") |
| 120 | DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") |
| 121 | DEFINE_bool(trace_inlining, false, "trace inlining decisions") |
| 122 | DEFINE_bool(trace_alloc, false, "trace register allocator") |
fschneider@chromium.org | 3a5fd78 | 2011-02-24 10:10:44 +0000 | [diff] [blame^] | 123 | DEFINE_bool(trace_all_uses, false, "trace all use positions") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 124 | DEFINE_bool(trace_range, false, "trace range analysis") |
| 125 | DEFINE_bool(trace_gvn, false, "trace global value numbering") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 126 | DEFINE_bool(trace_representation, false, "trace representation types") |
| 127 | DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction") |
| 128 | DEFINE_bool(stress_environments, false, "environment for every instruction") |
| 129 | DEFINE_int(deopt_every_n_times, |
| 130 | 0, |
| 131 | "deoptimize every n times a deopt point is passed") |
| 132 | DEFINE_bool(process_arguments_object, true, "try to deal with arguments object") |
| 133 | DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing") |
| 134 | DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases") |
| 135 | DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining") |
| 136 | DEFINE_bool(aggressive_loop_invariant_motion, true, |
| 137 | "aggressive motion of instructions out of loops") |
fschneider@chromium.org | 3a5fd78 | 2011-02-24 10:10:44 +0000 | [diff] [blame^] | 138 | #ifdef V8_TARGET_ARCH_X64 |
| 139 | DEFINE_bool(use_osr, false, "use on-stack replacement") |
| 140 | #else |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 141 | DEFINE_bool(use_osr, true, "use on-stack replacement") |
fschneider@chromium.org | 3a5fd78 | 2011-02-24 10:10:44 +0000 | [diff] [blame^] | 142 | #endif |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 143 | DEFINE_bool(trace_osr, false, "trace on-stack replacement") |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 144 | DEFINE_int(stress_runs, 0, "number of stress runs") |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 145 | DEFINE_bool(optimize_closures, true, "optimize closures") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 146 | |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 147 | // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 148 | DEFINE_bool(debug_code, false, |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 149 | "generate extra code (assertions) for debugging") |
| 150 | DEFINE_bool(code_comments, false, "emit comments in code disassembly") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 151 | DEFINE_bool(emit_branch_hints, false, "emit branch hints") |
erik.corry@gmail.com | 9dfbea4 | 2010-05-21 12:58:28 +0000 | [diff] [blame] | 152 | DEFINE_bool(peephole_optimization, true, |
| 153 | "perform peephole optimizations in assembly code") |
| 154 | DEFINE_bool(print_peephole_optimization, false, |
| 155 | "print peephole optimizations in assembly code") |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 156 | DEFINE_bool(enable_sse2, true, |
| 157 | "enable use of SSE2 instructions if available") |
| 158 | DEFINE_bool(enable_sse3, true, |
| 159 | "enable use of SSE3 instructions if available") |
kmillikin@chromium.org | f05f291 | 2010-09-30 10:07:24 +0000 | [diff] [blame] | 160 | DEFINE_bool(enable_sse4_1, true, |
| 161 | "enable use of SSE4.1 instructions if available") |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 162 | DEFINE_bool(enable_cmov, true, |
| 163 | "enable use of CMOV instruction if available") |
| 164 | DEFINE_bool(enable_rdtsc, true, |
| 165 | "enable use of RDTSC instruction if available") |
| 166 | DEFINE_bool(enable_sahf, true, |
| 167 | "enable use of SAHF instruction if available (X64 only)") |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 168 | DEFINE_bool(enable_vfp3, true, |
| 169 | "enable use of VFP3 instructions if available (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)") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 172 | |
| 173 | // bootstrapper.cc |
| 174 | DEFINE_string(expose_natives_as, NULL, "expose natives in global object") |
| 175 | DEFINE_string(expose_debug_as, NULL, "expose debug in global object") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 176 | DEFINE_bool(expose_gc, false, "expose gc extension") |
ricow@chromium.org | 5ad5ace | 2010-06-23 09:06:43 +0000 | [diff] [blame] | 177 | DEFINE_bool(expose_externalize_string, false, |
| 178 | "expose externalize string extension") |
kasperl@chromium.org | 86f77b7 | 2009-07-06 08:21:57 +0000 | [diff] [blame] | 179 | 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] | 180 | DEFINE_bool(disable_native_files, false, "disable builtin natives files") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 181 | |
| 182 | // builtins-ia32.cc |
| 183 | DEFINE_bool(inline_new, true, "use fast inline allocation") |
| 184 | |
| 185 | // checks.cc |
| 186 | DEFINE_bool(stack_trace_on_abort, true, |
| 187 | "print a stack trace if an assertion failure occurs") |
| 188 | |
| 189 | // codegen-ia32.cc / codegen-arm.cc |
| 190 | DEFINE_bool(trace, false, "trace function calls") |
| 191 | DEFINE_bool(defer_negation, true, "defer negation operation") |
fschneider@chromium.org | e03fb64 | 2010-11-01 12:34:09 +0000 | [diff] [blame] | 192 | DEFINE_bool(mask_constants_with_cookie, |
| 193 | true, |
| 194 | "use random jit cookie to mask large constants") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 195 | |
| 196 | // codegen.cc |
| 197 | DEFINE_bool(lazy, true, "use lazy compilation") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 198 | DEFINE_bool(trace_opt, false, "trace lazy optimization") |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 199 | DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 200 | DEFINE_bool(opt, true, "use adaptive optimizations") |
| 201 | DEFINE_bool(opt_eagerly, false, "be more eager when adaptively optimizing") |
| 202 | DEFINE_bool(always_opt, false, "always try to optimize functions") |
| 203 | DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 204 | DEFINE_bool(debug_info, true, "add debug information to compiled functions") |
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 |
| 209 | DEFINE_bool(strict, false, "strict error checking") |
| 210 | DEFINE_int(min_preparse_length, 1024, |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 211 | "minimum length for automatic enable preparsing") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 212 | DEFINE_bool(full_compiler, true, "enable dedicated backend for run-once code") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 213 | DEFINE_bool(always_full_compiler, false, |
| 214 | "try to use the dedicated run-once backend for all code") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 215 | DEFINE_bool(trace_bailout, false, |
| 216 | "print reasons for falling back to using the classic V8 backend") |
fschneider@chromium.org | 086aac6 | 2010-03-17 13:18:24 +0000 | [diff] [blame] | 217 | DEFINE_bool(safe_int32_compiler, true, |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 218 | "enable optimized side-effect-free int32 expressions.") |
| 219 | DEFINE_bool(use_flow_graph, false, "perform flow-graph based optimizations") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 220 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 221 | // compilation-cache.cc |
| 222 | DEFINE_bool(compilation_cache, true, "enable compilation cache") |
| 223 | |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 224 | // data-flow.cc |
| 225 | DEFINE_bool(loop_peeling, false, "Peel off the first iteration of loops.") |
| 226 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 227 | // debug.cc |
| 228 | DEFINE_bool(remote_debugging, false, "enable remote debugging") |
| 229 | DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response") |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 230 | DEFINE_bool(debugger_auto_break, true, |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 231 | "automatically set the debug break flag when debugger commands are " |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 232 | "in the queue") |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 233 | DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 234 | |
sgjesse@chromium.org | 496c03a | 2011-02-14 12:05:43 +0000 | [diff] [blame] | 235 | // execution.cc |
| 236 | DEFINE_int(stack_size, kPointerSize * 128, |
| 237 | "default size of stack region v8 is allowed to use (in KkBytes)") |
| 238 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 239 | // frames.cc |
| 240 | DEFINE_int(max_stack_trace_source_length, 300, |
| 241 | "maximum length of function source code printed in a stack trace.") |
| 242 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 243 | // full-codegen.cc |
| 244 | DEFINE_bool(always_inline_smi_code, false, |
| 245 | "always inline smi code in non-opt code") |
| 246 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 247 | // heap.cc |
kmillikin@chromium.org | f05f291 | 2010-09-30 10:07:24 +0000 | [diff] [blame] | 248 | DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") |
| 249 | 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] | 250 | 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] | 251 | DEFINE_bool(gc_global, false, "always perform global GCs") |
| 252 | DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations") |
| 253 | DEFINE_bool(trace_gc, false, |
| 254 | "print one trace line following each garbage collection") |
erik.corry@gmail.com | 9dfbea4 | 2010-05-21 12:58:28 +0000 | [diff] [blame] | 255 | DEFINE_bool(trace_gc_nvp, false, |
| 256 | "print one detailed trace line in name=value format " |
| 257 | "after each garbage collection") |
| 258 | DEFINE_bool(print_cumulative_gc_stat, false, |
| 259 | "print cumulative GC statistics in name=value format on exit") |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 260 | DEFINE_bool(trace_gc_verbose, false, |
| 261 | "print more details following each garbage collection") |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 262 | DEFINE_bool(collect_maps, true, |
kasperl@chromium.org | 9bbf968 | 2008-10-30 11:53:07 +0000 | [diff] [blame] | 263 | "garbage collect maps from which no objects can be reached") |
ricow@chromium.org | 5ad5ace | 2010-06-23 09:06:43 +0000 | [diff] [blame] | 264 | DEFINE_bool(flush_code, true, |
ricow@chromium.org | 6125555 | 2010-06-11 07:46:10 +0000 | [diff] [blame] | 265 | "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] | 266 | |
ager@chromium.org | add848f | 2009-08-13 12:44:13 +0000 | [diff] [blame] | 267 | // v8.cc |
| 268 | DEFINE_bool(use_idle_notification, true, |
| 269 | "Use idle notification to reduce memory footprint.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 270 | // ic.cc |
| 271 | DEFINE_bool(use_ic, true, "use inline caching") |
| 272 | |
| 273 | // macro-assembler-ia32.cc |
| 274 | DEFINE_bool(native_code_counters, false, |
| 275 | "generate extra code for manipulating stats counters") |
| 276 | |
| 277 | // mark-compact.cc |
| 278 | DEFINE_bool(always_compact, false, "Perform compaction on every full GC") |
| 279 | DEFINE_bool(never_compact, false, |
| 280 | "Never perform compaction on full GC - testing only") |
| 281 | DEFINE_bool(cleanup_ics_at_gc, true, |
| 282 | "Flush inline caches prior to mark compact collection.") |
| 283 | DEFINE_bool(cleanup_caches_in_maps_at_gc, true, |
| 284 | "Flush code caches in maps during mark compact cycle.") |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 285 | DEFINE_int(random_seed, 0, |
| 286 | "Default seed for initializing random generator " |
| 287 | "(0, the default, means to use system random).") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 288 | |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 289 | DEFINE_bool(canonicalize_object_literal_maps, true, |
| 290 | "Canonicalize maps for object literals.") |
| 291 | |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 292 | DEFINE_bool(use_big_map_space, true, |
| 293 | "Use big map space, but don't compact if it grew too big.") |
| 294 | |
kasperl@chromium.org | eac059f | 2010-01-25 11:02:06 +0000 | [diff] [blame] | 295 | DEFINE_int(max_map_space_pages, MapSpace::kMaxMapPageIndex - 1, |
| 296 | "Maximum number of pages in map space which still allows to encode " |
| 297 | "forwarding pointers. That's actually a constant, but it's useful " |
| 298 | "to control it with a flag for better testing.") |
| 299 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 300 | // mksnapshot.cc |
| 301 | DEFINE_bool(h, false, "print this message") |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 302 | DEFINE_bool(new_snapshot, true, "use new snapshot implementation") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 303 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 304 | // objects.cc |
| 305 | DEFINE_bool(use_verbose_printer, true, "allows verbose printing") |
| 306 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 307 | // parser.cc |
| 308 | DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") |
vegorov@chromium.org | 0a4e901 | 2011-01-24 12:33:13 +0000 | [diff] [blame] | 309 | DEFINE_bool(strict_mode, true, "allow strict mode directives") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 310 | |
kasperl@chromium.org | 9bbf968 | 2008-10-30 11:53:07 +0000 | [diff] [blame] | 311 | // rewriter.cc |
| 312 | DEFINE_bool(optimize_ast, true, "optimize the ast") |
| 313 | |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 314 | // simulator-arm.cc and simulator-mips.cc |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 315 | DEFINE_bool(trace_sim, false, "Trace simulator execution") |
lrn@chromium.org | c34f580 | 2010-04-28 12:53:43 +0000 | [diff] [blame] | 316 | DEFINE_bool(check_icache, false, "Check icache flushes in ARM simulator") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 317 | 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] | 318 | DEFINE_int(sim_stack_alignment, 8, |
| 319 | "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] | 320 | |
| 321 | // top.cc |
| 322 | DEFINE_bool(trace_exception, false, |
| 323 | "print stack trace when throwing exceptions") |
| 324 | DEFINE_bool(preallocate_message_memory, false, |
| 325 | "preallocate some memory to build stack traces.") |
| 326 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 327 | // v8.cc |
| 328 | DEFINE_bool(preemption, false, |
| 329 | "activate a 100ms timer that switches between V8 threads") |
| 330 | |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 331 | // Regexp |
| 332 | DEFINE_bool(trace_regexps, false, "trace regexp execution") |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 333 | DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 334 | 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] | 335 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 336 | // Testing flags test/cctest/test-{flags,api,serialization}.cc |
| 337 | DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") |
| 338 | DEFINE_int(testing_int_flag, 13, "testing_int_flag") |
| 339 | DEFINE_float(testing_float_flag, 2.5, "float-flag") |
| 340 | DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") |
| 341 | DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") |
| 342 | #ifdef WIN32 |
| 343 | DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", |
| 344 | "file in which to testing_serialize heap") |
| 345 | #else |
| 346 | DEFINE_string(testing_serialization_file, "/tmp/serdes", |
| 347 | "file in which to serialize heap") |
| 348 | #endif |
| 349 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 350 | // |
| 351 | // Dev shell flags |
| 352 | // |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 353 | |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 354 | DEFINE_bool(help, false, "Print usage message, including flags, on console") |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 355 | DEFINE_bool(dump_counters, false, "Dump counters on exit") |
vegorov@chromium.org | 2356e6f | 2010-06-09 09:38:56 +0000 | [diff] [blame] | 356 | DEFINE_bool(debugger, false, "Enable JavaScript debugger") |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 357 | DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the " |
| 358 | "debugger agent in another process") |
| 359 | DEFINE_bool(debugger_agent, false, "Enable debugger agent") |
| 360 | DEFINE_int(debugger_port, 5858, "Port to use for remote debugging") |
kmillikin@chromium.org | 3cdd9e1 | 2010-09-06 11:39:48 +0000 | [diff] [blame] | 361 | DEFINE_string(map_counters, NULL, "Map counters to a file") |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 362 | DEFINE_args(js_arguments, JSArguments(), |
| 363 | "Pass all remaining arguments to the script. Alias for \"--\".") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 364 | |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 365 | #if defined(WEBOS__) |
| 366 | DEFINE_bool(debug_compile_events, false, "Enable debugger compile events") |
| 367 | DEFINE_bool(debug_script_collected_events, false, |
| 368 | "Enable debugger script collected events") |
| 369 | #else |
| 370 | DEFINE_bool(debug_compile_events, true, "Enable debugger compile events") |
| 371 | DEFINE_bool(debug_script_collected_events, true, |
| 372 | "Enable debugger script collected events") |
| 373 | #endif |
| 374 | |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 375 | |
| 376 | // |
| 377 | // GDB JIT integration flags. |
| 378 | // |
| 379 | |
| 380 | DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)") |
| 381 | 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] | 382 | DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk") |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 383 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 384 | // |
| 385 | // Debug only flags |
| 386 | // |
| 387 | #undef FLAG |
| 388 | #ifdef DEBUG |
| 389 | #define FLAG FLAG_FULL |
| 390 | #else |
| 391 | #define FLAG FLAG_READONLY |
| 392 | #endif |
| 393 | |
| 394 | // checks.cc |
| 395 | DEFINE_bool(enable_slow_asserts, false, |
| 396 | "enable asserts that are slow to execute") |
| 397 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 398 | // codegen-ia32.cc / codegen-arm.cc |
| 399 | DEFINE_bool(trace_codegen, false, |
| 400 | "print name of functions for which code is generated") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 401 | DEFINE_bool(print_source, false, "pretty print source code") |
| 402 | DEFINE_bool(print_builtin_source, false, |
| 403 | "pretty print source code for builtins") |
| 404 | DEFINE_bool(print_ast, false, "print source AST") |
| 405 | 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] | 406 | DEFINE_bool(print_json_ast, false, "print source AST as JSON") |
| 407 | DEFINE_bool(print_builtin_json_ast, false, |
| 408 | "print source AST for builtins as JSON") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 409 | DEFINE_bool(trace_calls, false, "trace calls") |
| 410 | DEFINE_bool(trace_builtin_calls, false, "trace builtins calls") |
| 411 | DEFINE_string(stop_at, "", "function name where to insert a breakpoint") |
| 412 | |
| 413 | // compiler.cc |
| 414 | DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins") |
| 415 | DEFINE_bool(print_scopes, false, "print scopes") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 416 | DEFINE_bool(print_ir, false, "print the AST as seen by the backend") |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 417 | DEFINE_bool(print_graph_text, false, |
| 418 | "print a text representation of the flow graph") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 419 | |
| 420 | // contexts.cc |
| 421 | DEFINE_bool(trace_contexts, false, "trace contexts operations") |
| 422 | |
| 423 | // heap.cc |
| 424 | DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations") |
| 425 | DEFINE_bool(gc_verbose, false, "print stuff during garbage collection") |
| 426 | DEFINE_bool(heap_stats, false, "report heap statistics before and after GC") |
| 427 | DEFINE_bool(code_stats, false, "report code statistics after GC") |
| 428 | DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC") |
| 429 | DEFINE_bool(print_handles, false, "report handles after GC") |
| 430 | DEFINE_bool(print_global_handles, false, "report global handles after GC") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 431 | |
| 432 | // ic.cc |
| 433 | DEFINE_bool(trace_ic, false, "trace inline cache state transitions") |
| 434 | |
| 435 | // objects.cc |
| 436 | DEFINE_bool(trace_normalization, |
| 437 | false, |
| 438 | "prints when objects are turned into dictionaries.") |
| 439 | |
| 440 | // runtime.cc |
| 441 | DEFINE_bool(trace_lazy, false, "trace lazy compilation") |
| 442 | |
| 443 | // serialize.cc |
| 444 | DEFINE_bool(debug_serialization, false, |
| 445 | "write debug information into the snapshot.") |
| 446 | |
| 447 | // spaces.cc |
| 448 | DEFINE_bool(collect_heap_spill_statistics, false, |
| 449 | "report heap spill statistics along with heap_stats " |
| 450 | "(requires heap_stats)") |
| 451 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 452 | // VM state |
| 453 | DEFINE_bool(log_state_changes, false, "Log state changes.") |
| 454 | |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 455 | // Regexp |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 456 | DEFINE_bool(regexp_possessive_quantifier, |
| 457 | false, |
| 458 | "enable possessive quantifier syntax for testing") |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 459 | DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution") |
| 460 | DEFINE_bool(trace_regexp_assembler, |
| 461 | false, |
| 462 | "trace regexp macro assembler calls.") |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 463 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 464 | // |
| 465 | // Logging and profiling only flags |
| 466 | // |
| 467 | #undef FLAG |
| 468 | #ifdef ENABLE_LOGGING_AND_PROFILING |
| 469 | #define FLAG FLAG_FULL |
| 470 | #else |
| 471 | #define FLAG FLAG_READONLY |
| 472 | #endif |
| 473 | |
| 474 | // log.cc |
| 475 | DEFINE_bool(log, false, |
| 476 | "Minimal logging (no API, code, GC, suspect, or handles samples).") |
| 477 | 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] | 478 | DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 479 | DEFINE_bool(log_api, false, "Log API events to the log file.") |
| 480 | DEFINE_bool(log_code, false, |
| 481 | "Log code events to the log file without profiling.") |
| 482 | DEFINE_bool(log_gc, false, |
| 483 | "Log heap samples on garbage collection for the hp2ps tool.") |
| 484 | DEFINE_bool(log_handles, false, "Log global handle events.") |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 485 | DEFINE_bool(log_snapshot_positions, false, |
| 486 | "log positions of (de)serialized objects in the snapshot.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 487 | DEFINE_bool(log_suspect, false, "Log suspect operations.") |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 488 | DEFINE_bool(log_producers, false, "Log stack traces of JS objects allocations.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 489 | DEFINE_bool(prof, false, |
| 490 | "Log statistical profiling information (implies --log-code).") |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 491 | DEFINE_bool(prof_auto, true, |
| 492 | "Used with --prof, starts profiling automatically") |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 493 | DEFINE_bool(prof_lazy, false, |
| 494 | "Used with --prof, only does sampling and logging" |
| 495 | " when profiler is active (implies --noprof_auto).") |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 496 | DEFINE_bool(prof_browser_mode, true, |
| 497 | "Used with --prof, turns on browser-compatible mode for profiling.") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 498 | DEFINE_bool(log_regexp, false, "Log regular expression execution.") |
| 499 | DEFINE_bool(sliding_state_window, false, |
| 500 | "Update sliding state window counters.") |
| 501 | 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] | 502 | DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.") |
kasperl@chromium.org | f5aa837 | 2009-03-24 14:47:14 +0000 | [diff] [blame] | 503 | |
| 504 | // |
| 505 | // Heap protection flags |
| 506 | // Using heap protection requires ENABLE_LOGGING_AND_PROFILING as well. |
| 507 | // |
| 508 | #ifdef ENABLE_HEAP_PROTECTION |
| 509 | #undef FLAG |
| 510 | #define FLAG FLAG_FULL |
| 511 | |
| 512 | DEFINE_bool(protect_heap, false, |
| 513 | "Protect/unprotect V8's heap when leaving/entring the VM.") |
| 514 | |
| 515 | #endif |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 516 | |
| 517 | // |
| 518 | // Disassembler only flags |
| 519 | // |
| 520 | #undef FLAG |
| 521 | #ifdef ENABLE_DISASSEMBLER |
| 522 | #define FLAG FLAG_FULL |
| 523 | #else |
| 524 | #define FLAG FLAG_READONLY |
| 525 | #endif |
| 526 | |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 527 | // code-stubs.cc |
| 528 | DEFINE_bool(print_code_stubs, false, "print code stubs") |
| 529 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 530 | // codegen-ia32.cc / codegen-arm.cc |
| 531 | DEFINE_bool(print_code, false, "print generated code") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 532 | DEFINE_bool(print_opt_code, false, "print optimized code") |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 533 | DEFINE_bool(print_unopt_code, false, "print unoptimized code before " |
| 534 | "printing optimized code based on it") |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 535 | DEFINE_bool(print_code_verbose, false, "print more information for code") |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 536 | DEFINE_bool(print_builtin_code, false, "print generated code for builtins") |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 537 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 538 | // Cleanup... |
| 539 | #undef FLAG_FULL |
| 540 | #undef FLAG_READONLY |
| 541 | #undef FLAG |
| 542 | |
| 543 | #undef DEFINE_bool |
| 544 | #undef DEFINE_int |
| 545 | #undef DEFINE_string |
| 546 | |
| 547 | #undef FLAG_MODE_DECLARE |
| 548 | #undef FLAG_MODE_DEFINE |
| 549 | #undef FLAG_MODE_DEFINE_DEFAULTS |
| 550 | #undef FLAG_MODE_META |