Index: src/arm64/assembler-arm64.cc |
diff --git a/src/arm64/assembler-arm64.cc b/src/arm64/assembler-arm64.cc |
index 2471d5eebdb807ff3c421b191a57892c424b0c43..9cf6be9918c3cdce0a0e856de3ea113bf09f78c8 100644 |
--- a/src/arm64/assembler-arm64.cc |
+++ b/src/arm64/assembler-arm64.cc |
@@ -192,6 +192,41 @@ bool RelocInfo::IsInConstantPool() { |
return instr->IsLdrLiteralX(); |
} |
+Address RelocInfo::wasm_memory_reference() { |
+ DCHECK(IsWasmMemoryReference(rmode_)); |
+ return Memory::Address_at(Assembler::target_pointer_address_at(pc_)); |
+} |
+ |
+uint32_t RelocInfo::wasm_memory_size_reference() { |
+ DCHECK(IsWasmMemorySizeReference(rmode_)); |
+ return Memory::uint32_at(Assembler::target_pointer_address_at(pc_)); |
+} |
+ |
+void RelocInfo::update_wasm_memory_reference( |
+ Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
+ ICacheFlushMode icache_flush_mode) { |
+ DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
+ if (IsWasmMemoryReference(rmode_) && old_base != new_base) { |
+ Address updated_memory_reference; |
+ DCHECK(old_base <= wasm_memory_reference() && |
+ wasm_memory_reference() < old_base + old_size); |
+ updated_memory_reference = new_base + (wasm_memory_reference() - old_base); |
+ DCHECK(new_base <= updated_memory_reference && |
+ updated_memory_reference < new_base + new_size); |
+ Assembler::set_target_address_at( |
+ isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); |
+ } else if (IsWasmMemorySizeReference(rmode_)) { |
+ uint32_t updated_size_reference; |
+ DCHECK(wasm_memory_size_reference() <= old_size); |
+ updated_size_reference = |
+ new_size + (wasm_memory_size_reference() - old_size); |
+ DCHECK(updated_size_reference <= new_size); |
+ Memory::uint32_at(Assembler::target_pointer_address_at(pc_)) = |
+ updated_size_reference; |
+ } else { |
+ UNREACHABLE(); |
+ } |
+} |
Register GetAllocatableRegisterThatIsNotOneOf(Register reg1, Register reg2, |
Register reg3, Register reg4) { |