Testing hotspot's Atomic::cmpxchg(jbyte*) ?

David Holmes david.holmes at oracle.com
Fri Aug 19 05:15:16 UTC 2016

No I didn't send this to the wrong mailing list :)

I need to test the jbyte version of Atomic::cmpxchg in the VM, but so 
far it doesn't seem to be the case that any library code will actually 
invoke it. At the top Java level there is no AtomicByte class. Unsafe 
defines compareAndSwapByte variants but implements them using 
compareAndSwapInt and isolating the byte of interest. VarHandles seems 
to have direct *SwapByte operations but I can't figure out what they map 
to - there are VM intrinsics but again I can't the actual implementation 
to see if it uses Atomic::cmpxchg(jbyte*).

So can someone (Aleksey?, Paul? :) ) tell me if this code does get used, 
and if not what I need to change to make it get used. And then what 
tests exist to exercise this?


More information about the core-libs-dev mailing list