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

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

Issue 2438673006: [wasm] GrowMemory should update imported memory objects. (Closed)
Patch Set: Improve test Created 4 years, 2 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/wasm/wasm-js.cc ('k') | test/mjsunit/wasm/import-memory.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index e789982ba8b58b75f469cab1f7d1dd7d11a849d7..b37d93c828118fd0f0d031d540537b6327476bb1 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1906,6 +1906,12 @@ int32_t wasm::GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance,
Handle<FixedArray> code_table = GetCompiledModule(*instance)->code_table();
RelocateMemoryReferencesInCode(code_table, old_mem_start, new_mem_start,
old_size, new_size);
+ Handle<Object> memory_object(instance->GetInternalField(kWasmMemObject),
+ isolate);
+ if (!memory_object->IsUndefined(isolate)) {
+ WasmJs::SetWasmMemoryArrayBuffer(isolate, memory_object, buffer);
+ }
+
DCHECK(old_size % WasmModule::kPageSize == 0);
return (old_size / WasmModule::kPageSize);
}
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | test/mjsunit/wasm/import-memory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698