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 |