Index: src/ppc/assembler-ppc.cc |
diff --git a/src/ppc/assembler-ppc.cc b/src/ppc/assembler-ppc.cc |
index bf59955ab3adc2f47fa7f1cd10d2fdf4a110cadb..3c8a57232b93556675f0574ca3e89c9a92d71bb4 100644 |
--- a/src/ppc/assembler-ppc.cc |
+++ b/src/ppc/assembler-ppc.cc |
@@ -166,6 +166,12 @@ uint32_t RelocInfo::wasm_memory_size_reference() { |
reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_))); |
} |
+Address RelocInfo::wasm_global_reference() { |
+ DCHECK(IsWasmGlobalReference(rmode_)); |
+ return 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) { |
@@ -193,6 +199,17 @@ 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); |
+ Assembler::set_target_address_at(isolate_, pc_, host_, updated_reference, |
+ icache_flush_mode); |
+} |
+ |
// ----------------------------------------------------------------------------- |
// Implementation of Operand and MemOperand |
// See assembler-ppc-inl.h for inlined constructors |