--- old/src/hotspot/share/runtime/objectMonitor.cpp 2020-07-13 15:32:45.000000000 -0400 +++ new/src/hotspot/share/runtime/objectMonitor.cpp 2020-07-13 15:32:44.000000000 -0400 @@ -998,8 +998,8 @@ " is exiting an ObjectMonitor it does not own.", p2i(THREAD)); lsh.print_cr("The imbalance is possibly caused by JNI locking."); print_debug_style_on(&lsh); -#endif assert(false, "Non-balanced monitor enter/exit!"); +#endif return; } } --- old/src/hotspot/share/runtime/objectMonitor.hpp 2020-07-13 15:32:45.000000000 -0400 +++ new/src/hotspot/share/runtime/objectMonitor.hpp 2020-07-13 15:32:45.000000000 -0400 @@ -311,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; --- old/src/hotspot/share/runtime/objectMonitor.inline.hpp 2020-07-13 15:32:46.000000000 -0400 +++ new/src/hotspot/share/runtime/objectMonitor.inline.hpp 2020-07-13 15:32:46.000000000 -0400 @@ -124,9 +124,9 @@ inline void ObjectMonitor::release_clear_owner(void* old_value) { #ifdef ASSERT void* prev = Atomic::load(&_owner); -#endif assert(prev == old_value, "unexpected prev owner=" INTPTR_FORMAT ", expected=" INTPTR_FORMAT, p2i(prev), p2i(old_value)); +#endif Atomic::release_store(&_owner, (void*)NULL); log_trace(monitorinflation, owner)("release_clear_owner(): mid=" INTPTR_FORMAT ", old_value=" INTPTR_FORMAT, @@ -138,9 +138,9 @@ inline void ObjectMonitor::set_owner_from(void* old_value, void* new_value) { #ifdef ASSERT void* prev = Atomic::load(&_owner); -#endif assert(prev == old_value, "unexpected prev owner=" INTPTR_FORMAT ", expected=" INTPTR_FORMAT, p2i(prev), p2i(old_value)); +#endif Atomic::store(&_owner, new_value); log_trace(monitorinflation, owner)("set_owner_from(): mid=" INTPTR_FORMAT ", old_value=" INTPTR_FORMAT @@ -169,9 +169,9 @@ inline void ObjectMonitor::set_owner_from_BasicLock(void* basic_lock_p, Thread* self) { #ifdef ASSERT void* prev = Atomic::load(&_owner); -#endif assert(prev == basic_lock_p, "unexpected prev owner=" INTPTR_FORMAT ", expected=" INTPTR_FORMAT, p2i(prev), p2i(basic_lock_p)); +#endif // Non-null owner field to non-null owner field is safe without // cmpxchg() as long as all readers can tolerate either flavor. Atomic::store(&_owner, self); --- old/src/hotspot/share/runtime/synchronizer.cpp 2020-07-13 15:32:47.000000000 -0400 +++ new/src/hotspot/share/runtime/synchronizer.cpp 2020-07-13 15:32:47.000000000 -0400 @@ -982,9 +982,8 @@ intptr_t ObjectSynchronizer::FastHashCode(Thread* self, oop obj) { if (UseBiasedLocking) { // NOTE: many places throughout the JVM do not expect a safepoint - // to be taken here, in particular most operations on perm gen - // objects. However, we only ever bias Java instances and all of - // the call sites of identity_hash that might revoke biases have + // to be taken here. However, we only ever bias Java instances and all + // of the call sites of identity_hash that might revoke biases have // been checked to make sure they can handle a safepoint. The // added check of the bias pattern is to avoid useless calls to // thread-local storage. @@ -1372,9 +1371,9 @@ // ObjectMonitor Lifecycle // ----------------------- // Inflation unlinks monitors from om_list_globals._free_list or a per-thread -// free list and associates them with objects. Deflation -- which occurs at -// STW-time or asynchronously -- disassociates idle monitors from objects. -// Such scavenged monitors are returned to the om_list_globals._free_list. +// free list and associates them with objects. Async deflation disassociates +// idle monitors from objects. Such scavenged monitors are returned to the +// om_list_globals._free_list. // // ObjectMonitors reside in type-stable memory (TSM) and are immortal. // @@ -1387,7 +1386,7 @@ ObjectMonitor* ObjectSynchronizer::om_alloc(Thread* self) { // A large MAXPRIVATE value reduces both list lock contention // and list coherency traffic, but also tends to increase the - // number of ObjectMonitors in circulation as well as the STW + // number of ObjectMonitors in circulation as well as the // scavenge costs. As usual, we lean toward time in space-time // tradeoffs. const int MAXPRIVATE = 1024; @@ -1435,9 +1434,9 @@ #ifdef ASSERT jint l_contentions = take->contentions(); -#endif assert(l_contentions >= 0, "must not be negative: l_contentions=%d, contentions=%d", l_contentions, take->contentions()); +#endif } take->Recycle(); // Since we're taking from the global free-list, take must be Free. @@ -1675,9 +1674,9 @@ guarantee(in_use_tail != NULL, "invariant"); #ifdef ASSERT int l_om_in_use_count = Atomic::load(&self->om_in_use_count); -#endif assert(l_om_in_use_count == in_use_count, "in-use counts don't match: " "l_om_in_use_count=%d, in_use_count=%d", l_om_in_use_count, in_use_count); +#endif Atomic::store(&self->om_in_use_count, 0); // Clear the in-use list head (which also unlocks it): Atomic::store(&self->om_in_use_list, (ObjectMonitor*)NULL); @@ -1720,9 +1719,9 @@ guarantee(free_tail != NULL, "invariant"); #ifdef ASSERT int l_om_free_count = Atomic::load(&self->om_free_count); -#endif assert(l_om_free_count == free_count, "free counts don't match: " "l_om_free_count=%d, free_count=%d", l_om_free_count, free_count); +#endif Atomic::store(&self->om_free_count, 0); Atomic::store(&self->om_free_list, (ObjectMonitor*)NULL); om_unlock(free_list); @@ -2104,8 +2103,8 @@ // prevtail should have been cleaned up by the caller: #ifdef ASSERT ObjectMonitor* l_next_om = unmarked_next(prevtail); -#endif assert(l_next_om == NULL, "must be NULL: _next_om=" INTPTR_FORMAT, p2i(l_next_om)); +#endif om_lock(prevtail); prevtail->set_next_om(mid); // prevtail now points to mid (and is unlocked) } @@ -2403,8 +2402,8 @@ // all out. #ifdef ASSERT ObjectMonitor* l_next_om = unmarked_next(free_tail_p); -#endif assert(l_next_om == NULL, "must be NULL: _next_om=" INTPTR_FORMAT, p2i(l_next_om)); +#endif prepend_list_to_global_wait_list(free_head_p, free_tail_p, local_deflated_count); @@ -2475,7 +2474,7 @@ // A simple optimization is to add a per-thread flag that indicates a thread // called jni_monitorenter() during its lifetime. // -// Instead of No_Savepoint_Verifier it might be cheaper to +// Instead of NoSafepointVerifier it might be cheaper to // use an idiom of the form: // auto int tmp = SafepointSynchronize::_safepoint_counter ; //