--- old/src/share/vm/code/nmethod.cpp 2013-09-09 15:38:51.156647173 +0200 +++ new/src/share/vm/code/nmethod.cpp 2013-09-09 15:38:51.052647177 +0200 @@ -1300,6 +1300,13 @@ assert(state == zombie || state == not_entrant, "must be zombie or not_entrant"); assert(!is_zombie(), "should not already be a zombie"); + // The state of nmethods that are currently locked by the VM must not change. + // Some operations such as setting ICs (e.g., SharedRuntime::resolve_sub_helper()) + // rely on this fact. + if (is_locked_by_vm()) { + return false; + } + // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below. nmethodLocker nml(this); methodHandle the_method(method()); @@ -1417,7 +1424,6 @@ // Make sweeper aware that there is a zombie method that needs to be removed NMethodSweeper::notify(this); - return true; }