1 // Copyright 2012 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
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.
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.
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 ';'.
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:
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 #define DEFINE_implication(whenflag, thenflag)
46 // We want to supply the actual storage and value for the flag variable in the
47 // .cc file. We only do this for writable flags.
48 #elif defined(FLAG_MODE_DEFINE)
49 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
50 ctype FLAG_##nam = def;
51 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
52 #define DEFINE_implication(whenflag, thenflag)
54 // We need to define all of our default values so that the Flag structure can
55 // access them by pointer. These are just used internally inside of one .cc,
56 // for MODE_META, so there is no impact on the flags interface.
57 #elif defined(FLAG_MODE_DEFINE_DEFAULTS)
58 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
59 static ctype const FLAGDEFAULT_##nam = def;
60 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
61 #define DEFINE_implication(whenflag, thenflag)
63 // We want to write entries into our meta data table, for internal parsing and
64 // printing / etc in the flag parser code. We only do this for writable flags.
65 #elif defined(FLAG_MODE_META)
66 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
67 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false },
68 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
69 #define DEFINE_implication(whenflag, thenflag)
71 // We produce the code to set flags when it is implied by another flag.
72 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
73 #define FLAG_FULL(ftype, ctype, nam, def, cmt)
74 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
75 #define DEFINE_implication(whenflag, thenflag) \
76 if (FLAG_##whenflag) FLAG_##thenflag = true;
79 #error No mode supplied when including flags.defs
82 #ifdef FLAG_MODE_DECLARE
83 // Structure used to hold a collection of arguments to the JavaScript code.
84 #define JSARGUMENTS_INIT {{}}
87 inline int argc() const {
88 return static_cast<int>(storage_[0]);
90 inline const char** argv() const {
91 return reinterpret_cast<const char**>(storage_[1]);
93 inline const char*& operator[] (int idx) const {
96 inline JSArguments& operator=(JSArguments args) {
97 set_argc(args.argc());
98 set_argv(args.argv());
101 static JSArguments Create(int argc, const char** argv) {
108 void set_argc(int argc) {
111 void set_argv(const char** argv) {
112 storage_[1] = reinterpret_cast<AtomicWord>(argv);
115 // Contains argc and argv. Unfortunately we have to store these two fields
116 // into a single one to avoid making the initialization macro (which would be
117 // "{ 0, NULL }") contain a coma.
118 AtomicWord storage_[2];
122 #if (defined CAN_USE_VFP3_INSTRUCTIONS) || !(defined ARM_TEST)
123 # define ENABLE_VFP3_DEFAULT true
125 # define ENABLE_VFP3_DEFAULT false
127 #if (defined CAN_USE_ARMV7_INSTRUCTIONS) || !(defined ARM_TEST)
128 # define ENABLE_ARMV7_DEFAULT true
130 # define ENABLE_ARMV7_DEFAULT false
132 #if (defined CAN_USE_VFP32DREGS) || !(defined ARM_TEST)
133 # define ENABLE_32DREGS_DEFAULT true
135 # define ENABLE_32DREGS_DEFAULT false
138 #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
139 #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
140 #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
141 #define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
142 #define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt)
145 // Flags in all modes.
147 #define FLAG FLAG_FULL
149 // Flags for language modes and experimental language features.
150 DEFINE_bool(use_strict, false, "enforce strict mode")
151 DEFINE_bool(es5_readonly, true,
152 "activate correct semantics for inheriting readonliness")
153 DEFINE_bool(es52_globals, true,
154 "activate new semantics for global var declarations")
156 DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof")
157 DEFINE_bool(harmony_scoping, false, "enable harmony block scoping")
158 DEFINE_bool(harmony_modules, false,
159 "enable harmony modules (implies block scoping)")
160 DEFINE_bool(harmony_symbols, false,
161 "enable harmony symbols (a.k.a. private names)")
162 DEFINE_bool(harmony_proxies, false, "enable harmony proxies")
163 DEFINE_bool(harmony_collections, false,
164 "enable harmony collections (sets, maps, and weak maps)")
165 DEFINE_bool(harmony_observation, false,
166 "enable harmony object observation (implies harmony collections")
167 DEFINE_bool(harmony_typed_arrays, false,
168 "enable harmony typed arrays")
169 DEFINE_bool(harmony_array_buffer, false,
170 "enable harmony array buffer")
171 DEFINE_implication(harmony_typed_arrays, harmony_array_buffer)
172 DEFINE_bool(harmony_generators, false, "enable harmony generators")
173 DEFINE_bool(harmony, false, "enable all harmony features (except typeof)")
174 DEFINE_implication(harmony, harmony_scoping)
175 DEFINE_implication(harmony, harmony_modules)
176 DEFINE_implication(harmony, harmony_symbols)
177 DEFINE_implication(harmony, harmony_proxies)
178 DEFINE_implication(harmony, harmony_collections)
179 DEFINE_implication(harmony, harmony_observation)
180 DEFINE_implication(harmony, harmony_generators)
181 DEFINE_implication(harmony_modules, harmony_scoping)
182 DEFINE_implication(harmony_observation, harmony_collections)
183 // TODO[dslomov] add harmony => harmony_typed_arrays
185 // Flags for experimental implementation features.
186 DEFINE_bool(packed_arrays, true, "optimizes arrays that have no holes")
187 DEFINE_bool(smi_only_arrays, true, "tracks arrays with only smi values")
188 DEFINE_bool(compiled_transitions, false, "use optimizing compiler to "
189 "generate array elements transition stubs")
190 DEFINE_bool(compiled_keyed_stores, true, "use optimizing compiler to "
191 "generate keyed store stubs")
192 DEFINE_bool(clever_optimizations,
194 "Optimize object size, Array shift, DOM strings and string +")
195 DEFINE_bool(pretenure_literals, true, "allocate literals in old space")
196 DEFINE_bool(track_fields, true, "track fields with only smi values")
197 DEFINE_bool(track_double_fields, true, "track fields with double values")
198 DEFINE_bool(track_heap_object_fields, true, "track fields with heap values")
199 DEFINE_implication(track_double_fields, track_fields)
200 DEFINE_implication(track_heap_object_fields, track_fields)
202 // Flags for data representation optimizations
203 DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles")
204 DEFINE_bool(string_slices, true, "use string slices")
206 // Flags for Crankshaft.
207 DEFINE_bool(crankshaft, true, "use crankshaft")
208 DEFINE_string(hydrogen_filter, "", "optimization filter")
209 DEFINE_bool(use_range, true, "use hydrogen range analysis")
210 DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
211 DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
212 DEFINE_bool(use_inlining, true, "use function inlining")
213 DEFINE_int(max_inlined_source_size, 600,
214 "maximum source size in bytes considered for a single inlining")
215 DEFINE_int(max_inlined_nodes, 196,
216 "maximum number of AST nodes considered for a single inlining")
217 DEFINE_int(max_inlined_nodes_cumulative, 196,
218 "maximum cumulative number of AST nodes considered for inlining")
219 DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion")
220 DEFINE_bool(fast_math, true, "faster (but maybe less accurate) math functions")
221 DEFINE_bool(collect_megamorphic_maps_from_stub_cache,
223 "crankshaft harvests type feedback from stub cache")
224 DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen")
225 DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
226 DEFINE_string(trace_phase, "Z", "trace generated IR for specified phases")
227 DEFINE_bool(trace_inlining, false, "trace inlining decisions")
228 DEFINE_bool(trace_alloc, false, "trace register allocator")
229 DEFINE_bool(trace_all_uses, false, "trace all use positions")
230 DEFINE_bool(trace_range, false, "trace range analysis")
231 DEFINE_bool(trace_gvn, false, "trace global value numbering")
232 DEFINE_bool(trace_representation, false, "trace representation types")
233 DEFINE_bool(trace_track_allocation_sites, false,
234 "trace the tracking of allocation sites")
235 DEFINE_bool(trace_migration, false, "trace object migration")
236 DEFINE_bool(trace_generalization, false, "trace map generalization")
237 DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction")
238 DEFINE_bool(stress_environments, false, "environment for every instruction")
239 DEFINE_int(deopt_every_n_times,
241 "deoptimize every n times a deopt point is passed")
242 DEFINE_int(deopt_every_n_garbage_collections,
244 "deoptimize every n garbage collections")
245 DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing")
246 DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
247 DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining")
248 DEFINE_bool(use_osr, true, "use on-stack replacement")
249 DEFINE_bool(idefs, false, "use informative definitions")
250 DEFINE_bool(array_bounds_checks_elimination, true,
251 "perform array bounds checks elimination")
252 DEFINE_bool(array_index_dehoisting, true,
253 "perform array index dehoisting")
254 DEFINE_bool(dead_code_elimination, true, "use dead code elimination")
255 DEFINE_bool(fold_constants, true, "use constant folding")
256 DEFINE_bool(trace_dead_code_elimination, false, "trace dead code elimination")
257 DEFINE_bool(unreachable_code_elimination, false,
258 "eliminate unreachable code (hidden behind soft deopts)")
259 DEFINE_bool(track_allocation_sites, true,
260 "Use allocation site info to reduce transitions")
261 DEFINE_bool(optimize_constructed_arrays, false,
262 "Use allocation site info on constructed arrays")
263 DEFINE_bool(trace_osr, false, "trace on-stack replacement")
264 DEFINE_int(stress_runs, 0, "number of stress runs")
265 DEFINE_bool(optimize_closures, true, "optimize closures")
266 DEFINE_bool(lookup_sample_by_shared, true,
267 "when picking a function to optimize, watch for shared function "
268 "info, not JSFunction itself")
269 DEFINE_bool(cache_optimized_code, true,
270 "cache optimized code for closures")
271 DEFINE_bool(flush_optimized_code_cache, true,
272 "flushes the cache of optimized code for closures on every GC")
273 DEFINE_bool(inline_construct, true, "inline constructor calls")
274 DEFINE_bool(inline_arguments, true, "inline functions with arguments object")
275 DEFINE_bool(inline_accessors, true, "inline JavaScript accessors")
276 DEFINE_int(loop_weight, 1, "loop weight for representation inference")
278 DEFINE_bool(optimize_for_in, true,
279 "optimize functions containing for-in loops")
280 DEFINE_bool(opt_safe_uint32_operations, true,
281 "allow uint32 values on optimize frames if they are used only in "
284 DEFINE_bool(parallel_recompilation, false,
285 "optimizing hot functions asynchronously on a separate thread")
286 DEFINE_bool(trace_parallel_recompilation, false, "track parallel recompilation")
287 DEFINE_int(parallel_recompilation_queue_length, 3,
288 "the length of the parallel compilation queue")
289 DEFINE_int(parallel_recompilation_delay, 0,
290 "artificial compilation delay in ms")
291 DEFINE_bool(omit_prototype_checks_for_leaf_maps, true,
292 "do not emit prototype checks if all prototypes have leaf maps, "
293 "deoptimize the optimized code if the layout of the maps changes.")
295 // Experimental profiler changes.
296 DEFINE_bool(experimental_profiler, true, "enable all profiler experiments")
297 DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability")
298 DEFINE_int(frame_count, 1, "number of stack frames inspected by the profiler")
299 DEFINE_bool(self_optimization, false,
300 "primitive functions trigger their own optimization")
301 DEFINE_bool(direct_self_opt, false,
302 "call recompile stub directly when self-optimizing")
303 DEFINE_bool(retry_self_opt, false, "re-try self-optimization if it failed")
304 DEFINE_bool(interrupt_at_exit, false,
305 "insert an interrupt check at function exit")
306 DEFINE_bool(weighted_back_edges, false,
307 "weight back edges by jump distance for interrupt triggering")
308 // 0x1700 fits in the immediate field of an ARM instruction.
309 DEFINE_int(interrupt_budget, 0x1700,
310 "execution budget before interrupt is triggered")
311 DEFINE_int(type_info_threshold, 15,
312 "percentage of ICs that must have type info to allow optimization")
313 DEFINE_int(self_opt_count, 130, "call count before self-optimization")
315 DEFINE_implication(experimental_profiler, watch_ic_patching)
316 DEFINE_implication(experimental_profiler, self_optimization)
317 // Not implying direct_self_opt here because it seems to be a bad idea.
318 DEFINE_implication(experimental_profiler, retry_self_opt)
319 DEFINE_implication(experimental_profiler, interrupt_at_exit)
320 DEFINE_implication(experimental_profiler, weighted_back_edges)
322 DEFINE_bool(trace_opt_verbose, false, "extra verbose compilation tracing")
323 DEFINE_implication(trace_opt_verbose, trace_opt)
325 // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
326 DEFINE_bool(debug_code, false,
327 "generate extra code (assertions) for debugging")
328 DEFINE_bool(code_comments, false, "emit comments in code disassembly")
329 DEFINE_bool(enable_sse2, true,
330 "enable use of SSE2 instructions if available")
331 DEFINE_bool(enable_sse3, true,
332 "enable use of SSE3 instructions if available")
333 DEFINE_bool(enable_sse4_1, true,
334 "enable use of SSE4.1 instructions if available")
335 DEFINE_bool(enable_cmov, true,
336 "enable use of CMOV instruction if available")
337 DEFINE_bool(enable_rdtsc, true,
338 "enable use of RDTSC instruction if available")
339 DEFINE_bool(enable_sahf, true,
340 "enable use of SAHF instruction if available (X64 only)")
341 DEFINE_bool(enable_vfp3, ENABLE_VFP3_DEFAULT,
342 "enable use of VFP3 instructions if available")
343 DEFINE_bool(enable_armv7, ENABLE_ARMV7_DEFAULT,
344 "enable use of ARMv7 instructions if available (ARM only)")
345 DEFINE_bool(enable_sudiv, true,
346 "enable use of SDIV and UDIV instructions if available (ARM only)")
347 DEFINE_bool(enable_movw_movt, false,
348 "enable loading 32-bit constant by means of movw/movt "
349 "instruction pairs (ARM only)")
350 DEFINE_bool(enable_unaligned_accesses, true,
351 "enable unaligned accesses for ARMv7 (ARM only)")
352 DEFINE_bool(enable_32dregs, ENABLE_32DREGS_DEFAULT,
353 "enable use of d16-d31 registers on ARM - this requires VFP3")
354 DEFINE_bool(enable_vldr_imm, false,
355 "enable use of constant pools for double immediate (ARM only)")
358 DEFINE_string(expose_natives_as, NULL, "expose natives in global object")
359 DEFINE_string(expose_debug_as, NULL, "expose debug in global object")
360 DEFINE_bool(expose_gc, false, "expose gc extension")
361 DEFINE_string(expose_gc_as,
363 "expose gc extension under the specified name")
364 DEFINE_implication(expose_gc_as, expose_gc)
365 DEFINE_bool(expose_externalize_string, false,
366 "expose externalize string extension")
367 DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture")
368 DEFINE_bool(builtins_in_stack_traces, false,
369 "show built-in functions in stack traces")
370 DEFINE_bool(disable_native_files, false, "disable builtin natives files")
373 DEFINE_bool(inline_new, true, "use fast inline allocation")
376 DEFINE_bool(stack_trace_on_abort, true,
377 "print a stack trace if an assertion failure occurs")
379 // codegen-ia32.cc / codegen-arm.cc
380 DEFINE_bool(trace, false, "trace function calls")
381 DEFINE_bool(mask_constants_with_cookie,
383 "use random jit cookie to mask large constants")
386 DEFINE_bool(lazy, true, "use lazy compilation")
387 DEFINE_bool(trace_opt, false, "trace lazy optimization")
388 DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics")
389 DEFINE_bool(opt, true, "use adaptive optimizations")
390 DEFINE_bool(always_opt, false, "always try to optimize functions")
391 DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt")
392 DEFINE_bool(trace_deopt, false, "trace optimize function deoptimization")
393 DEFINE_bool(trace_stub_failures, false,
394 "trace deoptimization of generated code stubs")
397 DEFINE_int(min_preparse_length, 1024,
398 "minimum length for automatic enable preparsing")
399 DEFINE_bool(always_full_compiler, false,
400 "try to use the dedicated run-once backend for all code")
401 DEFINE_int(max_opt_count, 10,
402 "maximum number of optimization attempts before giving up.")
404 // compilation-cache.cc
405 DEFINE_bool(compilation_cache, true, "enable compilation cache")
407 DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions")
410 DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response")
411 DEFINE_bool(trace_js_array_abuse, false,
412 "trace out-of-bounds accesses to JS arrays")
413 DEFINE_bool(trace_external_array_abuse, false,
414 "trace out-of-bounds-accesses to external arrays")
415 DEFINE_bool(trace_array_abuse, false,
416 "trace out-of-bounds accesses to all arrays")
417 DEFINE_implication(trace_array_abuse, trace_js_array_abuse)
418 DEFINE_implication(trace_array_abuse, trace_external_array_abuse)
419 DEFINE_bool(debugger_auto_break, true,
420 "automatically set the debug break flag when debugger commands are "
422 DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature")
423 DEFINE_bool(break_on_abort, true, "always cause a debug break before aborting")
426 // Slightly less than 1MB on 64-bit, since Windows' default stack size for
427 // the main execution thread is 1MB for both 32 and 64-bit.
428 DEFINE_int(stack_size, kPointerSize * 123,
429 "default size of stack region v8 is allowed to use (in kBytes)")
432 DEFINE_int(max_stack_trace_source_length, 300,
433 "maximum length of function source code printed in a stack trace.")
436 DEFINE_bool(always_inline_smi_code, false,
437 "always inline smi code in non-opt code")
440 DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)")
441 DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)")
442 DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)")
443 DEFINE_bool(gc_global, false, "always perform global GCs")
444 DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
445 DEFINE_bool(trace_gc, false,
446 "print one trace line following each garbage collection")
447 DEFINE_bool(trace_gc_nvp, false,
448 "print one detailed trace line in name=value format "
449 "after each garbage collection")
450 DEFINE_bool(trace_gc_ignore_scavenger, false,
451 "do not print trace line after scavenger collection")
452 DEFINE_bool(print_cumulative_gc_stat, false,
453 "print cumulative GC statistics in name=value format on exit")
454 DEFINE_bool(trace_gc_verbose, false,
455 "print more details following each garbage collection")
456 DEFINE_bool(trace_fragmentation, false,
457 "report fragmentation for old pointer and data pages")
458 DEFINE_bool(trace_external_memory, false,
459 "print amount of external allocated memory after each time "
461 DEFINE_bool(collect_maps, true,
462 "garbage collect maps from which no objects can be reached")
463 DEFINE_bool(weak_embedded_maps_in_optimized_code, false,
464 "make maps embedded in optimized code weak")
465 DEFINE_bool(flush_code, true,
466 "flush code that we expect not to use again (during full gc)")
467 DEFINE_bool(flush_code_incrementally, true,
468 "flush code that we expect not to use again (incrementally)")
469 DEFINE_bool(trace_code_flushing, false, "trace code flushing progress")
470 DEFINE_bool(age_code, true,
471 "track un-executed functions to age code and flush only "
473 DEFINE_bool(incremental_marking, true, "use incremental marking")
474 DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps")
475 DEFINE_bool(trace_incremental_marking, false,
476 "trace progress of the incremental marking")
477 DEFINE_bool(track_gc_object_stats, false,
478 "track object counts and memory usage")
479 DEFINE_bool(parallel_sweeping, true, "enable parallel sweeping")
480 DEFINE_bool(concurrent_sweeping, false, "enable concurrent sweeping")
481 DEFINE_int(sweeper_threads, 0,
482 "number of parallel and concurrent sweeping threads")
483 DEFINE_bool(parallel_marking, false, "enable parallel marking")
484 DEFINE_int(marking_threads, 0, "number of parallel marking threads")
486 DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
490 DEFINE_bool(use_idle_notification, true,
491 "Use idle notification to reduce memory footprint.")
493 DEFINE_bool(use_ic, true, "use inline caching")
495 // macro-assembler-ia32.cc
496 DEFINE_bool(native_code_counters, false,
497 "generate extra code for manipulating stats counters")
500 DEFINE_bool(always_compact, false, "Perform compaction on every full GC")
501 DEFINE_bool(lazy_sweeping, true,
502 "Use lazy sweeping for old pointer and data spaces")
503 DEFINE_bool(never_compact, false,
504 "Never perform compaction on full GC - testing only")
505 DEFINE_bool(compact_code_space, true,
506 "Compact code space on full non-incremental collections")
507 DEFINE_bool(incremental_code_compaction, true,
508 "Compact code space on full incremental collections")
509 DEFINE_bool(cleanup_code_caches_at_gc, true,
510 "Flush inline caches prior to mark compact collection and "
511 "flush code caches in maps during mark compact cycle.")
512 DEFINE_bool(use_marking_progress_bar, true,
513 "Use a progress bar to scan large objects in increments when "
514 "incremental marking is active.")
515 DEFINE_int(random_seed, 0,
516 "Default seed for initializing random generator "
517 "(0, the default, means to use system random).")
520 DEFINE_bool(use_verbose_printer, true, "allows verbose printing")
523 DEFINE_bool(allow_natives_syntax, false, "allow natives syntax")
524 DEFINE_bool(trace_parse, false, "trace parsing and preparsing")
526 // simulator-arm.cc and simulator-mips.cc
527 DEFINE_bool(trace_sim, false, "Trace simulator execution")
528 DEFINE_bool(check_icache, false,
529 "Check icache flushes in ARM and MIPS simulator")
530 DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions")
531 DEFINE_int(sim_stack_alignment, 8,
532 "Stack alingment in bytes in simulator (4 or 8, 8 is default)")
535 DEFINE_bool(abort_on_uncaught_exception, false,
536 "abort program (dump core) when an uncaught exception is thrown")
537 DEFINE_bool(trace_exception, false,
538 "print stack trace when throwing exceptions")
539 DEFINE_bool(preallocate_message_memory, false,
540 "preallocate some memory to build stack traces.")
541 DEFINE_bool(randomize_hashes,
543 "randomize hashes to avoid predictable hash collisions "
544 "(with snapshots this option cannot override the baked-in seed)")
545 DEFINE_int(hash_seed,
547 "Fixed seed to use to hash property keys (0 means random)"
548 "(with snapshots this option cannot override the baked-in seed)")
551 DEFINE_bool(preemption, false,
552 "activate a 100ms timer that switches between V8 threads")
555 DEFINE_bool(regexp_optimization, true, "generate optimized regexp code")
557 // Testing flags test/cctest/test-{flags,api,serialization}.cc
558 DEFINE_bool(testing_bool_flag, true, "testing_bool_flag")
559 DEFINE_int(testing_int_flag, 13, "testing_int_flag")
560 DEFINE_float(testing_float_flag, 2.5, "float-flag")
561 DEFINE_string(testing_string_flag, "Hello, world!", "string-flag")
562 DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness")
564 DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
565 "file in which to testing_serialize heap")
567 DEFINE_string(testing_serialization_file, "/tmp/serdes",
568 "file in which to serialize heap")
572 DEFINE_string(extra_code, NULL, "A filename with extra code to be included in"
573 " the snapshot (mksnapshot only)")
579 DEFINE_bool(help, false, "Print usage message, including flags, on console")
580 DEFINE_bool(dump_counters, false, "Dump counters on exit")
582 #ifdef ENABLE_DEBUGGER_SUPPORT
583 DEFINE_bool(debugger, false, "Enable JavaScript debugger")
584 DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the "
585 "debugger agent in another process")
586 DEFINE_bool(debugger_agent, false, "Enable debugger agent")
587 DEFINE_int(debugger_port, 5858, "Port to use for remote debugging")
588 #endif // ENABLE_DEBUGGER_SUPPORT
590 DEFINE_string(map_counters, "", "Map counters to a file")
591 DEFINE_args(js_arguments, JSARGUMENTS_INIT,
592 "Pass all remaining arguments to the script. Alias for \"--\".")
595 DEFINE_bool(debug_compile_events, false, "Enable debugger compile events")
596 DEFINE_bool(debug_script_collected_events, false,
597 "Enable debugger script collected events")
599 DEFINE_bool(debug_compile_events, true, "Enable debugger compile events")
600 DEFINE_bool(debug_script_collected_events, true,
601 "Enable debugger script collected events")
606 // GDB JIT integration flags.
609 DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)")
610 DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects")
611 DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk")
612 DEFINE_string(gdbjit_dump_filter, "",
613 "dump only objects containing this substring")
616 DEFINE_bool(force_marking_deque_overflows, false,
617 "force overflows of marking deque by reducing it's size "
620 DEFINE_bool(stress_compaction, false,
621 "stress the GC compactor to flush out bugs (implies "
622 "--force_marking_deque_overflows)")
629 #define FLAG FLAG_FULL
631 #define FLAG FLAG_READONLY
635 DEFINE_bool(enable_slow_asserts, false,
636 "enable asserts that are slow to execute")
638 // codegen-ia32.cc / codegen-arm.cc
639 DEFINE_bool(trace_codegen, false,
640 "print name of functions for which code is generated")
641 DEFINE_bool(print_source, false, "pretty print source code")
642 DEFINE_bool(print_builtin_source, false,
643 "pretty print source code for builtins")
644 DEFINE_bool(print_ast, false, "print source AST")
645 DEFINE_bool(print_builtin_ast, false, "print source AST for builtins")
646 DEFINE_string(stop_at, "", "function name where to insert a breakpoint")
649 DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins")
650 DEFINE_bool(print_scopes, false, "print scopes")
653 DEFINE_bool(trace_contexts, false, "trace contexts operations")
656 DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations")
657 DEFINE_bool(gc_verbose, false, "print stuff during garbage collection")
658 DEFINE_bool(heap_stats, false, "report heap statistics before and after GC")
659 DEFINE_bool(code_stats, false, "report code statistics after GC")
660 DEFINE_bool(verify_native_context_separation, false,
661 "verify that code holds on to at most one native context after GC")
662 DEFINE_bool(print_handles, false, "report handles after GC")
663 DEFINE_bool(print_global_handles, false, "report global handles after GC")
666 DEFINE_bool(trace_ic, false, "trace inline cache state transitions")
669 DEFINE_bool(print_interfaces, false, "print interfaces")
670 DEFINE_bool(print_interface_details, false, "print interface inference details")
671 DEFINE_int(print_interface_depth, 5, "depth for printing interfaces")
674 DEFINE_bool(trace_normalization,
676 "prints when objects are turned into dictionaries.")
679 DEFINE_bool(trace_lazy, false, "trace lazy compilation")
682 DEFINE_bool(collect_heap_spill_statistics, false,
683 "report heap spill statistics along with heap_stats "
684 "(requires heap_stats)")
686 DEFINE_bool(trace_isolates, false, "trace isolate state changes")
689 DEFINE_bool(regexp_possessive_quantifier,
691 "enable possessive quantifier syntax for testing")
692 DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution")
693 DEFINE_bool(trace_regexp_assembler,
695 "trace regexp macro assembler calls.")
698 // Logging and profiling flags
701 #define FLAG FLAG_FULL
704 DEFINE_bool(log, false,
705 "Minimal logging (no API, code, GC, suspect, or handles samples).")
706 DEFINE_bool(log_all, false, "Log all events to the log file.")
707 DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.")
708 DEFINE_bool(log_api, false, "Log API events to the log file.")
709 DEFINE_bool(log_code, false,
710 "Log code events to the log file without profiling.")
711 DEFINE_bool(log_gc, false,
712 "Log heap samples on garbage collection for the hp2ps tool.")
713 DEFINE_bool(log_handles, false, "Log global handle events.")
714 DEFINE_bool(log_snapshot_positions, false,
715 "log positions of (de)serialized objects in the snapshot.")
716 DEFINE_bool(log_suspect, false, "Log suspect operations.")
717 DEFINE_bool(prof, false,
718 "Log statistical profiling information (implies --log-code).")
719 DEFINE_bool(prof_auto, true,
720 "Used with --prof, starts profiling automatically")
721 DEFINE_bool(prof_lazy, false,
722 "Used with --prof, only does sampling and logging"
723 " when profiler is active (implies --noprof_auto).")
724 DEFINE_bool(prof_browser_mode, true,
725 "Used with --prof, turns on browser-compatible mode for profiling.")
726 DEFINE_bool(log_regexp, false, "Log regular expression execution.")
727 DEFINE_string(logfile, "v8.log", "Specify the name of the log file.")
728 DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.")
729 DEFINE_string(gc_fake_mmap, "/tmp/__v8_gc__",
730 "Specify the name of the file for fake gc mmap used in ll_prof")
731 DEFINE_bool(log_internal_timer_events, false, "Time internal events.")
732 DEFINE_bool(log_timer_events, false,
733 "Time events including external callbacks.")
734 DEFINE_implication(log_timer_events, log_internal_timer_events)
735 DEFINE_implication(log_internal_timer_events, prof)
738 // Disassembler only flags
741 #ifdef ENABLE_DISASSEMBLER
742 #define FLAG FLAG_FULL
744 #define FLAG FLAG_READONLY
748 DEFINE_bool(trace_elements_transitions, false, "trace elements transitions")
751 DEFINE_bool(print_code_stubs, false, "print code stubs")
752 DEFINE_bool(test_secondary_stub_cache,
754 "test secondary stub cache by disabling the primary one")
756 DEFINE_bool(test_primary_stub_cache,
758 "test primary stub cache by disabling the secondary one")
760 // codegen-ia32.cc / codegen-arm.cc
761 DEFINE_bool(print_code, false, "print generated code")
762 DEFINE_bool(print_opt_code, false, "print optimized code")
763 DEFINE_bool(print_unopt_code, false, "print unoptimized code before "
764 "printing optimized code based on it")
765 DEFINE_bool(print_code_verbose, false, "print more information for code")
766 DEFINE_bool(print_builtin_code, false, "print generated code for builtins")
768 #ifdef ENABLE_DISASSEMBLER
769 DEFINE_bool(print_all_code, false, "enable all flags related to printing code")
770 DEFINE_implication(print_all_code, print_code)
771 DEFINE_implication(print_all_code, print_opt_code)
772 DEFINE_implication(print_all_code, print_unopt_code)
773 DEFINE_implication(print_all_code, print_code_verbose)
774 DEFINE_implication(print_all_code, print_builtin_code)
775 DEFINE_implication(print_all_code, print_code_stubs)
776 DEFINE_implication(print_all_code, code_comments)
778 DEFINE_implication(print_all_code, trace_codegen)
790 #undef DEFINE_implication
792 #undef FLAG_MODE_DECLARE
793 #undef FLAG_MODE_DEFINE
794 #undef FLAG_MODE_DEFINE_DEFAULTS
795 #undef FLAG_MODE_META
796 #undef FLAG_MODE_DEFINE_IMPLICATIONS