Index: src/mips/assembler-mips.cc |
diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc |
index d3fffa0ed5124ca0cb987f2bec8c1fa845558e46..f95323b41fa64b5128468aaa6f2d93b38a93520b 100644 |
--- a/src/mips/assembler-mips.cc |
+++ b/src/mips/assembler-mips.cc |
@@ -189,6 +189,42 @@ bool RelocInfo::IsInConstantPool() { |
return false; |
} |
+Address RelocInfo::wasm_memory_reference() { |
+ DCHECK(IsWasmMemoryReference(rmode_)); |
+ return Assembler::target_address_at(pc_, host_); |
+} |
+ |
+uint32_t RelocInfo::wasm_memory_size_reference() { |
+ DCHECK(IsWasmMemorySizeReference(rmode_)); |
+ return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_)); |
+} |
+ |
+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_)) { |
+ 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); |
+ Assembler::set_target_address_at( |
+ isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), |
+ icache_flush_mode); |
+ } else { |
+ UNREACHABLE(); |
+ } |
+} |
// ----------------------------------------------------------------------------- |
// Implementation of Operand and MemOperand. |