Skip to content

Commit af6eddc

Browse files
neethu-prasadTheRealMDoerr
authored andcommittedJun 12, 2024
8333716: Shenandoah: Check for disarmed method before taking the nmethod lock
Reviewed-by: shade Backport-of: 18e7d7b5e710b24e49b995777906a197e35795e6
1 parent 160ea22 commit af6eddc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@
3636
#include "runtime/threadWXSetters.inline.hpp"
3737

3838
bool ShenandoahBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) {
39+
if (!is_armed(nm)) {
40+
// Some other thread got here first and healed the oops
41+
// and disarmed the nmethod. No need to continue.
42+
return true;
43+
}
44+
3945
ShenandoahReentrantLock* lock = ShenandoahNMethod::lock_for_nmethod(nm);
4046
assert(lock != nullptr, "Must be");
4147
ShenandoahReentrantLocker locker(lock);
4248

4349
if (!is_armed(nm)) {
44-
// Some other thread got here first and healed the oops
45-
// and disarmed the nmethod.
50+
// Some other thread managed to complete while we were
51+
// waiting for lock. No need to continue.
4652
return true;
4753
}
4854

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jun 12, 2024

@openjdk-notifier[bot]
Please sign in to comment.