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 bc0045a2c5be7f1937c003e7b394f8ab4e7b6673..64a680ab19730ad91ff589ad0fb5cddb7b8bbc6a 100644 |
--- a/test/cctest/interpreter/generate-bytecode-expectations.cc |
+++ b/test/cctest/interpreter/generate-bytecode-expectations.cc |
@@ -22,6 +22,8 @@ |
using v8::internal::interpreter::BytecodeExpectationsPrinter; |
#define REPORT_ERROR(MESSAGE) (((std::cerr << "ERROR: ") << MESSAGE) << '\n') |
+#define REPORT_WARNING(MESSAGE) \ |
+ (((std::cerr << "WARNING: ") << MESSAGE) << '\n') |
namespace { |
@@ -43,9 +45,7 @@ class ProgramOptions final { |
execute_(true), |
top_level_(false), |
do_expressions_(false), |
- verbose_(false), |
- const_pool_type_( |
- BytecodeExpectationsPrinter::ConstantPoolType::kMixed) {} |
+ verbose_(false) {} |
bool Validate() const; |
void UpdateFromHeader(std::istream& stream); // NOLINT |
@@ -65,9 +65,6 @@ class ProgramOptions final { |
bool do_expressions() const { return do_expressions_; } |
bool verbose() const { return verbose_; } |
bool suppress_runtime_errors() const { return rebaseline_ && !verbose_; } |
- BytecodeExpectationsPrinter::ConstantPoolType const_pool_type() const { |
- return const_pool_type_; |
- } |
std::vector<std::string> input_filenames() const { return input_filenames_; } |
std::string output_filename() const { return output_filename_; } |
std::string test_function_name() const { return test_function_name_; } |
@@ -83,7 +80,6 @@ class ProgramOptions final { |
bool top_level_; |
bool do_expressions_; |
bool verbose_; |
- BytecodeExpectationsPrinter::ConstantPoolType const_pool_type_; |
std::vector<std::string> input_filenames_; |
std::string output_filename_; |
std::string test_function_name_; |
@@ -105,33 +101,6 @@ class V8InitializationScope final { |
DISALLOW_COPY_AND_ASSIGN(V8InitializationScope); |
}; |
-BytecodeExpectationsPrinter::ConstantPoolType ParseConstantPoolType( |
- const char* type_string) { |
- if (strcmp(type_string, "number") == 0) { |
- return BytecodeExpectationsPrinter::ConstantPoolType::kNumber; |
- } else if (strcmp(type_string, "string") == 0) { |
- return BytecodeExpectationsPrinter::ConstantPoolType::kString; |
- } else if (strcmp(type_string, "mixed") == 0) { |
- return BytecodeExpectationsPrinter::ConstantPoolType::kMixed; |
- } |
- return BytecodeExpectationsPrinter::ConstantPoolType::kUnknown; |
-} |
- |
-const char* ConstantPoolTypeToString( |
- BytecodeExpectationsPrinter::ConstantPoolType type) { |
- switch (type) { |
- case BytecodeExpectationsPrinter::ConstantPoolType::kNumber: |
- return "number"; |
- case BytecodeExpectationsPrinter::ConstantPoolType::kMixed: |
- return "mixed"; |
- case BytecodeExpectationsPrinter::ConstantPoolType::kString: |
- return "string"; |
- default: |
- UNREACHABLE(); |
- return nullptr; |
- } |
-} |
- |
bool ParseBoolean(const char* string) { |
if (strcmp(string, "yes") == 0) { |
return true; |
@@ -187,8 +156,6 @@ ProgramOptions ProgramOptions::FromCommandLine(int argc, char** argv) { |
options.print_help_ = true; |
} else if (strcmp(argv[i], "--raw-js") == 0) { |
options.read_raw_js_snippet_ = true; |
- } else if (strncmp(argv[i], "--pool-type=", 12) == 0) { |
- options.const_pool_type_ = ParseConstantPoolType(argv[i] + 12); |
} else if (strcmp(argv[i], "--stdin") == 0) { |
options.read_from_stdin_ = true; |
} else if (strcmp(argv[i], "--rebaseline") == 0) { |
@@ -238,12 +205,6 @@ bool ProgramOptions::Validate() const { |
if (parsing_failed_) return false; |
if (print_help_) return true; |
- if (const_pool_type_ == |
- BytecodeExpectationsPrinter::ConstantPoolType::kUnknown) { |
- REPORT_ERROR("Unknown constant pool type."); |
- return false; |
- } |
- |
if (!read_from_stdin_ && input_filenames_.empty()) { |
REPORT_ERROR("No input file specified."); |
return false; |
@@ -294,7 +255,7 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) { |
while (std::getline(stream, line)) { |
if (line.compare(0, 11, "pool type: ") == 0) { |
- const_pool_type_ = ParseConstantPoolType(line.c_str() + 11); |
+ REPORT_WARNING("Pool types are deprecated"); |
rmcilroy
2016/09/06 15:28:57
Just drop this branch entirely - there shouldn't b
|
} else if (line.compare(0, 9, "execute: ") == 0) { |
execute_ = ParseBoolean(line.c_str() + 9); |
} else if (line.compare(0, 6, "wrap: ") == 0) { |
@@ -318,8 +279,6 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) { |
void ProgramOptions::PrintHeader(std::ostream& stream) const { // NOLINT |
stream << "---" |
- "\npool type: " |
- << ConstantPoolTypeToString(const_pool_type_) |
<< "\nexecute: " << BooleanToString(execute_) |
<< "\nwrap: " << BooleanToString(wrap_); |
@@ -424,8 +383,7 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT |
v8::Local<v8::Context> context = v8::Context::New(platform.isolate()); |
v8::Context::Scope context_scope(context); |
- BytecodeExpectationsPrinter printer(platform.isolate(), |
- options.const_pool_type()); |
+ BytecodeExpectationsPrinter printer(platform.isolate()); |
printer.set_wrap(options.wrap()); |
printer.set_execute(options.execute()); |
printer.set_top_level(options.top_level()); |