diff --git a/src/hotspot/share/runtime/objectMonitor.hpp b/src/hotspot/share/runtime/objectMonitor.hpp index 001ff343bbf..729316811c2 100644 --- a/src/hotspot/share/runtime/objectMonitor.hpp +++ b/src/hotspot/share/runtime/objectMonitor.hpp @@ -148,6 +148,9 @@ class ObjectWaiter : public CHeapObj { #define OM_CACHE_LINE_SIZE DEFAULT_CACHE_LINE_SIZE class ObjectMonitor : public CHeapObj { + friend class LightweightSynchronizer; + friend class ObjectSynchronizer; + friend class ObjectWaiter; friend class VMStructs; JVMCI_ONLY(friend class JVMCIVMStructs;) @@ -421,12 +424,13 @@ class ObjectMonitor : public CHeapObj { bool short_fixed_spin(JavaThread* current, int spin_count, bool adapt); void exit_epilog(JavaThread* current, ObjectWaiter* Wakee); - public: // Deflation support bool deflate_monitor(Thread* current); + private: void install_displaced_markword_in_object(const oop obj); // JFR support +public: static bool is_jfr_excluded(const Klass* monitor_klass); }; diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index 077286ac894..d608ffbdc02 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -423,8 +423,7 @@ bool ObjectSynchronizer::quick_enter_legacy(oop obj, BasicLock* lock, JavaThread // Case: TLE inimical operations such as nested/recursive synchronization if (m->has_owner(current)) { - int recursions = m->recursions(); - m->set_recursions(++recursions); + m->_recursions++; current->inc_held_monitor_count(); return true; } @@ -441,7 +440,7 @@ bool ObjectSynchronizer::quick_enter_legacy(oop obj, BasicLock* lock, JavaThread lock->set_displaced_header(markWord::unused_mark()); if (!m->has_owner() && m->try_set_owner(current)) { - assert(m->recursions() == 0, "invariant"); + assert(m->_recursions == 0, "invariant"); current->inc_held_monitor_count(); return true; }