< prev index next >
src/hotspot/share/runtime/objectMonitor.inline.hpp
Print this page
rev 59376 : 8153224.v2.10.patch merged with 8153224.v2.11.patch.
rev 59377 : CR1 changes from dcubed, dholmes, eosterlund and rehn.
rev 59378 : CR changes from dholmes, dcubed; fix is_being_async_deflated() race found by eosterlund; WB_ForceSafepoint() should request a special clean up with AsyncDeflateIdleMonitors; add a barrier in install_displaced_markword_in_object() to separate the header load from the preceding loads in is_being_async_deflated().
rev 59379 : eosterlund CR - Switch from three part async deflation protocol to a two part async deflation protocol where a negative contentions field is a linearization point.
@@ -65,22 +65,11 @@
return Atomic::load(&_owner) == DEFLATER_MARKER;
}
// Returns true if 'this' is being async deflated and false otherwise.
inline bool ObjectMonitor::is_being_async_deflated() {
- if (AsyncDeflateIdleMonitors &&
- // Check first part of the async deflation dance:
- owner_is_DEFLATER_MARKER() &&
- // Check second part of the async deflation dance:
- contentions() < 0 &&
- // Check third part of the async deflation dance, i.e., the
- // owner field is still DEFLATER_MARKER:
- owner_is_DEFLATER_MARKER()
- ) {
- return true;
- }
- return false;
+ return AsyncDeflateIdleMonitors && contentions() < 0;
}
inline void ObjectMonitor::clear() {
assert(Atomic::load(&_header).value() != 0, "must be non-zero");
assert(_owner == NULL, "must be NULL: owner=" INTPTR_FORMAT, p2i(_owner));
@@ -91,15 +80,15 @@
}
inline void ObjectMonitor::clear_common() {
if (AsyncDeflateIdleMonitors) {
// Async deflation protocol uses the header, owner and contentions
- // fields. While the ObjectMonitor being deflated is on the global free
- // list, we leave those three fields alone; owner == DEFLATER_MARKER
- // and contentions < 0 will force any racing threads to retry. The
- // header field is used by install_displaced_markword_in_object()
- // to restore the object's header so we cannot check its value here.
+ // fields. While the ObjectMonitor being deflated is on the global
+ // free list, we leave those three fields alone; contentions < 0
+ // will force any racing threads to retry. The header field is used
+ // by install_displaced_markword_in_object() to restore the object's
+ // header so we cannot check its value here.
guarantee(_owner == NULL || _owner == DEFLATER_MARKER,
"must be NULL or DEFLATER_MARKER: owner=" INTPTR_FORMAT,
p2i(_owner));
}
assert(contentions() <= 0, "must not be positive: contentions=%d", contentions());
< prev index next >