< prev index next >

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

Print this page
@@ -82,15 +82,24 @@
    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, 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) {
+         // TODO 8366717 This change is from before the 'tmp3' arg was added to mainline, check if it's still needed. Same on x64. Also, this should be a __ lea
+         // Called by MacroAssembler::pack_inline_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(tmp3, dst);
        store_check(masm, tmp3, dst);
      }
    }
< prev index next >