8235669: G1: Stack walking API can expose AS_NO_KEEPALIVE oops
Reviewed-by: kbarrett, tschatzl
This commit is contained in:
parent
89f7e1925e
commit
feccf3cdb6
@ -51,7 +51,15 @@ void DebugInfoWriteStream::write_metadata(Metadata* h) {
|
||||
}
|
||||
|
||||
oop DebugInfoReadStream::read_oop() {
|
||||
oop o = code()->oop_at(read_int());
|
||||
nmethod* nm = const_cast<CompiledMethod*>(code())->as_nmethod_or_null();
|
||||
oop o;
|
||||
if (nm != NULL) {
|
||||
// Despite these oops being found inside nmethods that are on-stack,
|
||||
// they are not kept alive by all GCs (e.g. G1 and Shenandoah).
|
||||
o = nm->oop_at_phantom(read_int());
|
||||
} else {
|
||||
o = code()->oop_at(read_int());
|
||||
}
|
||||
assert(oopDesc::is_oop_or_null(o), "oop only");
|
||||
return o;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user