# HG changeset patch # User eosterlund # Date 1545298905 -3600 # Node ID 4384060a7ca5d9ad41af2bed157bffc1a114115f # Parent 293cec2f7670853fb3c4a945a1aaae7c19181383 8215491: ICStubInterface::finalize finds zombie nmethod with ZGC concurrent class unloading Reviewed-by: dlong, coleenp diff -r 293cec2f7670 -r 4384060a7ca5 src/hotspot/share/code/nmethod.cpp --- a/src/hotspot/share/code/nmethod.cpp Thu Dec 20 10:41:45 2018 +0100 +++ b/src/hotspot/share/code/nmethod.cpp Thu Dec 20 10:41:45 2018 +0100 @@ -1283,6 +1283,13 @@ flush_dependencies(/*delete_immediately*/true); } + // Clear ICStubs to prevent back patching stubs of zombie or flushed + // nmethods during the next safepoint (see ICStub::finalize). + { + CompiledICLocker ml(this); + clear_ic_stubs(); + } + // zombie only - if a JVMTI agent has enabled the CompiledMethodUnload // event and it hasn't already been reported for this nmethod then // report it now. The event may have been reported earlier if the GC diff -r 293cec2f7670 -r 4384060a7ca5 src/hotspot/share/runtime/sweeper.cpp --- a/src/hotspot/share/runtime/sweeper.cpp Thu Dec 20 10:41:45 2018 +0100 +++ b/src/hotspot/share/runtime/sweeper.cpp Thu Dec 20 10:41:45 2018 +0100 @@ -717,12 +717,6 @@ // stack we can safely convert it to a zombie method OrderAccess::loadload(); // _stack_traversal_mark and _state if (cm->can_convert_to_zombie()) { - // Clear ICStubs to prevent back patching stubs of zombie or flushed - // nmethods during the next safepoint (see ICStub::finalize). - { - CompiledICLocker ml(cm); - cm->clear_ic_stubs(); - } // Code cache state change is tracked in make_zombie() cm->make_zombie(); SWEEP(cm);