Skip to content

Commit d14e84c

Browse files
committed
8354446: [BACKOUT] Remove friends for ObjectMonitor
Reviewed-by: pchilanomate
1 parent 1d7138f commit d14e84c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/hotspot/share/runtime/objectMonitor.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ class ObjectWaiter : public CHeapObj<mtThread> {
148148
#define OM_CACHE_LINE_SIZE DEFAULT_CACHE_LINE_SIZE
149149

150150
class ObjectMonitor : public CHeapObj<mtObjectMonitor> {
151+
friend class LightweightSynchronizer;
152+
friend class ObjectSynchronizer;
153+
friend class ObjectWaiter;
151154
friend class VMStructs;
152155
JVMCI_ONLY(friend class JVMCIVMStructs;)
153156

@@ -421,12 +424,13 @@ class ObjectMonitor : public CHeapObj<mtObjectMonitor> {
421424
bool short_fixed_spin(JavaThread* current, int spin_count, bool adapt);
422425
void exit_epilog(JavaThread* current, ObjectWaiter* Wakee);
423426

424-
public:
425427
// Deflation support
426428
bool deflate_monitor(Thread* current);
429+
private:
427430
void install_displaced_markword_in_object(const oop obj);
428431

429432
// JFR support
433+
public:
430434
static bool is_jfr_excluded(const Klass* monitor_klass);
431435
};
432436

src/hotspot/share/runtime/synchronizer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,7 @@ bool ObjectSynchronizer::quick_enter_legacy(oop obj, BasicLock* lock, JavaThread
423423
// Case: TLE inimical operations such as nested/recursive synchronization
424424

425425
if (m->has_owner(current)) {
426-
int recursions = m->recursions();
427-
m->set_recursions(++recursions);
426+
m->_recursions++;
428427
current->inc_held_monitor_count();
429428
return true;
430429
}
@@ -441,7 +440,7 @@ bool ObjectSynchronizer::quick_enter_legacy(oop obj, BasicLock* lock, JavaThread
441440
lock->set_displaced_header(markWord::unused_mark());
442441

443442
if (!m->has_owner() && m->try_set_owner(current)) {
444-
assert(m->recursions() == 0, "invariant");
443+
assert(m->_recursions == 0, "invariant");
445444
current->inc_held_monitor_count();
446445
return true;
447446
}

0 commit comments

Comments
 (0)