< prev index next >
src/hotspot/share/runtime/objectMonitor.cpp
Print this page
rev 60025 : 8246476: remove AsyncDeflateIdleMonitors option and the safepoint based deflation mechanism
@@ -288,12 +288,10 @@
assert(_succ != Self, "invariant");
assert(Self->is_Java_thread(), "invariant");
JavaThread * jt = (JavaThread *) Self;
assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
assert(jt->thread_state() != _thread_blocked, "invariant");
- assert(AsyncDeflateIdleMonitors || this->object() != NULL, "invariant");
- assert(AsyncDeflateIdleMonitors || contentions() >= 0, "must not be negative: contentions=%d", contentions());
// Keep track of contention for JVM/TI and M&M queries.
add_to_contentions(1);
if (is_being_async_deflated()) {
// Async deflation is in progress and our contentions increment
@@ -453,16 +451,16 @@
if (l_object == NULL) {
// ObjectMonitor's object ref has already been cleared by async
// deflation so we're done here.
return;
}
- ADIM_guarantee(l_object == obj, "object=" INTPTR_FORMAT " must equal obj="
+ assert(l_object == obj, "object=" INTPTR_FORMAT " must equal obj="
INTPTR_FORMAT, p2i(l_object), p2i(obj));
markWord dmw = header();
// The dmw has to be neutral (not NULL, not locked and not marked).
- ADIM_guarantee(dmw.is_neutral(), "must be neutral: dmw=" INTPTR_FORMAT, dmw.value());
+ assert(dmw.is_neutral(), "must be neutral: dmw=" INTPTR_FORMAT, dmw.value());
// Install displaced mark word if the object's header still points
// to this ObjectMonitor. More than one racing caller to this function
// can rarely reach this point, but only one can win.
markWord res = obj->cas_set_mark(dmw, markWord::encode(this));
@@ -485,14 +483,10 @@
// Convert the fields used by is_busy() to a string that can be
// used for diagnostic output.
const char* ObjectMonitor::is_busy_to_string(stringStream* ss) {
ss->print("is_busy: waiters=%d, ", _waiters);
- if (!AsyncDeflateIdleMonitors) {
- ss->print("contentions=%d, ", contentions());
- ss->print("owner=" INTPTR_FORMAT, p2i(_owner));
- } else {
if (contentions() > 0) {
ss->print("contentions=%d, ", contentions());
} else {
ss->print("contentions=0");
}
@@ -501,11 +495,10 @@
} else {
// We report NULL instead of DEFLATER_MARKER here because is_busy()
// ignores DEFLATER_MARKER values.
ss->print("owner=" INTPTR_FORMAT, NULL);
}
- }
ss->print(", cxq=" INTPTR_FORMAT ", EntryList=" INTPTR_FORMAT, p2i(_cxq),
p2i(_EntryList));
return ss->base();
}
@@ -522,12 +515,11 @@
assert(_owner == Self, "invariant");
assert(_Responsible != Self, "invariant");
return;
}
- if (AsyncDeflateIdleMonitors &&
- try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) {
+ if (try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) {
// Cancelled the in-progress async deflation by changing owner from
// DEFLATER_MARKER to Self. As part of the contended enter protocol,
// contentions was incremented to a positive value before EnterI()
// was called and that prevents the deflater thread from winning the
// last part of the 2-part async deflation protocol. After EnterI()
@@ -657,12 +649,11 @@
Self->_ParkEvent->park();
}
if (TryLock(Self) > 0) break;
- if (AsyncDeflateIdleMonitors &&
- try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) {
+ if (try_set_owner_from(DEFLATER_MARKER, Self) == DEFLATER_MARKER) {
// Cancelled the in-progress async deflation by changing owner from
// DEFLATER_MARKER to Self. As part of the contended enter protocol,
// contentions was incremented to a positive value before EnterI()
// was called and that prevents the deflater thread from winning the
// last part of the 2-part async deflation protocol. After EnterI()
< prev index next >