8044090: C1: Old value instead of new one is passed to post-barrier in UnsafeGetAndSetObject

Pass correct value to post-barrier in UnsafeGetAndSetObject

Reviewed-by: roland, vlivanov
This commit is contained in:
Igor Veresov 2014-05-28 07:59:23 -10:00
parent cd910ffebb
commit 3966e14be8

View File

@ -1221,10 +1221,8 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
bool is_obj = (type == T_ARRAY || type == T_OBJECT);
LIR_Opr offset = off.result();
if (data != dst) {
// Because we want a 2-arg form of xchg
__ move(data, dst);
data = dst;
}
assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type");
LIR_Address* addr;
@ -1254,7 +1252,7 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */,
true /* do_load */, false /* patch */, NULL);
}
__ xchg(LIR_OprFact::address(addr), data, dst, tmp);
__ xchg(LIR_OprFact::address(addr), dst, dst, tmp);
if (is_obj) {
// Seems to be a precise address
post_barrier(ptr, data);