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

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

Issue 2378773013: [WASM] Implements catch for the wasm low level exception mechanism. (Closed)
Patch Set: updates effect dependencies. 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..0662f3d7089727692975499aa7da068694ec166f 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_WasmGetCaughtExceptionValue) {
+ 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