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

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

Issue 1874383002: [wasm] Throw real Error on wasm trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@trapreasons-to-messages
Patch Set: Created 4 years, 8 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
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/wasm/unreachable.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/wasm/unreachable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698