Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index 48f9a9a18364157a77769d60dc2d9564155ec8fa..97bdca2387daf1e6bedab49c681e27c7c4f8bffb 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -122,6 +122,11 @@ Address RelocInfo::wasm_memory_reference() { |
return Memory::Address_at(pc_); |
} |
+Address RelocInfo::wasm_global_reference() { |
+ DCHECK(IsWasmGlobalReference(rmode_)); |
+ return Memory::Address_at(pc_); |
+} |
+ |
uint32_t RelocInfo::wasm_memory_size_reference() { |
DCHECK(IsWasmMemorySizeReference(rmode_)); |
return Memory::uint32_at(pc_); |
@@ -154,6 +159,19 @@ void RelocInfo::update_wasm_memory_reference( |
} |
} |
+void RelocInfo::update_wasm_global_reference( |
+ Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) { |
+ DCHECK(IsWasmGlobalReference(rmode_)); |
+ Address updated_reference; |
+ DCHECK(old_base <= wasm_global_reference()); |
+ updated_reference = new_base + (wasm_global_reference() - old_base); |
+ DCHECK(new_base <= updated_reference); |
+ Memory::Address_at(pc_) = updated_reference; |
+ if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
+ Assembler::FlushICache(isolate_, pc_, sizeof(int64_t)); |
+ } |
+} |
+ |
// ----------------------------------------------------------------------------- |
// Implementation of Operand |