RFR: 8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms

Paul Hohensee paul.hohensee at gmail.com
Tue Oct 14 18:25:26 UTC 2014


David Holmes asked me to take a look at this

>>>> There is now a new webrev with my jbyte cmpxchg changes here:
>>>> http://cr.openjdk.java.net/~jwilhelm/8058255/webrev.01

and comment, so...

The approach is good if you're going to stay with the current framework,
except that I'd get rid of VM_HAS_SPECIALIZED_BYTE_CMPXCHG (#ifdef's are
the devil).  Just call cmpxchg_general (which should be named
cmpxchgb_general or maybe cmpxchgb_unspecialized, btw) from an os_cpu file
as needed.  I.e., no change to atomic.inline.hpp needed.  Another way to
look at it is, cmpxchgb_general/unspecialized is the implementation of
another specialized version of cmpxchgb, on the same abstraction level as
the asm versions.

If a rewrite is possible, I'd do it the way David suggests with an
AbstractAtomic class from which per-platform Atomic classes are derived.
That's the way VM_Version and ICache are defined.

Paul


More information about the hotspot-dev mailing list