Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 1 | // Copyright 2008 the V8 project authors. All rights reserved. |
| 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) \ |
| 65 | { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false }, |
| 66 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) |
| 67 | |
| 68 | #else |
| 69 | #error No mode supplied when including flags.defs |
| 70 | #endif |
| 71 | |
| 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 | |
| 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) |
| 92 | #define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt) |
| 93 | |
| 94 | // |
| 95 | // Flags in all modes. |
| 96 | // |
| 97 | #define FLAG FLAG_FULL |
| 98 | |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 99 | // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 100 | DEFINE_bool(debug_code, false, |
| 101 | "generate extra code (comments, assertions) for debugging") |
| 102 | DEFINE_bool(emit_branch_hints, false, "emit branch hints") |
Leon Clarke | f7060e2 | 2010-06-03 12:02:55 +0100 | [diff] [blame] | 103 | DEFINE_bool(peephole_optimization, true, |
| 104 | "perform peephole optimizations in assembly code") |
| 105 | DEFINE_bool(print_peephole_optimization, false, |
| 106 | "print peephole optimizations in assembly code") |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 107 | DEFINE_bool(enable_sse2, true, |
| 108 | "enable use of SSE2 instructions if available") |
| 109 | DEFINE_bool(enable_sse3, true, |
| 110 | "enable use of SSE3 instructions if available") |
Ben Murdoch | f87a203 | 2010-10-22 12:50:53 +0100 | [diff] [blame^] | 111 | DEFINE_bool(enable_sse4_1, true, |
| 112 | "enable use of SSE4.1 instructions if available") |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 113 | DEFINE_bool(enable_cmov, true, |
| 114 | "enable use of CMOV instruction if available") |
| 115 | DEFINE_bool(enable_rdtsc, true, |
| 116 | "enable use of RDTSC instruction if available") |
| 117 | DEFINE_bool(enable_sahf, true, |
| 118 | "enable use of SAHF instruction if available (X64 only)") |
Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 119 | DEFINE_bool(enable_vfp3, true, |
| 120 | "enable use of VFP3 instructions if available (ARM only)") |
Andrei Popescu | 3100271 | 2010-02-23 13:46:05 +0000 | [diff] [blame] | 121 | DEFINE_bool(enable_armv7, true, |
| 122 | "enable use of ARMv7 instructions if available (ARM only)") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 123 | |
| 124 | // bootstrapper.cc |
| 125 | DEFINE_string(expose_natives_as, NULL, "expose natives in global object") |
| 126 | DEFINE_string(expose_debug_as, NULL, "expose debug in global object") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 127 | DEFINE_bool(expose_gc, false, "expose gc extension") |
Kristian Monsen | 9dcf7e2 | 2010-06-28 14:14:28 +0100 | [diff] [blame] | 128 | DEFINE_bool(expose_externalize_string, false, |
| 129 | "expose externalize string extension") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 130 | DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 131 | DEFINE_bool(disable_native_files, false, "disable builtin natives files") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 132 | |
| 133 | // builtins-ia32.cc |
| 134 | DEFINE_bool(inline_new, true, "use fast inline allocation") |
| 135 | |
| 136 | // checks.cc |
| 137 | DEFINE_bool(stack_trace_on_abort, true, |
| 138 | "print a stack trace if an assertion failure occurs") |
| 139 | |
| 140 | // codegen-ia32.cc / codegen-arm.cc |
| 141 | DEFINE_bool(trace, false, "trace function calls") |
| 142 | DEFINE_bool(defer_negation, true, "defer negation operation") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 143 | |
| 144 | // codegen.cc |
| 145 | DEFINE_bool(lazy, true, "use lazy compilation") |
| 146 | DEFINE_bool(debug_info, true, "add debug information to compiled functions") |
| 147 | |
| 148 | // compiler.cc |
| 149 | DEFINE_bool(strict, false, "strict error checking") |
| 150 | DEFINE_int(min_preparse_length, 1024, |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 151 | "minimum length for automatic enable preparsing") |
Leon Clarke | d91b9f7 | 2010-01-27 17:25:45 +0000 | [diff] [blame] | 152 | DEFINE_bool(full_compiler, true, "enable dedicated backend for run-once code") |
Leon Clarke | d91b9f7 | 2010-01-27 17:25:45 +0000 | [diff] [blame] | 153 | DEFINE_bool(always_full_compiler, false, |
| 154 | "try to use the dedicated run-once backend for all code") |
Leon Clarke | d91b9f7 | 2010-01-27 17:25:45 +0000 | [diff] [blame] | 155 | DEFINE_bool(trace_bailout, false, |
| 156 | "print reasons for falling back to using the classic V8 backend") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 157 | DEFINE_bool(safe_int32_compiler, true, |
| 158 | "enable optimized side-effect-free int32 expressions.") |
| 159 | DEFINE_bool(use_flow_graph, false, "perform flow-graph based optimizations") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 160 | |
| 161 | // compilation-cache.cc |
| 162 | DEFINE_bool(compilation_cache, true, "enable compilation cache") |
| 163 | |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 164 | // data-flow.cc |
| 165 | DEFINE_bool(loop_peeling, false, "Peel off the first iteration of loops.") |
| 166 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 167 | // debug.cc |
| 168 | DEFINE_bool(remote_debugging, false, "enable remote debugging") |
| 169 | DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response") |
Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 170 | DEFINE_bool(debugger_auto_break, true, |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 171 | "automatically set the debug break flag when debugger commands are " |
Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 172 | "in the queue") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 173 | DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 174 | |
| 175 | // frames.cc |
| 176 | DEFINE_int(max_stack_trace_source_length, 300, |
| 177 | "maximum length of function source code printed in a stack trace.") |
| 178 | |
Kristian Monsen | 0d5e116 | 2010-09-30 15:31:59 +0100 | [diff] [blame] | 179 | // full-codegen.cc |
| 180 | DEFINE_bool(always_inline_smi_code, false, |
| 181 | "always inline smi code in non-opt code") |
| 182 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 183 | // heap.cc |
Ben Murdoch | f87a203 | 2010-10-22 12:50:53 +0100 | [diff] [blame^] | 184 | DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") |
| 185 | DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 186 | DEFINE_bool(gc_global, false, "always perform global GCs") |
| 187 | DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations") |
| 188 | DEFINE_bool(trace_gc, false, |
| 189 | "print one trace line following each garbage collection") |
Leon Clarke | f7060e2 | 2010-06-03 12:02:55 +0100 | [diff] [blame] | 190 | DEFINE_bool(trace_gc_nvp, false, |
| 191 | "print one detailed trace line in name=value format " |
| 192 | "after each garbage collection") |
| 193 | DEFINE_bool(print_cumulative_gc_stat, false, |
| 194 | "print cumulative GC statistics in name=value format on exit") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 195 | DEFINE_bool(trace_gc_verbose, false, |
| 196 | "print more details following each garbage collection") |
| 197 | DEFINE_bool(collect_maps, true, |
| 198 | "garbage collect maps from which no objects can be reached") |
Kristian Monsen | 9dcf7e2 | 2010-06-28 14:14:28 +0100 | [diff] [blame] | 199 | DEFINE_bool(flush_code, true, |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 200 | "flush code that we expect not to use again before full gc") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 201 | |
| 202 | // v8.cc |
| 203 | DEFINE_bool(use_idle_notification, true, |
| 204 | "Use idle notification to reduce memory footprint.") |
| 205 | // ic.cc |
| 206 | DEFINE_bool(use_ic, true, "use inline caching") |
| 207 | |
| 208 | // macro-assembler-ia32.cc |
| 209 | DEFINE_bool(native_code_counters, false, |
| 210 | "generate extra code for manipulating stats counters") |
| 211 | |
| 212 | // mark-compact.cc |
| 213 | DEFINE_bool(always_compact, false, "Perform compaction on every full GC") |
| 214 | DEFINE_bool(never_compact, false, |
| 215 | "Never perform compaction on full GC - testing only") |
| 216 | DEFINE_bool(cleanup_ics_at_gc, true, |
| 217 | "Flush inline caches prior to mark compact collection.") |
| 218 | DEFINE_bool(cleanup_caches_in_maps_at_gc, true, |
| 219 | "Flush code caches in maps during mark compact cycle.") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 220 | DEFINE_int(random_seed, 0, |
| 221 | "Default seed for initializing random generator " |
| 222 | "(0, the default, means to use system random).") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 223 | |
| 224 | DEFINE_bool(canonicalize_object_literal_maps, true, |
| 225 | "Canonicalize maps for object literals.") |
| 226 | |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 227 | DEFINE_bool(use_big_map_space, true, |
| 228 | "Use big map space, but don't compact if it grew too big.") |
| 229 | |
Leon Clarke | d91b9f7 | 2010-01-27 17:25:45 +0000 | [diff] [blame] | 230 | DEFINE_int(max_map_space_pages, MapSpace::kMaxMapPageIndex - 1, |
| 231 | "Maximum number of pages in map space which still allows to encode " |
| 232 | "forwarding pointers. That's actually a constant, but it's useful " |
| 233 | "to control it with a flag for better testing.") |
| 234 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 235 | // mksnapshot.cc |
| 236 | DEFINE_bool(h, false, "print this message") |
Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 237 | DEFINE_bool(new_snapshot, true, "use new snapshot implementation") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 238 | |
| 239 | // parser.cc |
| 240 | DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") |
| 241 | |
| 242 | // rewriter.cc |
| 243 | DEFINE_bool(optimize_ast, true, "optimize the ast") |
| 244 | |
Andrei Popescu | 3100271 | 2010-02-23 13:46:05 +0000 | [diff] [blame] | 245 | // simulator-arm.cc and simulator-mips.cc |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 246 | DEFINE_bool(trace_sim, false, "Trace simulator execution") |
| 247 | DEFINE_bool(check_icache, false, "Check icache flushes in ARM simulator") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 248 | DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 249 | DEFINE_int(sim_stack_alignment, 8, |
| 250 | "Stack alingment in bytes in simulator (4 or 8, 8 is default)") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 251 | |
| 252 | // top.cc |
| 253 | DEFINE_bool(trace_exception, false, |
| 254 | "print stack trace when throwing exceptions") |
| 255 | DEFINE_bool(preallocate_message_memory, false, |
| 256 | "preallocate some memory to build stack traces.") |
| 257 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 258 | // v8.cc |
| 259 | DEFINE_bool(preemption, false, |
| 260 | "activate a 100ms timer that switches between V8 threads") |
| 261 | |
| 262 | // Regexp |
| 263 | DEFINE_bool(trace_regexps, false, "trace regexp execution") |
| 264 | DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 265 | DEFINE_bool(regexp_entry_native, true, "use native code to enter regexp") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 266 | |
| 267 | // Testing flags test/cctest/test-{flags,api,serialization}.cc |
| 268 | DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") |
| 269 | DEFINE_int(testing_int_flag, 13, "testing_int_flag") |
| 270 | DEFINE_float(testing_float_flag, 2.5, "float-flag") |
| 271 | DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") |
| 272 | DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") |
| 273 | #ifdef WIN32 |
| 274 | DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", |
| 275 | "file in which to testing_serialize heap") |
| 276 | #else |
| 277 | DEFINE_string(testing_serialization_file, "/tmp/serdes", |
| 278 | "file in which to serialize heap") |
| 279 | #endif |
| 280 | |
| 281 | // |
| 282 | // Dev shell flags |
| 283 | // |
| 284 | |
| 285 | DEFINE_bool(help, false, "Print usage message, including flags, on console") |
| 286 | DEFINE_bool(dump_counters, false, "Dump counters on exit") |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 287 | DEFINE_bool(debugger, false, "Enable JavaScript debugger") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 288 | DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the " |
| 289 | "debugger agent in another process") |
| 290 | DEFINE_bool(debugger_agent, false, "Enable debugger agent") |
| 291 | DEFINE_int(debugger_port, 5858, "Port to use for remote debugging") |
Iain Merrick | 9ac36c9 | 2010-09-13 15:29:50 +0100 | [diff] [blame] | 292 | DEFINE_string(map_counters, NULL, "Map counters to a file") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 293 | DEFINE_args(js_arguments, JSArguments(), |
| 294 | "Pass all remaining arguments to the script. Alias for \"--\".") |
| 295 | |
| 296 | // |
| 297 | // Debug only flags |
| 298 | // |
| 299 | #undef FLAG |
| 300 | #ifdef DEBUG |
| 301 | #define FLAG FLAG_FULL |
| 302 | #else |
| 303 | #define FLAG FLAG_READONLY |
| 304 | #endif |
| 305 | |
| 306 | // checks.cc |
| 307 | DEFINE_bool(enable_slow_asserts, false, |
| 308 | "enable asserts that are slow to execute") |
| 309 | |
| 310 | // codegen-ia32.cc / codegen-arm.cc |
| 311 | DEFINE_bool(trace_codegen, false, |
| 312 | "print name of functions for which code is generated") |
| 313 | DEFINE_bool(print_source, false, "pretty print source code") |
| 314 | DEFINE_bool(print_builtin_source, false, |
| 315 | "pretty print source code for builtins") |
| 316 | DEFINE_bool(print_ast, false, "print source AST") |
| 317 | DEFINE_bool(print_builtin_ast, false, "print source AST for builtins") |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 318 | DEFINE_bool(print_json_ast, false, "print source AST as JSON") |
| 319 | DEFINE_bool(print_builtin_json_ast, false, |
| 320 | "print source AST for builtins as JSON") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 321 | DEFINE_bool(trace_calls, false, "trace calls") |
| 322 | DEFINE_bool(trace_builtin_calls, false, "trace builtins calls") |
| 323 | DEFINE_string(stop_at, "", "function name where to insert a breakpoint") |
| 324 | |
| 325 | // compiler.cc |
| 326 | DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins") |
| 327 | DEFINE_bool(print_scopes, false, "print scopes") |
Leon Clarke | 4515c47 | 2010-02-03 11:58:03 +0000 | [diff] [blame] | 328 | DEFINE_bool(print_ir, false, "print the AST as seen by the backend") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 329 | DEFINE_bool(print_graph_text, false, |
| 330 | "print a text representation of the flow graph") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 331 | |
| 332 | // contexts.cc |
| 333 | DEFINE_bool(trace_contexts, false, "trace contexts operations") |
| 334 | |
| 335 | // heap.cc |
| 336 | DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations") |
| 337 | DEFINE_bool(gc_verbose, false, "print stuff during garbage collection") |
| 338 | DEFINE_bool(heap_stats, false, "report heap statistics before and after GC") |
| 339 | DEFINE_bool(code_stats, false, "report code statistics after GC") |
| 340 | DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC") |
| 341 | DEFINE_bool(print_handles, false, "report handles after GC") |
| 342 | DEFINE_bool(print_global_handles, false, "report global handles after GC") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 343 | |
| 344 | // ic.cc |
| 345 | DEFINE_bool(trace_ic, false, "trace inline cache state transitions") |
| 346 | |
| 347 | // objects.cc |
| 348 | DEFINE_bool(trace_normalization, |
| 349 | false, |
| 350 | "prints when objects are turned into dictionaries.") |
| 351 | |
| 352 | // runtime.cc |
| 353 | DEFINE_bool(trace_lazy, false, "trace lazy compilation") |
| 354 | |
| 355 | // serialize.cc |
| 356 | DEFINE_bool(debug_serialization, false, |
| 357 | "write debug information into the snapshot.") |
| 358 | |
| 359 | // spaces.cc |
| 360 | DEFINE_bool(collect_heap_spill_statistics, false, |
| 361 | "report heap spill statistics along with heap_stats " |
| 362 | "(requires heap_stats)") |
| 363 | |
| 364 | // Regexp |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 365 | DEFINE_bool(regexp_possessive_quantifier, |
| 366 | false, |
| 367 | "enable possessive quantifier syntax for testing") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 368 | DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution") |
| 369 | DEFINE_bool(trace_regexp_assembler, |
| 370 | false, |
| 371 | "trace regexp macro assembler calls.") |
| 372 | |
| 373 | // |
| 374 | // Logging and profiling only flags |
| 375 | // |
| 376 | #undef FLAG |
| 377 | #ifdef ENABLE_LOGGING_AND_PROFILING |
| 378 | #define FLAG FLAG_FULL |
| 379 | #else |
| 380 | #define FLAG FLAG_READONLY |
| 381 | #endif |
| 382 | |
| 383 | // log.cc |
| 384 | DEFINE_bool(log, false, |
| 385 | "Minimal logging (no API, code, GC, suspect, or handles samples).") |
| 386 | DEFINE_bool(log_all, false, "Log all events to the log file.") |
| 387 | DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") |
| 388 | DEFINE_bool(log_api, false, "Log API events to the log file.") |
| 389 | DEFINE_bool(log_code, false, |
| 390 | "Log code events to the log file without profiling.") |
| 391 | DEFINE_bool(log_gc, false, |
| 392 | "Log heap samples on garbage collection for the hp2ps tool.") |
| 393 | DEFINE_bool(log_handles, false, "Log global handle events.") |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 394 | DEFINE_bool(log_snapshot_positions, false, |
| 395 | "log positions of (de)serialized objects in the snapshot.") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 396 | DEFINE_bool(log_state_changes, false, "Log state changes.") |
| 397 | DEFINE_bool(log_suspect, false, "Log suspect operations.") |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 398 | DEFINE_bool(log_producers, false, "Log stack traces of JS objects allocations.") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 399 | DEFINE_bool(compress_log, false, |
| 400 | "Compress log to save space (makes log less human-readable).") |
| 401 | DEFINE_bool(prof, false, |
| 402 | "Log statistical profiling information (implies --log-code).") |
| 403 | DEFINE_bool(prof_auto, true, |
| 404 | "Used with --prof, starts profiling automatically") |
| 405 | DEFINE_bool(prof_lazy, false, |
| 406 | "Used with --prof, only does sampling and logging" |
| 407 | " when profiler is active (implies --noprof_auto).") |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 408 | DEFINE_bool(prof_browser_mode, true, |
| 409 | "Used with --prof, turns on browser-compatible mode for profiling.") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 410 | DEFINE_bool(log_regexp, false, "Log regular expression execution.") |
| 411 | DEFINE_bool(sliding_state_window, false, |
| 412 | "Update sliding state window counters.") |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 413 | DEFINE_string(logfile, "v8.log", "Specify the name of the log file.") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 414 | DEFINE_bool(oprofile, false, "Enable JIT agent for OProfile.") |
Ben Murdoch | f87a203 | 2010-10-22 12:50:53 +0100 | [diff] [blame^] | 415 | DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.") |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 416 | |
| 417 | // |
| 418 | // Heap protection flags |
| 419 | // Using heap protection requires ENABLE_LOGGING_AND_PROFILING as well. |
| 420 | // |
| 421 | #ifdef ENABLE_HEAP_PROTECTION |
| 422 | #undef FLAG |
| 423 | #define FLAG FLAG_FULL |
| 424 | |
| 425 | DEFINE_bool(protect_heap, false, |
| 426 | "Protect/unprotect V8's heap when leaving/entring the VM.") |
| 427 | |
| 428 | #endif |
| 429 | |
| 430 | // |
| 431 | // Disassembler only flags |
| 432 | // |
| 433 | #undef FLAG |
| 434 | #ifdef ENABLE_DISASSEMBLER |
| 435 | #define FLAG FLAG_FULL |
| 436 | #else |
| 437 | #define FLAG FLAG_READONLY |
| 438 | #endif |
| 439 | |
| 440 | // code-stubs.cc |
| 441 | DEFINE_bool(print_code_stubs, false, "print code stubs") |
| 442 | |
| 443 | // codegen-ia32.cc / codegen-arm.cc |
| 444 | DEFINE_bool(print_code, false, "print generated code") |
| 445 | DEFINE_bool(print_builtin_code, false, "print generated code for builtins") |
| 446 | |
| 447 | // Cleanup... |
| 448 | #undef FLAG_FULL |
| 449 | #undef FLAG_READONLY |
| 450 | #undef FLAG |
| 451 | |
| 452 | #undef DEFINE_bool |
| 453 | #undef DEFINE_int |
| 454 | #undef DEFINE_string |
| 455 | |
| 456 | #undef FLAG_MODE_DECLARE |
| 457 | #undef FLAG_MODE_DEFINE |
| 458 | #undef FLAG_MODE_DEFINE_DEFAULTS |
| 459 | #undef FLAG_MODE_META |