Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ccdd279
Allow virtual threads to unmount while holding monitors
pchilano Oct 15, 2024
54813cd
Allow virtual threads to unmount when blocked on synchronized
pchilano Oct 16, 2024
21c3353
Allow virtual threads to unmount when blocked on Object.wait()
pchilano Oct 16, 2024
9baaff9
Test changes + JFR Updates + Library code changes
pchilano Oct 16, 2024
6a81ccd
Add PPC64 support
pchilano Oct 18, 2024
32840de
RISC-V: Avoid return misprediction
pchilano Oct 21, 2024
5c76442
Adjust comment in JavaThread.hpp
pchilano Oct 21, 2024
8c196ac
Adjust spacing in test JfrEvents.java
pchilano Oct 21, 2024
2ddbb3c
Revert and simplify changes to c1_Runtime1 on aarch64 and riscv
pchilano Oct 21, 2024
06f3732
Fix comments in c2 locking paths
pchilano Oct 21, 2024
f8616a5
remove usage of frame::metadata_words in possibly_adjust_frame()
pchilano Oct 21, 2024
fbd0cad
Fix typo in jvmtiExport.cpp
pchilano Oct 21, 2024
4cec62a
Move frame::saved_thread_address() to platform dependent files
pchilano Oct 21, 2024
23d1a2b
Fix comments in objectMonitor.hpp
pchilano Oct 21, 2024
81e5c6d
Make lea with RIP-relative addressing more general
pchilano Oct 22, 2024
b6bc98e
Address David's comments to ObjectMonitor.hpp
pchilano Oct 23, 2024
d43c084
Clear oops when thawing lockstack + add thaw_lockstack()
pchilano Oct 23, 2024
ab087a5
Fix comment in Thread.java
pchilano Oct 23, 2024
e232b7f
Rename timedWaitNonce to timedWaitSeqNo
pchilano Oct 23, 2024
baf7ffa
Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv
pchilano Oct 23, 2024
0ebc3e9
Skip printing tid when not available
pchilano Oct 24, 2024
03ba6df
Fix comment in objectMonitor.hpp and javaThread.hpp
pchilano Oct 24, 2024
13353fd
Remove ObjectMonitor::set_owner_from_BasicLock()
pchilano Oct 24, 2024
d40d382
Rename nonce/nounce to seqNo in VirtualThread class
pchilano Oct 24, 2024
34362b9
Fix comments in javaThread.hpp and Thread.java
pchilano Oct 24, 2024
c7a82c4
Rename set/has_owner_anonymous to set/has_anonymous_owner
pchilano Oct 24, 2024
1785501
Fix JvmtiUnmountBeginMark
pchilano Oct 25, 2024
0308ee4
Add comments for Coleen
pchilano Oct 25, 2024
3479dba
Move condition to new line in nmethod::preserve_callee_argument_oops
pchilano Oct 25, 2024
d6313cf
Add/fix comments for David
pchilano Oct 25, 2024
4a9c030
remove interruptible check from conditional in Object::wait
pchilano Oct 25, 2024
66d5385
Restore use of atPointA in test StopThreadTest.java
pchilano Oct 25, 2024
7df17a3
Rename inflating_thread to locking_thread
pchilano Oct 28, 2024
1ff336b
Make member functions in ObjectWaiter const
pchilano Oct 28, 2024
c513ae3
add authenticate_return_address() in StubAssembler::epilogue
pchilano Oct 28, 2024
7cb4cff
Simplify set last_sp in prepare_freeze_interpreted_top_frame
pchilano Oct 28, 2024
bd918fa
extra suggestion to prepare_freeze_interpreted_top_frame
pchilano Oct 28, 2024
33cf05f
Remove generate_cont_resume_monitor_operation() + comment in ObjectSy…
pchilano Oct 28, 2024
fc9aa07
Fix vmStructs definitions
pchilano Oct 28, 2024
056d21e
Fix comment in VThreadWaitReenter
pchilano Oct 28, 2024
3e8b4fe
Improve comment in SharedRuntime::generate_native_wrapper
pchilano Oct 29, 2024
e4b0020
add assert in ThawBase::recurse_thaw_interpreted_frame
pchilano Oct 29, 2024
0f3b902
Add comments for Dean + move reload result_handler in generate_native…
pchilano Oct 29, 2024
1b695e5
Fix comment in continuation.hpp
pchilano Oct 30, 2024
9fd4c03
Add klass_name check for is_object_wait0
pchilano Oct 30, 2024
63003d3
Rename oopCont + fix in JvmtiUnmountBeginMark
pchilano Oct 30, 2024
749e30e
Add comment in call_VM_preemptable
pchilano Oct 30, 2024
aa682de
SmallRegisterMap::instance() fix + comment typo
pchilano Oct 30, 2024
0951dfe
Fix typos in comments
pchilano Oct 30, 2024
e342980
Comments for Dean
pchilano Oct 31, 2024
9f086c5
Add ObjectMonitor::successor() method + use ThreadIdentifier::initial()
pchilano Oct 31, 2024
12213a7
Use frame::sender_sp_offset in continuationFreezeThaw_riscv.inline.hpp
pchilano Oct 31, 2024
d09575f
Explicitly pass tmp register to inc/dec_held_monitor_count + use stat…
pchilano Oct 31, 2024
c92cb6b
Comment in FreezeBase::recurse_freeze + renames in continuation.hpp
pchilano Oct 31, 2024
aa263f5
Remove redundant assert in ObjectMonitor::VThreadEpilog
pchilano Oct 31, 2024
7354f60
Remove assignments in preempt_kind enum
pchilano Oct 31, 2024
e5a9ce2
add comment to ThreadService::find_deadlocks_at_safepoint
pchilano Oct 31, 2024
60e4325
Merge branch 'master' into JDK-8338383
pchilano Nov 1, 2024
0f0f71a
Remove oop clearing in transfer_lockstack + pass _barriers as argument
pchilano Nov 1, 2024
dac94da
Add comment in X509TrustManagerImpl.java
pchilano Nov 1, 2024
113fb3d
Fix comments for David
pchilano Nov 1, 2024
33eb638
Revert fixes after 8343132
pchilano Nov 1, 2024
52c2664
Use lazySubmitRunContinuation when blocking
pchilano Nov 1, 2024
9752ece
Remove ThawBase::possibly_adjust_frame()
pchilano Nov 2, 2024
1f3cfce
Fix issue with unmounted virtual thread when dumping heap
pchilano Nov 3, 2024
1139631
Update comment block in objectMonitor.cpp
pchilano Nov 3, 2024
b3de8f6
Use freeze_result consistently
pchilano Nov 4, 2024
fbd43e5
Improve JFR pinned reason in event
pchilano Nov 4, 2024
e18b2be
Revert suggestion to ThawBase::new_stack_frame
pchilano Nov 5, 2024
b6ed182
Rename waitTimeout/set_waitTimeout accessors
pchilano Nov 5, 2024
79189f9
Add oopDesc::has_klass_gap() check
pchilano Nov 5, 2024
81434a2
Fix s390x failures
pchilano Nov 5, 2024
e5c18ba
Fix return miss prediction in generate_native_entry for riscv
pchilano Nov 5, 2024
124efa0
Fixes to JFR metadata.xml
pchilano Nov 5, 2024
c0c7e6c
Use ThreadIdentifier::initial() in ObjectMonitor::owner_from()
pchilano Nov 5, 2024
6a3f5f3
Add ReflectionCallerCacheTest.java to test/jdk/ProblemList-Xcomp.txt
pchilano Nov 6, 2024
2001fba
Update comment for _cont_fastpath
pchilano Nov 6, 2024
89d6dc7
Add --enable-native-access=ALL-UNNAMED to SynchronizedNative.java
pchilano Nov 6, 2024
678676a
Move load of _lock_id in C2_MacroAssembler::fast_lock
pchilano Nov 6, 2024
211c6c8
Use is_top_frame boolean in FreezeBase::check_valid_fast_path()
pchilano Nov 6, 2024
37e3017
Use JvmtiVTMSTransitionDisabler::VTMS_vthread_mount/unmount
pchilano Nov 5, 2024
f27c59c
Add @requires vm.continuations to CancelTimerWithContention.java
pchilano Nov 7, 2024
5210f0c
Merge branch 'master' into JDK-8338383
pchilano Nov 7, 2024
62b16c6
Use get_method_name + copyright revert in jvmtiThreadState.cpp
pchilano Nov 7, 2024
1814e33
Add ObjectWaiter::at_monitorenter
pchilano Nov 8, 2024
3cdb8f8
Fix in JvmtiEnvBase::get_locked_objects_in_frame()
pchilano Nov 8, 2024
3ce6663
Merge branch 'master' into JDK-8338383
pchilano Nov 8, 2024
97a8a82
Pass -XX:-UseCompactObjectHeaders in test JNIMonitor.java
pchilano Nov 11, 2024
5878759
Test StopThreadTest.java: fix operator in condition + improve names
pchilano Nov 11, 2024
0fe6046
Merge branch 'master' into JDK-8338383
pchilano Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ void StubAssembler::epilogue(bool use_pop) {
// must restore the rfp value saved on enter though.
if (use_pop) {
ldp(rfp, lr, Address(post(sp, 2 * wordSize)));
authenticate_return_address();
} else {
leave();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
}
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
assert(*f.addr_at(frame::interpreter_frame_last_sp_offset) == 0, "should be null for top frame");
intptr_t* lspp = f.addr_at(frame::interpreter_frame_last_sp_offset);
*lspp = f.unextended_sp() - f.fp();
f.interpreter_frame_set_last_sp(f.unextended_sp());
}

inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, const frame& hf) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/continuationFreezeThaw_arm.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
Unimplemented();
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
Unimplemented();
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
// nothing to do
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
// nothing to do
DEBUG_ONLY( intptr_t* lspp = (intptr_t*) &(f.get_ijava_state()->top_frame_sp); )
assert(*lspp == f.unextended_sp() - f.fp(), "should be " INTPTR_FORMAT " usp:" INTPTR_FORMAT " fp:" INTPTR_FORMAT, *lspp, p2i(f.unextended_sp()), p2i(f.fp()));
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
}
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
assert(*f.addr_at(frame::interpreter_frame_last_sp_offset) == 0, "should be null for top frame");
intptr_t* lspp = f.addr_at(frame::interpreter_frame_last_sp_offset);
*lspp = f.unextended_sp() - f.fp();
f.interpreter_frame_set_last_sp(f.unextended_sp());
}

inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, const frame& hf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
Unimplemented();
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
Unimplemented();
}

Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/cpu/x86/continuationFreezeThaw_x86.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
}
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
assert(*f.addr_at(frame::interpreter_frame_last_sp_offset) == 0, "should be null for top frame");
intptr_t* lspp = f.addr_at(frame::interpreter_frame_last_sp_offset);
*lspp = f.unextended_sp() - f.fp();
f.interpreter_frame_set_last_sp(f.unextended_sp());
}

inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, const frame& hf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
Unimplemented();
}

inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
inline void FreezeBase::prepare_freeze_interpreted_top_frame(frame& f) {
Unimplemented();
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/continuationFreezeThaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class FreezeBase : public StackObj {
inline void set_top_frame_metadata_pd(const frame& hf);
inline void patch_pd(frame& callee, const frame& caller);
void adjust_interpreted_frame_unextended_sp(frame& f);
static inline void prepare_freeze_interpreted_top_frame(const frame& f);
static inline void prepare_freeze_interpreted_top_frame(frame& f);
static inline void relativize_interpreted_frame_metadata(const frame& f, const frame& hf);

protected:
Expand Down
32 changes: 16 additions & 16 deletions src/hotspot/share/runtime/lightweightSynchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,10 @@ ObjectMonitor* LightweightSynchronizer::inflate_locked_or_imse(oop obj, ObjectSy
}
}

ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* inflating_thread, Thread* current) {
ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* locking_thread, Thread* current) {

// The JavaThread* inflating_thread parameter is only used by LM_LIGHTWEIGHT and requires
// that the inflating_thread == Thread::current() or is suspended throughout the call by
// The JavaThread* locking_thread parameter is only used by LM_LIGHTWEIGHT and requires
// that the locking_thread == Thread::current() or is suspended throughout the call by
// some other mechanism.
// Even with LM_LIGHTWEIGHT the thread might be nullptr when called from a non
// JavaThread. (As may still be the case from FastHashCode). However it is only
Expand All @@ -822,10 +822,10 @@ ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, O
// The mark can be in one of the following states:
// * inflated - Just return if using stack-locking.
// If using fast-locking and the ObjectMonitor owner
// is anonymous and the inflating_thread owns the
// object lock, then we make the inflating_thread
// is anonymous and the locking_thread owns the
// object lock, then we make the locking_thread
// the ObjectMonitor owner and remove the lock from
// the inflating_thread's lock stack.
// the locking_thread's lock stack.
// * fast-locked - Coerce it to inflated from fast-locked.
// * unlocked - Aggressively inflate the object.

Expand All @@ -835,31 +835,31 @@ ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, O
markWord dmw = inf->header();
assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value());
if (inf->has_anonymous_owner() &&
inflating_thread != nullptr && inflating_thread->lock_stack().contains(object)) {
inf->set_owner_from_anonymous(inflating_thread);
size_t removed = inflating_thread->lock_stack().remove(object);
locking_thread != nullptr && locking_thread->lock_stack().contains(object)) {
inf->set_owner_from_anonymous(locking_thread);
size_t removed = locking_thread->lock_stack().remove(object);
inf->set_recursions(removed - 1);
}
return inf;
}

// CASE: fast-locked
// Could be fast-locked either by the inflating_thread or by some other thread.
// Could be fast-locked either by the locking_thread or by some other thread.
//
// Note that we allocate the ObjectMonitor speculatively, _before_
// attempting to set the object's mark to the new ObjectMonitor. If
// the inflating_thread owns the monitor, then we set the ObjectMonitor's
// owner to the inflating_thread. Otherwise, we set the ObjectMonitor's owner
// the locking_thread owns the monitor, then we set the ObjectMonitor's
// owner to the locking_thread. Otherwise, we set the ObjectMonitor's owner
// to anonymous. If we lose the race to set the object's mark to the
// new ObjectMonitor, then we just delete it and loop around again.
//
if (mark.is_fast_locked()) {
ObjectMonitor* monitor = new ObjectMonitor(object);
monitor->set_header(mark.set_unlocked());
bool own = inflating_thread != nullptr && inflating_thread->lock_stack().contains(object);
bool own = locking_thread != nullptr && locking_thread->lock_stack().contains(object);
if (own) {
// Owned by inflating_thread.
monitor->set_owner(inflating_thread);
// Owned by locking_thread.
monitor->set_owner(locking_thread);
} else {
// Owned by somebody else.
monitor->set_anonymous_owner();
Expand All @@ -869,7 +869,7 @@ ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, O
if (old_mark == mark) {
// Success! Return inflated monitor.
if (own) {
size_t removed = inflating_thread->lock_stack().remove(object);
size_t removed = locking_thread->lock_stack().remove(object);
monitor->set_recursions(removed - 1);
}
// Once the ObjectMonitor is configured and object is associated
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/lightweightSynchronizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class LightweightSynchronizer : AllStatic {
static void enter(Handle obj, BasicLock* lock, JavaThread* current);
static void exit(oop object, JavaThread* current);

static ObjectMonitor* inflate_into_object_header(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* inflating_thread, Thread* current);
static ObjectMonitor* inflate_into_object_header(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* locking_thread, Thread* current);
static ObjectMonitor* inflate_locked_or_imse(oop object, ObjectSynchronizer::InflateCause cause, TRAPS);
static ObjectMonitor* inflate_fast_locked_object(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* locking_thread, JavaThread* current);
static ObjectMonitor* inflate_and_enter(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* locking_thread, JavaThread* current);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/objectMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ ObjectWaiter::~ObjectWaiter() {
}
}

oop ObjectWaiter::vthread() {
oop ObjectWaiter::vthread() const {
return _vthread.resolve();
}

Expand Down
18 changes: 9 additions & 9 deletions src/hotspot/share/runtime/objectMonitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class ObjectWaiter : public CHeapObj<mtThread> {
ObjectWaiter(JavaThread* current);
ObjectWaiter(oop vthread, ObjectMonitor* mon);
~ObjectWaiter();
JavaThread* thread() { return _thread; }
bool is_vthread() { return _thread == nullptr; }
uint8_t state() { return TState; }
ObjectMonitor* monitor() { return _monitor; }
bool is_monitorenter() { return !_is_wait; }
bool is_wait() { return _is_wait; }
bool notified() { return _notified; }
bool at_reenter() { return _at_reenter; }
oop vthread();
JavaThread* thread() const { return _thread; }
bool is_vthread() const { return _thread == nullptr; }
uint8_t state() const { return TState; }
ObjectMonitor* monitor() const { return _monitor; }
bool is_monitorenter() const { return !_is_wait; }
bool is_wait() const { return _is_wait; }
bool notified() const { return _notified; }
bool at_reenter() const { return _at_reenter; }
oop vthread() const;
void wait_reenter_begin(ObjectMonitor *mon);
void wait_reenter_end(ObjectMonitor *mon);
};
Expand Down
18 changes: 9 additions & 9 deletions src/hotspot/share/runtime/synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1437,8 +1437,8 @@ ObjectMonitor* ObjectSynchronizer::inflate_for(JavaThread* thread, oop obj, cons
return inflate_impl(thread, obj, cause);
}

ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oop object, const InflateCause cause) {
// The JavaThread* inflating_thread requires that the inflating_thread == Thread::current() or
ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* locking_thread, oop object, const InflateCause cause) {
// The JavaThread* locking_thread requires that the locking_thread == Thread::current() or
// is suspended throughout the call by some other mechanism.
// The thread might be nullptr when called from a non JavaThread. (As may still be
// the case from FastHashCode). However it is only important for correctness that the
Expand All @@ -1452,8 +1452,8 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo

// The mark can be in one of the following states:
// * inflated - If the ObjectMonitor owner is anonymous and the
// inflating_thread owns the object lock, then we
// make the inflating_thread the ObjectMonitor owner.
// locking_thread owns the object lock, then we
// make the locking_thread the ObjectMonitor owner.
// * stack-locked - Coerce it to inflated from stack-locked.
// * INFLATING - Busy wait for conversion from stack-locked to
// inflated.
Expand All @@ -1464,11 +1464,11 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
ObjectMonitor* inf = mark.monitor();
markWord dmw = inf->header();
assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value());
if (inf->has_anonymous_owner() && inflating_thread != nullptr) {
if (inf->has_anonymous_owner() && locking_thread != nullptr) {
assert(LockingMode == LM_LEGACY, "invariant");
if (inflating_thread->is_lock_owned((address)inf->stack_locker())) {
if (locking_thread->is_lock_owned((address)inf->stack_locker())) {
inf->set_stack_locker(nullptr);
inf->set_owner_from_anonymous(inflating_thread);
inf->set_owner_from_anonymous(locking_thread);
}
}
return inf;
Expand Down Expand Up @@ -1550,8 +1550,8 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
// Note that a thread can inflate an object
// that it has stack-locked -- as might happen in wait() -- directly
// with CAS. That is, we can avoid the xchg-nullptr .... ST idiom.
if (inflating_thread != nullptr && inflating_thread->is_lock_owned((address)mark.locker())) {
m->set_owner(inflating_thread);
if (locking_thread != nullptr && locking_thread->is_lock_owned((address)mark.locker())) {
m->set_owner(locking_thread);
} else {
// Use ANONYMOUS_OWNER to indicate that the owner is the BasicLock on the stack,
// and set the stack locker field in the monitor.
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/synchronizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ObjectSynchronizer : AllStatic {

private:
// Shared implementation between the different LockingMode.
static ObjectMonitor* inflate_impl(JavaThread* inflating_thread, oop obj, const InflateCause cause);
static ObjectMonitor* inflate_impl(JavaThread* locking_thread, oop obj, const InflateCause cause);

public:
// This version is only for internal use
Expand Down