Skip to content

Commit 29e4d9f

Browse files
committed
8231321: compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java failed assertion
Reviewed-by: thartmann, eosterlund
1 parent dd47d18 commit 29e4d9f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/hotspot/share/code/nmethod.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,6 @@ void nmethod::unlink_from_method() {
12931293
*/
12941294
bool nmethod::make_not_entrant_or_zombie(int state) {
12951295
assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
1296-
assert(!is_zombie(), "should not already be a zombie");
12971296

12981297
if (Atomic::load(&_state) >= state) {
12991298
// Avoid taking the lock if already in required state.
@@ -1316,20 +1315,18 @@ bool nmethod::make_not_entrant_or_zombie(int state) {
13161315
// This flag is used to remember whether we need to later lock and unregister.
13171316
bool nmethod_needs_unregister = false;
13181317

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-
13291318
{
13301319
// Enter critical section. Does not block for safepoint.
13311320
MutexLocker ml(CompiledMethod_lock->owned_by_self() ? NULL : CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
13321321

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+
13331330
if (Atomic::load(&_state) >= state) {
13341331
// another thread already performed this transition so nothing
13351332
// to do, but return false to indicate this.

0 commit comments

Comments
 (0)