--- old/src/os_cpu/linux_s390/vm/atomic_linux_s390.hpp 2017-07-14 18:05:36.854232824 +0200 +++ new/src/os_cpu/linux_s390/vm/atomic_linux_s390.hpp 2017-07-14 18:05:36.706232829 +0200 @@ -53,19 +53,6 @@ // is an integer multiple of the data length. Furthermore, all stores are ordered: // a store which occurs conceptually before another store becomes visible to other CPUs // before the other store becomes visible. -inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } -inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } -inline void Atomic::store (jint store_value, jint* dest) { *dest = store_value; } -inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; } -inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; } -inline void Atomic::store_ptr(void* store_value, void* dest) { *(void**)dest = store_value; } - -inline void Atomic::store (jbyte store_value, volatile jbyte* dest) { *dest = store_value; } -inline void Atomic::store (jshort store_value, volatile jshort* dest) { *dest = store_value; } -inline void Atomic::store (jint store_value, volatile jint* dest) { *dest = store_value; } -inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; } -inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; } -inline void Atomic::store_ptr(void* store_value, volatile void* dest) { *(void* volatile *)dest = store_value; } //------------ @@ -82,7 +69,8 @@ // The return value of the method is the value that was successfully stored. At the // time the caller receives back control, the value in memory may have changed already. -inline jint Atomic::add(jint inc, volatile jint*dest) { +template <> +inline int32_t Atomic::specialized_add(int32_t inc, volatile int32_t* dest) { unsigned int old, upd; if (VM_Version::has_LoadAndALUAtomicV1()) { @@ -124,11 +112,12 @@ ); } - return (jint)upd; + return (int32_t)upd; } -inline intptr_t Atomic::add_ptr(intptr_t inc, volatile intptr_t* dest) { +template <> +inline int64_t Atomic::specialized_add(int64_t inc, volatile int64_t* dest) { unsigned long old, upd; if (VM_Version::has_LoadAndALUAtomicV1()) { @@ -170,15 +159,11 @@ ); } - return (intptr_t)upd; + return (int64_t)upd; } -inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest) { - return (void*)add_ptr(add_value, (volatile intptr_t*)dest); -} - - //------------ + // Atomic::inc //------------ // These methods force the value in memory to be incremented (augmented by 1). @@ -189,7 +174,8 @@ // The value in memory is updated by using a compare-and-swap instruction. The // instruction is retried as often as required. -inline void Atomic::inc(volatile jint* dest) { +template <> +inline void Atomic::specialized_inc(volatile int32_t* dest) { unsigned int old, upd; if (VM_Version::has_LoadAndALUAtomicV1()) { @@ -234,7 +220,8 @@ } } -inline void Atomic::inc_ptr(volatile intptr_t* dest) { +template <> +inline void Atomic::specialized_inc(volatile int64_t* dest) { unsigned long old, upd; if (VM_Version::has_LoadAndALUAtomicV1()) { @@ -278,9 +265,6 @@ } } -inline void Atomic::inc_ptr(volatile void* dest) { - inc_ptr((volatile intptr_t*)dest); -} //------------ // Atomic::dec @@ -293,7 +277,8 @@ // The value in memory is updated by using a compare-and-swap instruction. The // instruction is retried as often as required. -inline void Atomic::dec(volatile jint* dest) { +template <> +inline void Atomic::specialized_dec(volatile int32_t* dest) { unsigned int old, upd; if (VM_Version::has_LoadAndALUAtomicV1()) { @@ -340,7 +325,8 @@ } } -inline void Atomic::dec_ptr(volatile intptr_t* dest) { +template <> +inline void Atomic::specialized_dec(volatile int64_t* dest) { unsigned long old, upd; if (VM_Version::has_LoadAndALUAtomicV1()) { @@ -387,9 +373,6 @@ } } -inline void Atomic::dec_ptr(volatile void* dest) { - dec_ptr((volatile intptr_t*)dest); -} //------------- // Atomic::xchg @@ -407,7 +390,8 @@ // // The return value is the (unchanged) value from memory as it was when the // replacement succeeded. -inline jint Atomic::xchg (jint xchg_val, volatile jint* dest) { +template <> +inline int32_t Atomic::specialized_xchg(int32_t xchg_val, volatile int32_t* dest) { unsigned int old; __asm__ __volatile__ ( @@ -423,10 +407,11 @@ : "cc" ); - return (jint)old; + return (int32_t)old; } -inline intptr_t Atomic::xchg_ptr(intptr_t xchg_val, volatile intptr_t* dest) { +template <> +inline int64_t Atomic::specialized_xchg(int64_t xchg_val, volatile int64_t* dest) { unsigned long old; __asm__ __volatile__ ( @@ -445,9 +430,6 @@ return (intptr_t)old; } -inline void *Atomic::xchg_ptr(void *exchange_value, volatile void *dest) { - return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); -} //---------------- // Atomic::cmpxchg @@ -478,7 +460,8 @@ // function is performed before the operand is fetched and again after the // operation is completed." -jint Atomic::cmpxchg(jint xchg_val, volatile jint* dest, jint cmp_val, cmpxchg_memory_order unused) { +template <> +inline int32_t Atomic::specialized_cmpxchg(int32_t xchg_val, volatile int32_t* dest, int32_t cmp_val, cmpxchg_memory_order order) { unsigned long old; __asm__ __volatile__ ( @@ -493,10 +476,11 @@ : "cc" ); - return (jint)old; + return (int32_t)old; } -jlong Atomic::cmpxchg(jlong xchg_val, volatile jlong* dest, jlong cmp_val, cmpxchg_memory_order unused) { +template <> +inline int64_t Atomic::specialized_cmpxchg(int64_t xchg_val, volatile int64_t* dest, int64_t cmp_val, cmpxchg_memory_order order) { unsigned long old; __asm__ __volatile__ ( @@ -511,17 +495,7 @@ : "cc" ); - return (jlong)old; -} - -void* Atomic::cmpxchg_ptr(void *xchg_val, volatile void* dest, void* cmp_val, cmpxchg_memory_order unused) { - return (void*)cmpxchg((jlong)xchg_val, (volatile jlong*)dest, (jlong)cmp_val, unused); + return (int64_t)old; } -intptr_t Atomic::cmpxchg_ptr(intptr_t xchg_val, volatile intptr_t* dest, intptr_t cmp_val, cmpxchg_memory_order unused) { - return (intptr_t)cmpxchg((jlong)xchg_val, (volatile jlong*)dest, (jlong)cmp_val, unused); -} - -inline jlong Atomic::load(const volatile jlong* src) { return *src; } - #endif // OS_CPU_LINUX_S390_VM_ATOMIC_LINUX_S390_INLINE_HPP