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

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

Issue 2636803002: [wasm] Internal Instantiate function should not take memory as an arg from wasm (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index f2c630dd4a52f4f6c0a9376811f9d0da9251e28e..617611b8a8ecc3e8875a301c44075848f4ff2b93 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -195,7 +195,6 @@ MaybeLocal<Value> InstantiateModuleImpl(
// are the same. If that changes later, we refactor the consts into
// parameters.
static const int kFfiOffset = 1;
- static const int kMemOffset = 2;
MaybeLocal<Value> nothing;
i::Handle<i::JSReceiver> ffi = i::Handle<i::JSObject>::null();
@@ -212,26 +211,8 @@ MaybeLocal<Value> InstantiateModuleImpl(
ffi = i::Handle<i::JSReceiver>::cast(v8::Utils::OpenHandle(*obj));
}
- // The memory argument is a legacy, not spec - compliant artifact.
- i::Handle<i::JSArrayBuffer> memory = i::Handle<i::JSArrayBuffer>::null();
- if (args.Length() > kMemOffset && !args[kMemOffset]->IsUndefined()) {
- if (!args[kMemOffset]->IsObject()) {
- thrower->TypeError("Argument %d must be a WebAssembly.Memory",
- kMemOffset);
- return nothing;
- }
- Local<Object> obj = Local<Object>::Cast(args[kMemOffset]);
- i::Handle<i::Object> mem_obj = v8::Utils::OpenHandle(*obj);
- if (!i::WasmJs::IsWasmMemoryObject(i_isolate, mem_obj)) {
- thrower->TypeError("Argument %d must be a WebAssembly.Memory",
- kMemOffset);
- return nothing;
- }
- memory = i::Handle<i::JSArrayBuffer>(
- i::Handle<i::WasmMemoryObject>::cast(mem_obj)->buffer(), i_isolate);
- }
- i::MaybeHandle<i::JSObject> instance = i::wasm::WasmModule::Instantiate(
- i_isolate, thrower, i_module_obj, ffi, memory);
+ i::MaybeHandle<i::JSObject> instance =
+ i::wasm::WasmModule::Instantiate(i_isolate, thrower, i_module_obj, ffi);
if (instance.is_null()) {
if (!thrower->error())
thrower->RuntimeError("Could not instantiate module");
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698