提交 75c54ddf 编写于 作者: J johnc

8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc.

Summary: In do_oop_store the uncompressed value of the oop being stored needs to be preserved and passed to g1_write_barrier_post. This is necessary for the heap region cross check to work correctly.
Reviewed-by: coleenp, johnc
Contributed-by: NMartin Doerr <martin.doerr@sap.com>
上级 b2b07841
......@@ -63,6 +63,13 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
noreg /* pre_val */,
tmp, true /*preserve_o_regs*/);
// G1 barrier needs uncompressed oop for region cross check.
Register new_val = val;
if (UseCompressedOops && val != G0) {
new_val = tmp;
__ mov(val, new_val);
}
if (index == noreg ) {
assert(Assembler::is_simm13(offset), "fix this code");
__ store_heap_oop(val, base, offset);
......@@ -79,7 +86,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
__ add(base, index, base);
}
}
__ g1_write_barrier_post(base, val, tmp);
__ g1_write_barrier_post(base, new_val, tmp);
}
}
break;
......
......@@ -158,14 +158,19 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
if (val == noreg) {
__ store_heap_oop_null(Address(rdx, 0));
} else {
// G1 barrier needs uncompressed oop for region cross check.
Register new_val = val;
if (UseCompressedOops) {
new_val = rbx;
__ movptr(new_val, val);
}
__ store_heap_oop(Address(rdx, 0), val);
__ g1_write_barrier_post(rdx /* store_adr */,
val /* new_val */,
new_val /* new_val */,
r15_thread /* thread */,
r8 /* tmp */,
rbx /* tmp2 */);
}
}
break;
#endif // INCLUDE_ALL_GCS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册