mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8235669: G1: Stack walking API can expose AS_NO_KEEPALIVE oops
Reviewed-by: kbarrett, tschatzl
This commit is contained in:
parent
89f7e1925e
commit
feccf3cdb6
1 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue