8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc
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
This commit is contained in:
parent
7f78a7f475
commit
d61a4656e4
hotspot/src/cpu
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user