提交 a2dca877 编写于 作者: I iveresov

8024919: G1: SPECjbb2013 crashes due to a broken object reference

Summary: Pass correct new value to post_barrer() in Unsafe.getAndSetObject() C1 intrinsic
Reviewed-by: kvn, roland
上级 6bace759
...@@ -1468,19 +1468,18 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { ...@@ -1468,19 +1468,18 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
addr = new LIR_Address(src.result(), offset, type); addr = new LIR_Address(src.result(), offset, type);
} }
if (data != dst) { // Because we want a 2-arg form of xchg and xadd
__ move(data, dst); __ move(data, dst);
data = dst;
}
if (x->is_add()) { if (x->is_add()) {
__ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr);
} else { } else {
if (is_obj) { if (is_obj) {
// Do the pre-write barrier, if any. // Do the pre-write barrier, if any.
pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */,
true /* do_load */, false /* patch */, NULL); true /* do_load */, false /* patch */, NULL);
} }
__ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr);
if (is_obj) { if (is_obj) {
// Seems to be a precise address // Seems to be a precise address
post_barrier(LIR_OprFact::address(addr), data); post_barrier(LIR_OprFact::address(addr), data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册