# HG changeset patch # User iveresov # Date 1401299963 36000 # Node ID db68f26d4f1bc5a0c0d2a4192d488092f1a4b8ff # Parent 1db7e277df870cceecf76b15b1ceeedfeb64434f 8044090: C1: Old value instead of new one is passed to post-barrier in UnsafeGetAndSetObject Summary: Pass correct value to post-barrier in UnsafeGetAndSetObject Reviewed-by: roland, vlivanov diff -r 1db7e277df87 -r db68f26d4f1b hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp Wed May 28 14:42:00 2014 +0400 +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp Wed May 28 07:59:23 2014 -1000 @@ -1221,10 +1221,8 @@ bool is_obj = (type == T_ARRAY || type == T_OBJECT); LIR_Opr offset = off.result(); - if (data != dst) { - __ move(data, dst); - data = dst; - } + // Because we want a 2-arg form of xchg + __ move(data, dst); assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type"); LIR_Address* addr; @@ -1254,7 +1252,7 @@ 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);