--- old/src/hotspot/share/runtime/objectMonitor.hpp 2020-07-13 15:31:49.000000000 -0400 +++ new/src/hotspot/share/runtime/objectMonitor.hpp 2020-07-13 15:31:49.000000000 -0400 @@ -175,7 +175,7 @@ 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 @@ 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 @@ // _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 @@ 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