8059735: make_not_entrant_or_zombie sees zombies
Make sure nmethod is not set to zombie state twice by sweeper and safepoint code. Reviewed-by: kvn, anoll, mgerdin
This commit is contained in:
parent
82171aa7ab
commit
3ed02be10e
@ -540,17 +540,25 @@ int NMethodSweeper::process_nmethod(nmethod *nm) {
|
|||||||
// If there are no current activations of this method on the
|
// If there are no current activations of this method on the
|
||||||
// stack we can safely convert it to a zombie method
|
// stack we can safely convert it to a zombie method
|
||||||
if (nm->can_not_entrant_be_converted()) {
|
if (nm->can_not_entrant_be_converted()) {
|
||||||
if (PrintMethodFlushing && Verbose) {
|
|
||||||
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
|
|
||||||
}
|
|
||||||
// Clear ICStubs to prevent back patching stubs of zombie or unloaded
|
// Clear ICStubs to prevent back patching stubs of zombie or unloaded
|
||||||
// nmethods during the next safepoint (see ICStub::finalize).
|
// nmethods during the next safepoint (see ICStub::finalize).
|
||||||
MutexLocker cl(CompiledIC_lock);
|
{
|
||||||
nm->clear_ic_stubs();
|
MutexLocker cl(CompiledIC_lock);
|
||||||
// Code cache state change is tracked in make_zombie()
|
nm->clear_ic_stubs();
|
||||||
nm->make_zombie();
|
}
|
||||||
_zombified_count++;
|
// Acquiring the CompiledIC_lock may block for a safepoint and set the
|
||||||
SWEEP(nm);
|
// nmethod to zombie (see 'CodeCache::make_marked_nmethods_zombies').
|
||||||
|
// Check if nmethod is still non-entrant at this point.
|
||||||
|
if (nm->is_not_entrant()) {
|
||||||
|
if (PrintMethodFlushing && Verbose) {
|
||||||
|
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
|
||||||
|
}
|
||||||
|
// Code cache state change is tracked in make_zombie()
|
||||||
|
nm->make_zombie();
|
||||||
|
_zombified_count++;
|
||||||
|
SWEEP(nm);
|
||||||
|
}
|
||||||
|
assert(nm->is_zombie(), "nmethod must be zombie");
|
||||||
} else {
|
} else {
|
||||||
// Still alive, clean up its inline caches
|
// Still alive, clean up its inline caches
|
||||||
MutexLocker cl(CompiledIC_lock);
|
MutexLocker cl(CompiledIC_lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user