RFR (M) 8152753: C1 intrinsics for CompareAndExchange (x86)

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu Apr 7 15:46:04 UTC 2016

On 04/07/2016 06:41 PM, Roland Westrelin wrote:
>>>   http://cr.openjdk.java.net/~shade/8152753/webrev.01/
> That c1_LIR.cpp change:
> 931       if (!opCompareAndSwap->_exchange)
> do_input(opCompareAndSwap->_cmp_value);
> doesn't seem right. Why do you need it?

CompareAndSwap produces boolean result, and kills cmp_value and
new_value. CompareAndExchange produces the "old"/null value result,
which is stored at the same position as cmp_value.

So, if you omit that line, LinearScan asserts when you are trying to use
the result of CompareAndExchange. AFAIU, removing the "input" property
from cmp_value, but leaving "temp" makes things back in order for


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160407/2b55edf9/signature.asc>

More information about the hotspot-compiler-dev mailing list