< prev index next >

src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp

Print this page
@@ -139,11 +139,18 @@
  
    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.disp() == 0)) {
-       store_check(masm, dst.base(), dst);
+       if (tmp3 != noreg) {
+         // Called by MacroAssembler::pack_inline_helper. We cannot corrupt the dst.base() register
+         __ movptr(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(tmp1, dst);
        store_check(masm, tmp1, dst);
      }
    }
< prev index next >