Index: src/x64/assembler-x64-inl.h |
diff --git a/src/x64/assembler-x64-inl.h b/src/x64/assembler-x64-inl.h |
index 9a0fc7c8f44df7a08ff0fc8ac18625ea2bce4017..dccf132a68668fd2c86019c786804566cf6c9c17 100644 |
--- a/src/x64/assembler-x64-inl.h |
+++ b/src/x64/assembler-x64-inl.h |
@@ -326,6 +326,10 @@ Address RelocInfo::target_address() { |
return Assembler::target_address_at(pc_, host_); |
} |
+Address RelocInfo::wasm_memory_reference() { |
+ DCHECK(IsWasmMemoryReference(rmode_)); |
+ return Memory::Address_at(pc_); |
+} |
Address RelocInfo::target_address_address() { |
DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
@@ -364,6 +368,21 @@ void RelocInfo::set_target_address(Address target, |
} |
} |
+void RelocInfo::update_wasm_memory_reference( |
+ Address old_base, Address new_base, size_t old_size, size_t new_size, |
+ ICacheFlushMode icache_flush_mode) { |
+ DCHECK(IsWasmMemoryReference(rmode_)); |
+ DCHECK(old_size <= new_size); |
+ DCHECK(old_base <= wasm_memory_reference() && |
+ wasm_memory_reference() <= old_base + old_size); |
+ Address updated_reference = wasm_memory_reference() + (new_base - old_base); |
+ DCHECK(new_base <= updated_reference && |
+ updated_reference <= new_base + new_size); |
+ Memory::Address_at(pc_) = updated_reference; |
+ if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
+ Assembler::FlushICache(isolate_, pc_, sizeof(int64_t)); |
+ } |
+} |
Object* RelocInfo::target_object() { |
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |