00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #if defined(FLAG_MODE_DECLARE)
00040 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
00041 extern ctype FLAG_##nam;
00042 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
00043 static ctype const FLAG_##nam = def;
00044
00045
00046
00047 #elif defined(FLAG_MODE_DEFINE)
00048 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
00049 ctype FLAG_##nam = def;
00050 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
00051
00052
00053
00054
00055 #elif defined(FLAG_MODE_DEFINE_DEFAULTS)
00056 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
00057 static ctype const FLAGDEFAULT_##nam = def;
00058 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
00059
00060
00061
00062
00063 #elif defined(FLAG_MODE_META)
00064 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \
00065 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt },
00066 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
00067
00068 #else
00069 #error No mode supplied when including flags.defs
00070 #endif
00071
00072 #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
00073 #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
00074 #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt)
00075 #define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt)
00076
00077
00078
00079
00080 #define FLAG FLAG_FULL
00081
00082
00083 DEFINE_bool(debug_code, false,
00084 "generate extra code (comments, assertions) for debugging")
00085 DEFINE_bool(emit_branch_hints, false, "emit branch hints")
00086 DEFINE_bool(push_pop_elimination, true,
00087 "eliminate redundant push/pops in assembly code")
00088 DEFINE_bool(print_push_pop_elimination, false,
00089 "print elimination of redundant push/pops in assembly code")
00090
00091
00092 DEFINE_string(expose_natives_as, NULL, "expose natives in global object")
00093 DEFINE_string(expose_debug_as, NULL, "expose debug in global object")
00094 DEFINE_string(natives_file, NULL, "alternative natives file")
00095 DEFINE_bool(expose_gc, false, "expose gc extension")
00096
00097
00098 DEFINE_bool(inline_new, true, "use fast inline allocation")
00099
00100
00101 DEFINE_bool(stack_trace_on_abort, true,
00102 "print a stack trace if an assertion failure occurs")
00103
00104
00105 DEFINE_bool(trace, false, "trace function calls")
00106 DEFINE_bool(defer_negation, true, "defer negation operation")
00107 DEFINE_bool(check_stack, true,
00108 "check stack for overflow, interrupt, breakpoint")
00109
00110
00111 DEFINE_bool(lazy, true, "use lazy compilation")
00112 DEFINE_bool(debug_info, true, "add debug information to compiled functions")
00113
00114
00115 DEFINE_bool(strict, false, "strict error checking")
00116 DEFINE_int(min_preparse_length, 1024,
00117 "Minimum length for automatic enable preparsing")
00118
00119
00120 DEFINE_bool(remote_debugging, false, "enable remote debugging")
00121 DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response")
00122
00123
00124 DEFINE_bool(call_regexp, false, "allow calls to RegExp objects")
00125
00126
00127 DEFINE_int(max_stack_trace_source_length, 300,
00128 "maximum length of function source code printed in a stack trace.")
00129
00130
00131 DEFINE_int(new_space_size, 0, "size of (each semispace in) the new generation")
00132 DEFINE_int(old_space_size, 0, "size of the old generation")
00133 DEFINE_bool(gc_global, false, "always perform global GCs")
00134 DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
00135 DEFINE_bool(trace_gc, false,
00136 "print one trace line following each garbage collection")
00137 DEFINE_bool(collect_maps, true,
00138 "garbage collect maps from which no objects can be reached")
00139
00140
00141 DEFINE_bool(use_ic, true, "use inline caching")
00142
00143
00144 DEFINE_bool(native_code_counters, false,
00145 "generate extra code for manipulating stats counters")
00146
00147
00148 DEFINE_bool(always_compact, false, "Perform compaction on every full GC")
00149 DEFINE_bool(never_compact, false,
00150 "Never perform compaction on full GC - testing only")
00151 DEFINE_bool(cleanup_ics_at_gc, true,
00152 "Flush inline caches prior to mark compact collection.")
00153 DEFINE_bool(cleanup_caches_in_maps_at_gc, true,
00154 "Flush code caches in maps during mark compact cycle.")
00155
00156 DEFINE_bool(canonicalize_object_literal_maps, true,
00157 "Canonicalize maps for object literals.")
00158
00159
00160 DEFINE_bool(h, false, "print this message")
00161
00162
00163 DEFINE_bool(allow_natives_syntax, false, "allow natives syntax")
00164
00165
00166 DEFINE_bool(optimize_ast, true, "optimize the ast")
00167
00168
00169 DEFINE_bool(trace_sim, false, "trace simulator execution")
00170 DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions")
00171
00172
00173 DEFINE_bool(trace_exception, false,
00174 "print stack trace when throwing exceptions")
00175 DEFINE_bool(preallocate_message_memory, false,
00176 "preallocate some memory to build stack traces.")
00177
00178
00179 DEFINE_bool(usage_computation, true, "compute variable usage counts")
00180
00181
00182 DEFINE_bool(preemption, false,
00183 "activate a 100ms timer that switches between V8 threads")
00184
00185
00186 DEFINE_bool(testing_bool_flag, true, "testing_bool_flag")
00187 DEFINE_int(testing_int_flag, 13, "testing_int_flag")
00188 DEFINE_float(testing_float_flag, 2.5, "float-flag")
00189 DEFINE_string(testing_string_flag, "Hello, world!", "string-flag")
00190 DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness")
00191 #ifdef WIN32
00192 DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes",
00193 "file in which to testing_serialize heap")
00194 #else
00195 DEFINE_string(testing_serialization_file, "/tmp/serdes",
00196 "file in which to serialize heap")
00197 #endif
00198
00199
00200
00201
00202
00203 DEFINE_bool(dump_counters, false, "Dump counters on exit")
00204
00205
00206
00207
00208 #undef FLAG
00209 #ifdef DEBUG
00210 #define FLAG FLAG_FULL
00211 #else
00212 #define FLAG FLAG_READONLY
00213 #endif
00214
00215
00216 DEFINE_bool(enable_slow_asserts, false,
00217 "enable asserts that are slow to execute")
00218
00219
00220 DEFINE_bool(print_code_stubs, false, "print code stubs")
00221
00222
00223 DEFINE_bool(trace_codegen, false,
00224 "print name of functions for which code is generated")
00225 DEFINE_bool(print_builtin_code, false, "print generated code for builtins")
00226 DEFINE_bool(print_source, false, "pretty print source code")
00227 DEFINE_bool(print_builtin_source, false,
00228 "pretty print source code for builtins")
00229 DEFINE_bool(print_ast, false, "print source AST")
00230 DEFINE_bool(print_builtin_ast, false, "print source AST for builtins")
00231 DEFINE_bool(trace_calls, false, "trace calls")
00232 DEFINE_bool(trace_builtin_calls, false, "trace builtins calls")
00233 DEFINE_string(stop_at, "", "function name where to insert a breakpoint")
00234
00235
00236 DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins")
00237 DEFINE_bool(print_scopes, false, "print scopes")
00238
00239
00240 DEFINE_bool(trace_contexts, false, "trace contexts operations")
00241
00242
00243 DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations")
00244 DEFINE_bool(gc_verbose, false, "print stuff during garbage collection")
00245 DEFINE_bool(heap_stats, false, "report heap statistics before and after GC")
00246 DEFINE_bool(code_stats, false, "report code statistics after GC")
00247 DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
00248 DEFINE_bool(print_handles, false, "report handles after GC")
00249 DEFINE_bool(print_global_handles, false, "report global handles after GC")
00250 DEFINE_bool(print_rset, false, "print remembered sets before GC")
00251
00252
00253 DEFINE_bool(trace_ic, false, "trace inline cache state transitions")
00254
00255
00256 DEFINE_bool(trace_normalization,
00257 false,
00258 "prints when objects are turned into dictionaries.")
00259
00260
00261 DEFINE_bool(trace_lazy, false, "trace lazy compilation")
00262
00263
00264 DEFINE_bool(debug_serialization, false,
00265 "write debug information into the snapshot.")
00266
00267
00268 DEFINE_bool(collect_heap_spill_statistics, false,
00269 "report heap spill statistics along with heap_stats "
00270 "(requires heap_stats)")
00271
00272
00273
00274
00275 #undef FLAG
00276 #ifdef ENABLE_LOGGING_AND_PROFILING
00277 #define FLAG FLAG_FULL
00278 #else
00279 #define FLAG FLAG_READONLY
00280 #endif
00281
00282
00283 DEFINE_bool(log, false,
00284 "Minimal logging (no API, code, GC, suspect, or handles samples).")
00285 DEFINE_bool(log_all, false, "Log all events to the log file.")
00286 DEFINE_bool(log_api, false, "Log API events to the log file.")
00287 DEFINE_bool(log_code, false,
00288 "Log code events to the log file without profiling.")
00289 DEFINE_bool(log_gc, false,
00290 "Log heap samples on garbage collection for the hp2ps tool.")
00291 DEFINE_bool(log_handles, false, "Log global handle events.")
00292 DEFINE_bool(log_state_changes, false, "Log state changes.")
00293 DEFINE_bool(log_suspect, false, "Log suspect operations.")
00294 DEFINE_bool(prof, false,
00295 "Log statistical profiling information (implies --log-code).")
00296 DEFINE_bool(log_regexp, false, "Log regular expression execution.")
00297 DEFINE_bool(sliding_state_window, false,
00298 "Update sliding state window counters.")
00299 DEFINE_string(logfile, "v8.log", "Specify the name of the log file.")
00300
00301
00302
00303
00304 #undef FLAG
00305 #ifdef ENABLE_DISASSEMBLER
00306 #define FLAG FLAG_FULL
00307 #else
00308 #define FLAG FLAG_READONLY
00309 #endif
00310
00311
00312 DEFINE_bool(print_code, false, "print generated code")
00313
00314
00315 #undef FLAG_FULL
00316 #undef FLAG_READONLY
00317 #undef FLAG
00318
00319 #undef DEFINE_bool
00320 #undef DEFINE_int
00321 #undef DEFINE_string
00322
00323 #undef FLAG_MODE_DECLARE
00324 #undef FLAG_MODE_DEFINE
00325 #undef FLAG_MODE_DEFINE_DEFAULTS
00326 #undef FLAG_MODE_META