jdk.internal.misc.Unsafe.weakCompareAndSwapObject

Andrew Dinn adinn at redhat.com
Wed Feb 24 18:04:23 UTC 2016


On 24/02/16 17:33, Andrew Haley wrote:
> On 02/24/2016 05:29 PM, Andrew Haley wrote:
>> What are the semantics of Unsafe.weakCompareAndSwapObject?
>> These methods seem to be undocumented.
>>
>> Here's my guess:
>>
>> compareAndSwapObject : acquire, release
>> weakCompareAndSwapObject: nothing
>> weakCompareAndSwapObjectAcquire: acquire
>> weakCompareAndSwapObjectRelease: release
> 
> ...but not all of these seem to have C2 graph nodes.  I can only see
> WeakCompareAndSwapX and CompareAndExchangeX.
> 
> I'm guessing that WeakCompareAndSwapX corresponds to no acquire
> and no release; CompareAndExchangeX is an acquire and a release.

Are you making this change for AArch64? If so then the important
question here is whether these are generated in graph shapes which
include a MemBarAcquire or MemBarRelease. The AArch64 predicates which
elide the barriers for these nodes are tuned only to the presence of
CompareAndSwapX and expect to see a MemBarAcquire or MemBarRelease
wrapped around it. They will not currently match subgraphs which contain
these other nodes or which omit the membars.

regards,


Andrew Dinn
-----------



More information about the hotspot-dev mailing list