--- a/hotspot/src/share/vm/runtime/sweeper.cpp Fri Sep 26 20:09:02 2014 -0700
+++ b/hotspot/src/share/vm/runtime/sweeper.cpp Mon Sep 29 08:40:51 2014 +0200
@@ -543,6 +543,10 @@
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
+ // nmethods during the next safepoint (see ICStub::finalize).
+ MutexLocker cl(CompiledIC_lock);
+ nm->clear_ic_stubs();
// Code cache state change is tracked in make_zombie()
nm->make_zombie();
_zombified_count++;