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

Unified Diff: src/runtime/runtime-wasm.cc

Issue 2275293002: [WASM] Implements catch for the wasm low level exception mechanism. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Git pull Created 4 years, 3 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
Index: src/runtime/runtime-wasm.cc
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc
index d41be53a4e365f3ffb90bdcf16790534a4251fae..e3c4e549a0fa8e640420ebc72324c2ca1613ee4a 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -129,5 +129,16 @@ RUNTIME_FUNCTION(Runtime_WasmThrow) {
return isolate->Throw(*isolate->factory()->NewNumberFromInt(thrown_value));
}
+RUNTIME_FUNCTION(Runtime_WasmCatch) {
titzer 2016/09/28 17:09:14 Can we name this Runtime_WasmGetCaughtExceptionVal
John 2016/09/29 13:28:31 Done.
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+ Object* exception = args[0];
+ // The unwinder will only deliver exceptions to wasm if the exception is a
+ // Number or a Smi (which we have just converted to a Number.) This logic
+ // lives in Isolate::is_catchable_by_wasm(Object*).
+ CHECK(exception->IsNumber());
+ return exception;
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698