changeset 55112:4bfaa8806904 lworld

Fixed failure in TestCallingConventionC1.java when G1GC is not used
author iklam
date Tue, 30 Apr 2019 20:50:02 -0700
parents 733920bd8bb1
children c7ecf40f8a60
files src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp	Tue Apr 30 09:46:37 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp	Tue Apr 30 20:50:02 2019 -0700
@@ -143,7 +143,14 @@
   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_value_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);