RFR: 8214302: Allow safely calling is_unloading() on zombie nmethods

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Nov 27 00:40:45 UTC 2018

Hi Erik,

Can you tell if there is any concurrency window where you check is_zombie and store new unloading state - can other 
thread change nmethod to zombie?

I also noticed that CodeCache::unloading_cycle() is called twice in this code. Can we cache it in local?


On 11/26/18 7:30 AM, Erik Österlund wrote:
> Hi,
> It is currently not safe to call is_unloading on zombie nmethods, unless it has been observed to be alive. It should be 
> supported to make the code less fragile. When encountering a !is_alive() nmethod that has not had its unloading epoch 
> updated, and ask if it is_unloading(), the answer is always false. So by adding that, is_unloading() can always be 
> safely called.
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8214302/webrev.00/
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8214302
> Thanks,
> /Erik

More information about the hotspot-compiler-dev mailing list