Index: src/runtime/runtime-internal.cc |
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc |
index 8a5bdeb60dc1ca292a58db550f0f5332fb94fdab..06d52246769f34c833b4bfd25fa90523dab672c6 100644 |
--- a/src/runtime/runtime-internal.cc |
+++ b/src/runtime/runtime-internal.cc |
@@ -96,6 +96,16 @@ RUNTIME_FUNCTION(Runtime_ThrowStackOverflow) { |
return isolate->StackOverflow(); |
} |
+RUNTIME_FUNCTION(Runtime_ThrowWasmError) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 1); |
Michael Starzinger
2016/04/11 18:13:26
nit: I know we are inconsistent, but lets use "DCH
Clemens Hammacher
2016/04/12 09:33:44
Sure, didn't see that.
|
+ CONVERT_SMI_ARG_CHECKED(message_id, 0); |
+ // TODO(clemensh): discuss with titzer whether a WasmError class would make |
+ // sense here |
+ Handle<Object> exception = isolate->factory()->NewError( |
+ static_cast<MessageTemplate::Template>(message_id)); |
+ return isolate->Throw(*exception); |
Michael Starzinger
2016/04/11 18:13:26
nit: This can also be written as ...
THROW_NEW_ER
Clemens Hammacher
2016/04/12 09:33:44
and that's considered nicer? ;)
but OK, I changed
Michael Starzinger
2016/04/12 10:47:56
We can discuss which version is nicer and change t
|
+} |
RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) { |
SealHandleScope shs(isolate); |