hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
changeset 46449 7b2416f0f524
parent 46427 54713555867e
child 46796 ec791efbdecf
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Tue May 09 13:50:06 2017 -0400
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Thu Oct 13 11:27:20 2016 +0200
@@ -1157,7 +1157,7 @@
     movl(swap_reg, (int32_t)1);
 
     // Load (object->mark() | 1) into swap_reg %rax
-    orptr(swap_reg, Address(obj_reg, 0));
+    orptr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
 
     // Save (object->mark() | 1) into BasicLock's displaced header
     movptr(Address(lock_reg, mark_offset), swap_reg);
@@ -1166,7 +1166,7 @@
            "displaced header must be first word in BasicObjectLock");
 
     if (os::is_MP()) lock();
-    cmpxchgptr(lock_reg, Address(obj_reg, 0));
+    cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
     if (PrintBiasedLockingStatistics) {
       cond_inc32(Assembler::zero,
                  ExternalAddress((address) BiasedLocking::fast_path_entry_count_addr()));
@@ -1263,7 +1263,7 @@
 
     // Atomic swap back the old header
     if (os::is_MP()) lock();
-    cmpxchgptr(header_reg, Address(obj_reg, 0));
+    cmpxchgptr(header_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
 
     // zero for simple unlock of a stack-lock case
     jcc(Assembler::zero, done);