33 using namespace v8::internal;
37 CHECK(FLAG_testing_bool_flag);
39 CHECK_EQ(2.5, FLAG_testing_float_flag);
40 CHECK_EQ(0, strcmp(FLAG_testing_string_flag,
"Hello, world!"));
44 static void SetFlagsToDefault() {
58 const char* argv[] = {
"Test2",
"-notesting-bool-flag",
"notaflag",
59 "--testing_int_flag=77",
"-testing_float_flag=.25",
60 "--testing_string_flag",
"no way!" };
62 const_cast<char **>(argv),
65 CHECK(!FLAG_testing_bool_flag);
67 CHECK_EQ(.25, FLAG_testing_float_flag);
68 CHECK_EQ(0, strcmp(FLAG_testing_string_flag,
"no way!"));
75 " -notesting-bool-flag notaflag --testing_int_flag=77 "
76 "-testing_float_flag=.25 "
77 "--testing_string_flag no_way! ";
79 CHECK(!FLAG_testing_bool_flag);
81 CHECK_EQ(.25, FLAG_testing_float_flag);
82 CHECK_EQ(0, strcmp(FLAG_testing_string_flag,
"no_way!"));
90 {
"Test3",
"--testing_bool_flag",
"notaflag",
91 "--testing_int_flag",
"-666",
92 "--testing_float_flag",
"-12E10",
"-testing-string-flag=foo-bar" };
94 const_cast<char **>(argv),
97 CHECK(FLAG_testing_bool_flag);
98 CHECK_EQ(-666, FLAG_testing_int_flag);
99 CHECK_EQ(-12E10, FLAG_testing_float_flag);
100 CHECK_EQ(0, strcmp(FLAG_testing_string_flag,
"foo-bar"));
107 "--testing_bool_flag notaflag --testing_int_flag -666 "
108 "--testing_float_flag -12E10 "
109 "-testing-string-flag=foo-bar";
111 CHECK(FLAG_testing_bool_flag);
112 CHECK_EQ(-666, FLAG_testing_int_flag);
113 CHECK_EQ(-12E10, FLAG_testing_float_flag);
114 CHECK_EQ(0, strcmp(FLAG_testing_string_flag,
"foo-bar"));
121 const char* argv[] = {
"Test4",
"--testing_bool_flag",
"--foo" };
123 const_cast<char **>(argv),
131 const char* str =
"--testing_bool_flag --foo";
139 const char* argv[] = {
"Test5",
"--testing_int_flag=\"foobar\"" };
141 const_cast<char **>(argv),
149 const char* str =
" --testing_int_flag=\"foobar\"";
157 const char* argv[] = {
"Test5",
"--testing-int-flag",
"0",
158 "--testing_float_flag" };
160 const_cast<char **>(argv),
168 const char* str =
" --testing-int-flag 0 --testing_float_flag ";
176 const char* argv[] = {
"TestJSArgs1",
177 "--testing-int-flag",
"42",
178 "--",
"testing-float-flag",
"7"};
180 const_cast<char **>(argv),
182 CHECK_EQ(42, FLAG_testing_int_flag);
183 CHECK_EQ(2.5, FLAG_testing_float_flag);
184 CHECK_EQ(2, FLAG_js_arguments.argc());
185 CHECK_EQ(0, strcmp(FLAG_js_arguments[0],
"testing-float-flag"));
186 CHECK_EQ(0, strcmp(FLAG_js_arguments[1],
"7"));
193 const char* str =
"--testing-int-flag 42 -- testing-float-flag 7";
195 CHECK_EQ(42, FLAG_testing_int_flag);
196 CHECK_EQ(2.5, FLAG_testing_float_flag);
197 CHECK_EQ(2, FLAG_js_arguments.argc());
198 CHECK_EQ(0, strcmp(FLAG_js_arguments[0],
"testing-float-flag"));
199 CHECK_EQ(0, strcmp(FLAG_js_arguments[1],
"7"));
205 const char* str =
"--testing-int-flag 42 --js-arguments testing-float-flag 7";
207 CHECK_EQ(42, FLAG_testing_int_flag);
208 CHECK_EQ(2.5, FLAG_testing_float_flag);
209 CHECK_EQ(2, FLAG_js_arguments.argc());
210 CHECK_EQ(0, strcmp(FLAG_js_arguments[0],
"testing-float-flag"));
211 CHECK_EQ(0, strcmp(FLAG_js_arguments[1],
"7"));
217 const char* str =
"--testing-int-flag 42 --js-arguments=testing-float-flag 7";
219 CHECK_EQ(42, FLAG_testing_int_flag);
220 CHECK_EQ(2.5, FLAG_testing_float_flag);
221 CHECK_EQ(2, FLAG_js_arguments.argc());
222 CHECK_EQ(0, strcmp(FLAG_js_arguments[0],
"testing-float-flag"));
223 CHECK_EQ(0, strcmp(FLAG_js_arguments[1],
"7"));
229 const char* str =
"--testing-int-flag 42 --";
231 CHECK_EQ(42, FLAG_testing_int_flag);
232 CHECK_EQ(0, FLAG_js_arguments.argc());
241 const char* argv[] = {
"",
"--crankshaft",
"--expose-debug-as" };
243 const_cast<char **>(argv),
#define CHECK_EQ(expected, value)
static void ResetAllFlags()
#define CHECK_NE(unexpected, value)
int StrLength(const char *string)
static int SetFlagsFromString(const char *str, int len)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
static int SetFlagsFromCommandLine(int *argc, char **argv, bool remove_flags)