RFR(one-liner): 8231321: compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java failed assertion

Robbin Ehn robbin.ehn at oracle.com
Wed Sep 25 08:12:07 UTC 2019


Hi all, please review.

We no longer allow state to ever go backwards.
So trying to make a zombie not-entrant is fine.
What happens is something like:
- make not-entrant
- safepoint
- deopt all => start iteration over nmethods
- picks up this not-entrant method, since it is alive
- sweeper turns it into a zombie
- we try making the nmethod not-entrant once more => assert

If we remove the assert the method would just returns false instead, which is 
expected.

Thanks, Robbin

Issue:
https://bugs.openjdk.java.net/browse/JDK-8231321

Changeset:
diff -r 448fe2bfd505 src/hotspot/share/code/nmethod.cpp
--- a/src/hotspot/share/code/nmethod.cpp	Tue Sep 24 08:54:39 2019 +0200
+++ b/src/hotspot/share/code/nmethod.cpp	Wed Sep 25 10:02:45 2019 +0200
@@ -1288,17 +1288,16 @@
    }
  }

  /**
   * Common functionality for both make_not_entrant and make_zombie
   */
  bool nmethod::make_not_entrant_or_zombie(int state) {
    assert(state == zombie || state == not_entrant, "must be zombie or 
not_entrant");
-  assert(!is_zombie(), "should not already be a zombie");

    if (Atomic::load(&_state) >= state) {
      // Avoid taking the lock if already in required state.
      // This is safe from races because the state is an end-state,
      // which the nmethod cannot back out of once entered.
      // No need for fencing either.
      return false;
    }


More information about the hotspot-compiler-dev mailing list