@@ -1293,7 +1293,6 @@ void nmethod::unlink_from_method() {
1293
1293
*/
1294
1294
bool nmethod::make_not_entrant_or_zombie (int state) {
1295
1295
assert (state == zombie || state == not_entrant, " must be zombie or not_entrant" );
1296
- assert (!is_zombie (), " should not already be a zombie" );
1297
1296
1298
1297
if (Atomic::load (&_state) >= state) {
1299
1298
// Avoid taking the lock if already in required state.
@@ -1316,20 +1315,18 @@ bool nmethod::make_not_entrant_or_zombie(int state) {
1316
1315
// This flag is used to remember whether we need to later lock and unregister.
1317
1316
bool nmethod_needs_unregister = false ;
1318
1317
1319
- // invalidate osr nmethod before acquiring the patching lock since
1320
- // they both acquire leaf locks and we don't want a deadlock.
1321
- // This logic is equivalent to the logic below for patching the
1322
- // verified entry point of regular methods. We check that the
1323
- // nmethod is in use to ensure that it is invalidated only once.
1324
- if (is_osr_method () && is_in_use ()) {
1325
- // this effectively makes the osr nmethod not entrant
1326
- invalidate_osr_method ();
1327
- }
1328
-
1329
1318
{
1330
1319
// Enter critical section. Does not block for safepoint.
1331
1320
MutexLocker ml (CompiledMethod_lock->owned_by_self () ? NULL : CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
1332
1321
1322
+ // This logic is equivalent to the logic below for patching the
1323
+ // verified entry point of regular methods. We check that the
1324
+ // nmethod is in use to ensure that it is invalidated only once.
1325
+ if (is_osr_method () && is_in_use ()) {
1326
+ // this effectively makes the osr nmethod not entrant
1327
+ invalidate_osr_method ();
1328
+ }
1329
+
1333
1330
if (Atomic::load (&_state) >= state) {
1334
1331
// another thread already performed this transition so nothing
1335
1332
// to do, but return false to indicate this.
0 commit comments