RFR: 8234426: Sweeper should not CompiledIC::set_to_clean with ICStubs for is_unloading() nmethods

erik.osterlund at oracle.com erik.osterlund at oracle.com
Fri Nov 22 10:49:11 UTC 2019


When the sweeper processes an nmethod, it will clean inline caches if it 
Today, the cleaning will utilize transitional states (using ICStubs) if 
the nmethod is_alive(),
which is always true for the sweeper. If it runs out of ICStubs, it 
might have to safepoint
to refill them. When it does, the currently processed nmethod might be 
That is not a problem for the GC per se (safepoint operation fusing with 
mark end), but it
is a problem for heap walkers that get confused that an nmethod 
reachable from a thread is unloading
and hence has dead oops in it. This sweeper nmethod is the *only* 
nmethod that violates an
invariant that nmethods reachable from threads (Thread::nmethods_do) are 
not unloading.

By simply changing the condition to not use ICStubs when the nmethod 
is_unloading(), we
get this neat invariant, and code gets less confused about this.




More information about the hotspot-dev mailing list