< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Print this page
rev 55494 : imported patch dcubed.monitor_deflate_conc.v2.05

*** 1837,1848 **** lock(); cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); // Unconditionally set box->_displaced_header = markOopDesc::unused_mark(). // Without cast to int32_t movptr will destroy r10 which is typically obj. movptr(Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark())); // Intentional fall-through into DONE_LABEL ... ! // Propagate ICC.ZF from CAS above into DONE_LABEL. #endif // _LP64 #if INCLUDE_RTM_OPT } // use_rtm() #endif // DONE_LABEL is a hot target - we'd really like to place it at the --- 1837,1868 ---- lock(); cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); // Unconditionally set box->_displaced_header = markOopDesc::unused_mark(). // Without cast to int32_t movptr will destroy r10 which is typically obj. movptr(Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark())); + // The following code to verify that the object field still refers + // to the object we are trying to lock is not needed with safepoint + // based deflation. It is also not needed with async deflation when + // the DEFLATER_MARKER is allowed to linger in the owner field in an + // async deflated ObjectMonitor until replaced by the next owner value. + // We keep this code as a sanity check against bugs in other parts + // of the async deflation mechanism. + // + // If we weren't able to swing _owner from NULL to r15_thread + // then take the slow path. + jccb(Assembler::notZero, DONE_LABEL); + // r15_thread is now the owner so verify that the ObjectMonitor + // still refers to the same object. + cmpptr(objReg, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(object))); + // The ObjectMonitor still refers to the same object so + // r15_thread's ownership is valid. + jccb(Assembler::zero, DONE_LABEL); + // The ObjectMonitor does not refer to the same object so + // drop ownership. + movptr(Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD); // Intentional fall-through into DONE_LABEL ... ! // Propagate ICC.ZF from cmpptr() above into DONE_LABEL. #endif // _LP64 #if INCLUDE_RTM_OPT } // use_rtm() #endif // DONE_LABEL is a hot target - we'd really like to place it at the
< prev index next >