src/share/vm/code/nmethod.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.cpp
Print this page
rev 5099 : 8016277: Crash in nmethod::is_compiled_by_c1() on x86
Summary: Method pointer for zombie methods may be invalid
Reviewed-by:
*** 91,112 ****
#define DTRACE_METHOD_UNLOAD_PROBE(method)
#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;
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;
return compiler()->is_c2();
}
bool nmethod::is_compiled_by_shark() const {
! if (is_native_method()) return false;
! assert(compiler() != NULL, "must be");
return compiler()->is_shark();
}
--- 91,115 ----
#define DTRACE_METHOD_UNLOAD_PROBE(method)
#endif
bool nmethod::is_compiled_by_c1() const {
! 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) 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 (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();
}
*** 1380,1389 ****
--- 1383,1394 ----
#ifdef ASSERT
// It's no longer safe to access the oops section since zombie
// 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");
}
if (TraceCreateZombies) {
src/share/vm/code/nmethod.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File