--- a/src/hotspot/share/gc/z/zNMethod.cpp Wed Sep 25 09:15:43 2019 +0200
+++ b/src/hotspot/share/gc/z/zNMethod.cpp Thu Sep 26 10:00:07 2019 +0000
@@ -294,13 +294,14 @@
return;
}
- ZLocker<ZReentrantLock> locker(ZNMethod::lock_for_nmethod(nm));
-
if (nm->is_unloading()) {
+ ZLocker<ZReentrantLock> locker(ZNMethod::lock_for_nmethod(nm));
unlink(nm);
return;
}
+ ZLocker<ZReentrantLock> locker(ZNMethod::lock_for_nmethod(nm));
+
// Heal oops and disarm
ZNMethodOopClosure cl;
ZNMethod::nmethod_oops_do(nm, &cl);