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

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

Issue 2264913002: [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 4 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/runtime/runtime-test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
index fc9ae22b8f1e85ced35db27d506927fddf301992..b5910e4d3b25740cf4c7fcba957451731ca5cb4f 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -86,6 +86,10 @@ RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) {
DCHECK_EQ(args.length(), 4);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
+ Handle<JSReceiver> stdlib;
+ if (args[1]->IsJSReceiver()) {
+ stdlib = args.at<JSReceiver>(1);
+ }
Handle<JSObject> foreign;
if (args[2]->IsJSObject()) {
foreign = args.at<i::JSObject>(2);
@@ -94,9 +98,9 @@ RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) {
if (args[3]->IsJSArrayBuffer()) {
memory = args.at<i::JSArrayBuffer>(3);
}
- if (args[1]->IsJSObject() && function->shared()->HasAsmWasmData() &&
+ if (function->shared()->HasAsmWasmData() &&
AsmJs::IsStdlibValid(isolate, handle(function->shared()->asm_wasm_data()),
- args.at<JSReceiver>(1))) {
+ stdlib)) {
MaybeHandle<Object> result;
result = AsmJs::InstantiateAsmWasm(
isolate, handle(function->shared()->asm_wasm_data()), memory, foreign);
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698