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

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

Issue 2735103003: Merged: [wasm] Fix code specialization for empty memory buffer (Closed)
Patch Set: Created 3 years, 9 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-code-specialization.cc ('k') | test/cctest/compiler/test-run-wasm-machops.cc » ('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 5b24d7702e8f13f5232a9706c1ccb6e7c96b90a0..5aae4484c13a541b16a58fc385524760364bd236 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1171,8 +1171,12 @@ class InstantiationHelper {
? static_cast<Address>(
compiled_module_->memory()->backing_store())
: nullptr;
- code_specialization.RelocateMemoryReferences(old_mem_start, old_mem_size,
- mem_start, mem_size);
+ // We might get instantiated again with the same memory. No patching
+ // needed in this case.
+ if (old_mem_start != mem_start || old_mem_size != mem_size) {
+ code_specialization.RelocateMemoryReferences(
+ old_mem_start, old_mem_size, mem_start, mem_size);
+ }
compiled_module_->set_memory(memory_);
}
« no previous file with comments | « src/wasm/wasm-code-specialization.cc ('k') | test/cctest/compiler/test-run-wasm-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698