8246476: remove AsyncDeflateIdleMonitors option and the safepoint based deflation mechanism

Reviewed-by: dholmes, pchilanomate, coleenp
This commit is contained in:
Daniel D. Daugherty 2020-07-13 16:36:01 -04:00
parent 231a8408b2
commit 7436ef236e
14 changed files with 144 additions and 630 deletions

View file

@ -175,7 +175,7 @@ class ObjectMonitor {
jint _contentions; // Number of active contentions in enter(). It is used by is_busy()
// along with other fields to determine if an ObjectMonitor can be
// deflated. It is also used by the async deflation protocol. See
// ObjectSynchronizer::deflate_monitor() and deflate_monitor_using_JT().
// ObjectSynchronizer::deflate_monitor_using_JT().
protected:
ObjectWaiter* volatile _WaitSet; // LL of threads wait()ing on the monitor
volatile jint _waiters; // number of waiting threads
@ -243,15 +243,11 @@ class ObjectMonitor {
intptr_t is_busy() const {
// TODO-FIXME: assert _owner == null implies _recursions = 0
intptr_t ret_code = _waiters | intptr_t(_cxq) | intptr_t(_EntryList);
if (!AsyncDeflateIdleMonitors) {
ret_code |= contentions() | intptr_t(_owner);
} else {
if (contentions() > 0) {
ret_code |= contentions();
}
if (_owner != DEFLATER_MARKER) {
ret_code |= intptr_t(_owner);
}
if (contentions() > 0) {
ret_code |= contentions();
}
if (_owner != DEFLATER_MARKER) {
ret_code |= intptr_t(_owner);
}
return ret_code;
}
@ -315,9 +311,9 @@ class ObjectMonitor {
// _recursions == 0 _WaitSet == NULL
#ifdef ASSERT
stringStream ss;
#endif
assert((is_busy() | _recursions) == 0, "freeing in-use monitor: %s, "
"recursions=" INTX_FORMAT, is_busy_to_string(&ss), _recursions);
#endif
_succ = NULL;
_EntryList = NULL;
_cxq = NULL;
@ -374,15 +370,4 @@ class ObjectMonitor {
void install_displaced_markword_in_object(const oop obj);
};
// Macro to use guarantee() for more strict AsyncDeflateIdleMonitors
// checks and assert() otherwise.
#define ADIM_guarantee(p, ...) \
do { \
if (AsyncDeflateIdleMonitors) { \
guarantee(p, __VA_ARGS__); \
} else { \
assert(p, __VA_ARGS__); \
} \
} while (0)
#endif // SHARE_RUNTIME_OBJECTMONITOR_HPP