There was an error while loading. Please reload this page.
1 parent 89f7e19 commit feccf3cCopy full SHA for feccf3c
1 file changed
src/hotspot/share/code/debugInfo.cpp
@@ -51,7 +51,15 @@ void DebugInfoWriteStream::write_metadata(Metadata* h) {
51
}
52
53
oop DebugInfoReadStream::read_oop() {
54
- oop o = code()->oop_at(read_int());
+ nmethod* nm = const_cast<CompiledMethod*>(code())->as_nmethod_or_null();
55
+ oop o;
56
+ if (nm != NULL) {
57
+ // Despite these oops being found inside nmethods that are on-stack,
58
+ // they are not kept alive by all GCs (e.g. G1 and Shenandoah).
59
+ o = nm->oop_at_phantom(read_int());
60
+ } else {
61
+ o = code()->oop_at(read_int());
62
+ }
63
assert(oopDesc::is_oop_or_null(o), "oop only");
64
return o;
65
0 commit comments