Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @ 17953:273a462437e9
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
author | iveresov |
---|---|
date | Wed, 28 May 2014 07:59:23 -1000 |
parents | b800986664f4 |
children | 2fd0fd493045 |
comparison
equal
deleted
inserted
replaced
17952:09619752c16d | 17953:273a462437e9 |
---|---|
1219 LIR_Opr dst = rlock_result(x, type); | 1219 LIR_Opr dst = rlock_result(x, type); |
1220 LIR_Opr data = value.result(); | 1220 LIR_Opr data = value.result(); |
1221 bool is_obj = (type == T_ARRAY || type == T_OBJECT); | 1221 bool is_obj = (type == T_ARRAY || type == T_OBJECT); |
1222 LIR_Opr offset = off.result(); | 1222 LIR_Opr offset = off.result(); |
1223 | 1223 |
1224 if (data != dst) { | 1224 // Because we want a 2-arg form of xchg |
1225 __ move(data, dst); | 1225 __ move(data, dst); |
1226 data = dst; | |
1227 } | |
1228 | 1226 |
1229 assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type"); | 1227 assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type"); |
1230 LIR_Address* addr; | 1228 LIR_Address* addr; |
1231 if (offset->is_constant()) { | 1229 if (offset->is_constant()) { |
1232 | 1230 |
1252 ptr = new_pointer_register(); | 1250 ptr = new_pointer_register(); |
1253 __ add(src.result(), off.result(), ptr); | 1251 __ add(src.result(), off.result(), ptr); |
1254 pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */, | 1252 pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */, |
1255 true /* do_load */, false /* patch */, NULL); | 1253 true /* do_load */, false /* patch */, NULL); |
1256 } | 1254 } |
1257 __ xchg(LIR_OprFact::address(addr), data, dst, tmp); | 1255 __ xchg(LIR_OprFact::address(addr), dst, dst, tmp); |
1258 if (is_obj) { | 1256 if (is_obj) { |
1259 // Seems to be a precise address | 1257 // Seems to be a precise address |
1260 post_barrier(ptr, data); | 1258 post_barrier(ptr, data); |
1261 } | 1259 } |
1262 } | 1260 } |