Skip to content

Commit 9d07259

Browse files
committed
8255598: [PPC64] assert(Universe::heap()->is_in(result)) failed: object not in heap
Reviewed-by: ayang, tschatzl
1 parent e281b13 commit 9d07259

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hotspot/cpu/ppc/nativeInst_ppc.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ intptr_t NativeMovConstReg::data() const {
197197
CodeBlob* cb = CodeCache::find_blob_unsafe(addr);
198198
if (MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) {
199199
narrowOop no = MacroAssembler::get_narrow_oop(addr, cb->content_begin());
200-
return cast_from_oop<intptr_t>(CompressedOops::decode(no));
200+
// We can reach here during GC with 'no' pointing to new object location
201+
// while 'heap()->is_in' still reports false (e.g. with SerialGC).
202+
// Therefore we use raw decoding.
203+
if (CompressedOops::is_null(no)) return 0;
204+
return cast_from_oop<intptr_t>(CompressedOops::decode_raw(no));
201205
} else {
202206
assert(MacroAssembler::is_load_const_from_method_toc_at(addr), "must be load_const_from_pool");
203207

0 commit comments

Comments
 (0)