enhancement of cmpxchg and copy_to_survivor for ppc64

Andrew Haley aph at redhat.com
Thu May 19 16:36:52 UTC 2016


There is one significant problem with this approach.

Atomic::cmpxchg(jint) is defined like this in atomic.cpp:

  unsigned Atomic::cmpxchg(unsigned int exchange_value,
                           volatile unsigned int* dest, unsigned int compare_value,
                           cmpxchg_memory_order order) {
    assert(sizeof(unsigned int) == sizeof(jint), "more work to do");
    return (unsigned int)Atomic::cmpxchg((jint)exchange_value, (volatile jint*)dest,
                                         (jint)compare_value, order);
  }

Because this is in atomic.cpp, there is a *runtime* test on the memory
order: the compiler can't constant propagate it.  If we're adding the
cmpxchg_memory_order I think we should move Atomic::cmpxchg(jint) to
atomic.inline.hpp.

Andrew.


More information about the hotspot-runtime-dev mailing list