Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: test/cctest/interpreter/generate-bytecode-expectations.cc

Issue 1742723003: [Interpreter] Silence runtime errors in generate-bytecode-expectations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make the suppression condition more readable. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0c9874020bdb5a2a138348941591c7c7695839e3..9d73b325a6ef34bdffea330b7768f9a446d19e6a 100644
--- a/test/cctest/interpreter/generate-bytecode-expectations.cc
+++ b/test/cctest/interpreter/generate-bytecode-expectations.cc
@@ -67,6 +67,7 @@ class ProgramOptions final {
bool legacy_const() const { return legacy_const_; }
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_;
}
@@ -484,6 +485,12 @@ bool WriteExpectationsFile(const std::vector<std::string>& snippet_list,
return true;
}
+void PrintMessage(v8::Local<v8::Message> message, v8::Local<v8::Value>) {
+ std::cerr << "INFO: " << *v8::String::Utf8Value(message->Get()) << '\n';
+}
+
+void DiscardMessage(v8::Local<v8::Message>, v8::Local<v8::Value>) {}
+
void PrintUsage(const char* exec_path) {
std::cerr
<< "\nUsage: " << exec_path
@@ -528,6 +535,8 @@ int main(int argc, char** argv) {
}
V8InitializationScope platform(argv[0]);
+ platform.isolate()->AddMessageListener(
+ options.suppress_runtime_errors() ? DiscardMessage : PrintMessage);
std::vector<std::string> snippet_list;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698