Skip to content
Permalink
Browse files

8235669: G1: Stack walking API can expose AS_NO_KEEPALIVE oops

Reviewed-by: kbarrett, tschatzl
  • Loading branch information
fisk committed Jan 10, 2020
1 parent 89f7e19 commit feccf3cdb6a99459a40612bf1b79d0a4a3d8ee99
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/hotspot/share/code/debugInfo.cpp
@@ -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;
}

0 comments on commit feccf3c

Please sign in to comment.