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

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: Addresses comments. 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..d41be53a4e365f3ffb90bdcf16790534a4251fae 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -21,8 +21,7 @@ namespace internal {
RUNTIME_FUNCTION(Runtime_WasmGrowMemory) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
- uint32_t delta_pages = 0;
- CHECK(args[0]->ToUint32(&delta_pages));
+ CONVERT_UINT32_ARG_CHECKED(delta_pages, 0);
Handle<JSObject> module_instance;
{
@@ -118,5 +117,17 @@ 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());
+ CONVERT_SMI_ARG_CHECKED(lower, 0);
+ CONVERT_SMI_ARG_CHECKED(upper, 1);
+
+ const int32_t thrown_value = (upper << 16) | lower;
+
+ 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