Mercurial > hg > truffle
comparison src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @ 13022:946a8294ab15
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
author | iveresov |
---|---|
date | Thu, 31 Oct 2013 04:16:40 -0700 |
parents | 7944aba7ba41 |
children | 4d7678fb8a27 |
comparison
equal
deleted
inserted
replaced
13021:4d3575d37a07 | 13022:946a8294ab15 |
---|---|
1466 #endif | 1466 #endif |
1467 } else { | 1467 } else { |
1468 addr = new LIR_Address(src.result(), offset, type); | 1468 addr = new LIR_Address(src.result(), offset, type); |
1469 } | 1469 } |
1470 | 1470 |
1471 if (data != dst) { | 1471 // Because we want a 2-arg form of xchg and xadd |
1472 __ move(data, dst); | 1472 __ move(data, dst); |
1473 data = dst; | 1473 |
1474 } | |
1475 if (x->is_add()) { | 1474 if (x->is_add()) { |
1476 __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); | 1475 __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); |
1477 } else { | 1476 } else { |
1478 if (is_obj) { | 1477 if (is_obj) { |
1479 // Do the pre-write barrier, if any. | 1478 // Do the pre-write barrier, if any. |
1480 pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, | 1479 pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, |
1481 true /* do_load */, false /* patch */, NULL); | 1480 true /* do_load */, false /* patch */, NULL); |
1482 } | 1481 } |
1483 __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); | 1482 __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); |
1484 if (is_obj) { | 1483 if (is_obj) { |
1485 // Seems to be a precise address | 1484 // Seems to be a precise address |
1486 post_barrier(LIR_OprFact::address(addr), data); | 1485 post_barrier(LIR_OprFact::address(addr), data); |
1487 } | 1486 } |
1488 } | 1487 } |