| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // printing / etc in the flag parser code. We only do this for writable flags. | 62 // printing / etc in the flag parser code. We only do this for writable flags. |
| 63 #elif defined(FLAG_MODE_META) | 63 #elif defined(FLAG_MODE_META) |
| 64 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ | 64 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ |
| 65 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt }, | 65 { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt }, |
| 66 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) | 66 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) |
| 67 | 67 |
| 68 #else | 68 #else |
| 69 #error No mode supplied when including flags.defs | 69 #error No mode supplied when including flags.defs |
| 70 #endif | 70 #endif |
| 71 | 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 |
| 72 #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) | 88 #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) |
| 73 #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt) | 89 #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt) |
| 74 #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) | 90 #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) |
| 75 #define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, 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) |
| 76 | 93 |
| 77 // | 94 // |
| 78 // Flags in all modes. | 95 // Flags in all modes. |
| 79 // | 96 // |
| 80 #define FLAG FLAG_FULL | 97 #define FLAG FLAG_FULL |
| 81 | 98 |
| 82 // assembler-ia32.cc / assembler-arm.cc | 99 // assembler-ia32.cc / assembler-arm.cc |
| 83 DEFINE_bool(debug_code, false, | 100 DEFINE_bool(debug_code, false, |
| 84 "generate extra code (comments, assertions) for debugging") | 101 "generate extra code (comments, assertions) for debugging") |
| 85 DEFINE_bool(emit_branch_hints, false, "emit branch hints") | 102 DEFINE_bool(emit_branch_hints, false, "emit branch hints") |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 DEFINE_string(testing_serialization_file, "/tmp/serdes", | 212 DEFINE_string(testing_serialization_file, "/tmp/serdes", |
| 196 "file in which to serialize heap") | 213 "file in which to serialize heap") |
| 197 #endif | 214 #endif |
| 198 | 215 |
| 199 // | 216 // |
| 200 // Dev shell flags | 217 // Dev shell flags |
| 201 // | 218 // |
| 202 | 219 |
| 203 DEFINE_bool(help, false, "Print usage message, including flags, on console") | 220 DEFINE_bool(help, false, "Print usage message, including flags, on console") |
| 204 DEFINE_bool(dump_counters, false, "Dump counters on exit") | 221 DEFINE_bool(dump_counters, false, "Dump counters on exit") |
| 222 DEFINE_args(js_arguments, JSArguments(), |
| 223 "Pass all remaining arguments to the script. Alias for \"--\".") |
| 205 | 224 |
| 206 // | 225 // |
| 207 // Debug only flags | 226 // Debug only flags |
| 208 // | 227 // |
| 209 #undef FLAG | 228 #undef FLAG |
| 210 #ifdef DEBUG | 229 #ifdef DEBUG |
| 211 #define FLAG FLAG_FULL | 230 #define FLAG FLAG_FULL |
| 212 #else | 231 #else |
| 213 #define FLAG FLAG_READONLY | 232 #define FLAG FLAG_READONLY |
| 214 #endif | 233 #endif |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 #undef FLAG | 337 #undef FLAG |
| 319 | 338 |
| 320 #undef DEFINE_bool | 339 #undef DEFINE_bool |
| 321 #undef DEFINE_int | 340 #undef DEFINE_int |
| 322 #undef DEFINE_string | 341 #undef DEFINE_string |
| 323 | 342 |
| 324 #undef FLAG_MODE_DECLARE | 343 #undef FLAG_MODE_DECLARE |
| 325 #undef FLAG_MODE_DEFINE | 344 #undef FLAG_MODE_DEFINE |
| 326 #undef FLAG_MODE_DEFINE_DEFAULTS | 345 #undef FLAG_MODE_DEFINE_DEFAULTS |
| 327 #undef FLAG_MODE_META | 346 #undef FLAG_MODE_META |
| OLD | NEW |