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

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

Issue 2339053003: [V8][Wasm] Wasm throws. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Passes 2 Smis to the runtime function that will perform the throw. 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
« no previous file with comments | « src/runtime/runtime.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-wasm.cc
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc
index 02073b77a090cdf1bc382d7d2b1c32f2f297f8cb..6f10db23ad9fb2bcb4d5a28b1e5d509563658562 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -118,5 +118,18 @@ RUNTIME_FUNCTION(Runtime_WasmThrowTypeError) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kWasmTrapTypeError));
}
+
+RUNTIME_FUNCTION(Runtime_WasmThrow) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(2, args.length());
+ Object* upper = args[1];
+ Object* lower = args[0];
Michael Starzinger 2016/09/15 12:33:36 nit: Please use CONVERT_SMI_ARG_CHECKED here.
John 2016/09/15 12:42:05 Done.
+
+ const int32_t thrown_value =
+ (Smi::cast(upper)->value() << 16) | Smi::cast(lower)->value();
+
+ return isolate->Throw(*isolate->factory()->NewNumberFromInt(thrown_value));
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698