--- old/src/share/vm/code/nmethod.cpp 2013-08-21 09:41:17.632701606 +0200 +++ new/src/share/vm/code/nmethod.cpp 2013-08-21 09:41:17.462044697 +0200 @@ -93,18 +93,21 @@ #endif bool nmethod::is_compiled_by_c1() const { - if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing - if (is_native_method()) return false; + if (compiler() == NULL) return false; + // method() == NULL can happen during debug printing or if the nmethod is zombie + assert(method() == NULL || !is_native_method(), "native methods have no compiler"); return compiler()->is_c1(); } bool nmethod::is_compiled_by_c2() const { - if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing - if (is_native_method()) return false; + if (compiler() == NULL) return false; + // method() == NULL can happen during debug printing or if the nmethod is zombie + assert(method() == NULL || !is_native_method(), "native methods have no compiler"); return compiler()->is_c2(); } bool nmethod::is_compiled_by_shark() const { - if (is_native_method()) return false; - assert(compiler() != NULL, "must be"); + if (compiler() == NULL) return false; + // method() == NULL can happen during debug printing or if the nmethod is zombie + assert(method() == NULL || !is_native_method(), "native methods have no compiler"); return compiler()->is_shark(); } @@ -1382,6 +1385,8 @@ // nmethods aren't scanned for GC. _oops_are_stale = true; #endif + _method = NULL; // the Method may be reclaimed by class unloading + // now that the nmethod is in zombie state } else { assert(state == not_entrant, "other cases may need to be handled differently"); }