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

Unified Diff: src/api.cc

Issue 2526703002: [wasm] [asmjs] Route asm.js warnings to the dev console. (Closed)
Patch Set: fix Created 4 years, 1 month 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
« include/v8.h ('K') | « src/api.h ('k') | src/asmjs/asm-js.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index a9a17b458bb45330d0a903598b181c51decb5c30..b3a5c49a103c8dc3661b8c0ba643603ce89c181a 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -399,6 +399,18 @@ void Utils::ReportOOMFailure(const char* location, bool is_heap_oom) {
isolate->SignalFatalError();
}
+void Utils::ReportAsmJsWarning(i::Handle<i::JSMessageObject> message) {
+ i::Isolate* isolate = i::Isolate::Current();
+ AsmJsWarningCallback asmjs_warning_callback =
+ isolate->asmjs_warning_behavior();
+ if (asmjs_warning_callback == nullptr) {
+ v8::internal::PrintF(
+ "%s\n", i::MessageHandler::GetLocalizedMessage(isolate, message).get());
+ } else {
+ asmjs_warning_callback(MessageToLocal(message));
+ }
+}
+
static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) {
if (isolate->has_scheduled_exception()) {
return isolate->scheduled_exception() ==
@@ -8424,6 +8436,11 @@ void Isolate::SetOOMErrorHandler(OOMErrorCallback that) {
isolate->set_oom_behavior(that);
}
+void Isolate::SetAsmJsWarningHandler(AsmJsWarningCallback that) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ isolate->set_asmjs_warning_behavior(that);
+}
+
void Isolate::SetAllowCodeGenerationFromStringsCallback(
AllowCodeGenerationFromStringsCallback callback) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
« include/v8.h ('K') | « src/api.h ('k') | src/asmjs/asm-js.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698