< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Print this page
rev 56775 : imported patch 8230876.patch
rev 56776 : v2.00 -> v2.07 (CR7/v2.07/10-for-jdk14) patches combined into one; merge with 8230876.patch (2019.10.17) and jdk-14+21.
rev 56777 : See CR7-to-CR8-changes.

@@ -1582,21 +1582,22 @@
   assert(tmpReg == rax, "");
   assert(scrReg == rdx, "");
   Label L_rtm_retry, L_decrement_retry, L_on_abort, L_local_done;
   int owner_offset = OM_OFFSET_NO_MONITOR_VALUE_TAG(owner);
 
+  // Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
+  movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value()));
+
   if (!HandshakeAfterDeflateIdleMonitors) {
     // Increment the ObjectMonitor's ref_count for safety or force the
     // enter slow path via DONE_LABEL.
     // In rtm_inflated_locking(), initially tmpReg contains the object's
     // mark word which, in this case, is the (ObjectMonitor* | monitor_value).
     // Also this code uses scrReg as its temporary register.
     inc_om_ref_count(objReg, tmpReg /* om_reg */, scrReg /* tmp_reg */, DONE_LABEL);
   }
 
-  // Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
-  movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value()));
   movptr(boxReg, tmpReg); // Save ObjectMonitor address
 
   if (RTMRetryCount > 0) {
     movl(retry_on_busy_count_Reg, RTMRetryCount);  // Retry on lock busy
     movl(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort

@@ -1896,10 +1897,14 @@
   // Intentional fall-through into DONE_LABEL ...
 #else // _LP64
   // It's inflated and we use scrReg for ObjectMonitor* in this section.
   movq(scrReg, tmpReg);
 
+  // Unconditionally set box->_displaced_header = markWord::unused_mark().
+  // Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
+  movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value()));
+
   if (!HandshakeAfterDeflateIdleMonitors) {
     // Increment the ObjectMonitor's ref_count for safety or force the
     // enter slow path via DONE_LABEL.
     // In fast_lock(), scrReg contains the object's mark word which,
     // in this case, is the (ObjectMonitor* | monitor_value). Also this

@@ -1908,13 +1913,10 @@
   }
 
   xorq(tmpReg, tmpReg);
   lock();
   cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
-  // Unconditionally set box->_displaced_header = markWord::unused_mark().
-  // Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
-  movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value()));
   // Intentional fall-through into DONE_LABEL ...
   // Propagate ICC.ZF from CAS above into DONE_LABEL.
 
   if (!HandshakeAfterDeflateIdleMonitors) {
     pushf();  // Preserve flags.
< prev index next >