mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8016277
: Crash in nmethod::is_compiled_by_c1() on x86
Method pointer for zombie methods may be invalid Reviewed-by: kvn, coleenp
This commit is contained in:
parent
f188c2bf70
commit
515a7df996
1 changed files with 12 additions and 6 deletions
|
@ -93,18 +93,21 @@ HS_DTRACE_PROBE_DECL6(hotspot, compiled__method__unload,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool nmethod::is_compiled_by_c1() const {
|
bool nmethod::is_compiled_by_c1() const {
|
||||||
if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing
|
if (compiler() == NULL) {
|
||||||
if (is_native_method()) return false;
|
return false;
|
||||||
|
}
|
||||||
return compiler()->is_c1();
|
return compiler()->is_c1();
|
||||||
}
|
}
|
||||||
bool nmethod::is_compiled_by_c2() const {
|
bool nmethod::is_compiled_by_c2() const {
|
||||||
if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing
|
if (compiler() == NULL) {
|
||||||
if (is_native_method()) return false;
|
return false;
|
||||||
|
}
|
||||||
return compiler()->is_c2();
|
return compiler()->is_c2();
|
||||||
}
|
}
|
||||||
bool nmethod::is_compiled_by_shark() const {
|
bool nmethod::is_compiled_by_shark() const {
|
||||||
if (is_native_method()) return false;
|
if (compiler() == NULL) {
|
||||||
assert(compiler() != NULL, "must be");
|
return false;
|
||||||
|
}
|
||||||
return compiler()->is_shark();
|
return compiler()->is_shark();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1401,6 +1404,9 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
|
||||||
// nmethods aren't scanned for GC.
|
// nmethods aren't scanned for GC.
|
||||||
_oops_are_stale = true;
|
_oops_are_stale = true;
|
||||||
#endif
|
#endif
|
||||||
|
// the Method may be reclaimed by class unloading now that the
|
||||||
|
// nmethod is in zombie state
|
||||||
|
set_method(NULL);
|
||||||
} else {
|
} else {
|
||||||
assert(state == not_entrant, "other cases may need to be handled differently");
|
assert(state == not_entrant, "other cases may need to be handled differently");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue