Chromium Code Reviews| Index: test/cctest/interpreter/generate-bytecode-expectations.cc |
| diff --git a/test/cctest/interpreter/generate-bytecode-expectations.cc b/test/cctest/interpreter/generate-bytecode-expectations.cc |
| index 1a09ac62c105432262f082e80f28e1f5a283a7b2..553834ee9c476516d61db287d031a76c52c8a5aa 100644 |
| --- a/test/cctest/interpreter/generate-bytecode-expectations.cc |
| +++ b/test/cctest/interpreter/generate-bytecode-expectations.cc |
| @@ -32,6 +32,8 @@ class ProgramOptions final { |
| wrap_(true), |
| execute_(true), |
| top_level_(false), |
| + legacy_const_(false), |
| + do_expressions_(false), |
| const_pool_type_( |
| BytecodeExpectationsPrinter::ConstantPoolType::kMixed) {} |
| @@ -50,6 +52,8 @@ class ProgramOptions final { |
| bool wrap() const { return wrap_; } |
| bool execute() const { return execute_; } |
| bool top_level() const { return top_level_; } |
| + bool legacy_const() const { return legacy_const_; } |
| + bool do_expressions() const { return do_expressions_; } |
| BytecodeExpectationsPrinter::ConstantPoolType const_pool_type() const { |
| return const_pool_type_; |
| } |
| @@ -66,6 +70,8 @@ class ProgramOptions final { |
| bool wrap_; |
| bool execute_; |
| bool top_level_; |
| + bool legacy_const_; |
| + bool do_expressions_; |
| BytecodeExpectationsPrinter::ConstantPoolType const_pool_type_; |
| std::string input_filename_; |
| std::string output_filename_; |
| @@ -159,6 +165,10 @@ ProgramOptions ProgramOptions::FromCommandLine(int argc, char** argv) { |
| options.execute_ = false; |
| } else if (strcmp(argv[i], "--top-level") == 0) { |
| options.top_level_ = true; |
| + } else if (strcmp(argv[i], "--legacy-const") == 0) { |
| + options.legacy_const_ = true; |
| + } else if (strcmp(argv[i], "--do-expressions") == 0) { |
| + options.do_expressions_ = true; |
| } else if (strncmp(argv[i], "--output=", 9) == 0) { |
| options.output_filename_ = argv[i] + 9; |
| } else if (strncmp(argv[i], "--test-function-name=", 21) == 0) { |
| @@ -233,6 +243,10 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) { |
| test_function_name_ = line.c_str() + 20; |
| } else if (line.compare(0, 11, "top level: ") == 0) { |
| top_level_ = ParseBoolean(line.c_str() + 11); |
| + } else if (line.compare(0, 14, "legacy const: ") == 0) { |
| + legacy_const_ = ParseBoolean(line.c_str() + 14); |
| + } else if (line.compare(0, 16, "do expressions: ") == 0) { |
| + do_expressions_ = ParseBoolean(line.c_str() + 16); |
| } else if (line == "---") { |
| break; |
| } else if (line.empty()) { |
| @@ -256,6 +270,8 @@ void ProgramOptions::PrintHeader(std::ostream& stream) const { // NOLINT |
| } |
| if (top_level_) stream << "\ntop level: yes"; |
| + if (legacy_const_) stream << "\nlegacy const: yes"; |
| + if (do_expressions_) stream << "\ndo expressions: yes"; |
| stream << "\n\n"; |
| } |
| @@ -362,6 +378,9 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT |
| printer.set_test_function_name(options.test_function_name()); |
| } |
| + if (options.legacy_const()) i::FLAG_legacy_const = true; |
| + if (options.do_expressions()) i::FLAG_harmony_do_expressions = true; |
| + |
| stream << "#\n# Autogenerated by generate-bytecode-expectations\n#\n\n"; |
| options.PrintHeader(stream); |
| for (const std::string& snippet : snippet_list) { |
| @@ -384,6 +403,8 @@ void PrintUsage(const char* exec_path) { |
| " --test-function-name=foo " |
| "Specify the name of the test function.\n" |
| " --top-level Process top level code, not the top-level function." |
| + " --legacy-const Flip legacy_const flag.\n" |
|
rmcilroy
2016/02/19 14:22:18
/s/Flip/Enable the/
Stefano Sanfilippo
2016/02/19 14:35:01
Done.
|
| + " --do-expressions Flip harmony_do_expressions flag.\n" |
|
rmcilroy
2016/02/19 14:22:18
ditto
Stefano Sanfilippo
2016/02/19 14:35:01
Done.
|
| " --output=file.name\n" |
| " Specify the output file. If not specified, output goes to " |
| "stdout.\n" |