< prev index next >

src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp

Print this page

        

@@ -89,23 +89,32 @@
   __ br(Assembler::GE, L_loop);
   __ bind(L_done);
 }
 
 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
-                                                Address dst, Register val, Register tmp1, Register tmp2) {
+                                                Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
   bool in_heap = (decorators & IN_HEAP) != 0;
   bool is_array = (decorators & IS_ARRAY) != 0;
   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
   bool precise = is_array || on_anonymous;
 
   bool needs_post_barrier = val != noreg && in_heap;
-  BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg);
+  BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg, noreg);
   if (needs_post_barrier) {
     // flatten object address if needed
     if (!precise || (dst.index() == noreg && dst.offset() == 0)) {
-      store_check(masm, dst.base(), dst);
+      if (tmp3 != noreg) {
+        // Called by MacroAssembler::pack_value_helper. We cannot corrupt the dst.base() register
+        __ mov(tmp3, dst.base());
+        store_check(masm, tmp3, dst);
+      } else {
+        // It's OK to corrupt the dst.base() register.
+        store_check(masm, dst.base(), dst);
+      }
+
     } else {
       __ lea(r3, dst);
       store_check(masm, r3, dst);
     }
   }
+
 }
< prev index next >