--- old/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp 2017-10-03 14:31:23.194897895 +0200 +++ new/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp 2017-10-03 14:31:22.966897903 +0200 @@ -27,19 +27,6 @@ // Implementation of class atomic -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_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_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; } - - template struct Atomic::PlatformAdd : Atomic::FetchAndAdd > @@ -102,9 +89,6 @@ } #ifdef AMD64 -inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; } -inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; } - template<> template inline D Atomic::PlatformAdd<8>::fetch_and_add(I add_value, D volatile* dest) const { @@ -144,8 +128,6 @@ return exchange_value; } -inline jlong Atomic::load(const volatile jlong* src) { return *src; } - #else // !AMD64 extern "C" { @@ -164,18 +146,21 @@ return cmpxchg_using_helper(_Atomic_cmpxchg_long, exchange_value, dest, compare_value); } -inline jlong Atomic::load(const volatile jlong* src) { +template<> +template +inline T Atomic::PlatformLoad<8>::operator()(T const volatile* src) const { + STATIC_ASSERT(8 == sizeof(T)); volatile jlong dest; - _Atomic_move_long(src, &dest); - return dest; -} - -inline void Atomic::store(jlong store_value, jlong* dest) { - _Atomic_move_long((volatile jlong*)&store_value, (volatile jlong*)dest); + _Atomic_move_long(reinterpret_cast(src), reinterpret_cast(&dest)); + return PrimitiveConversions::cast(dest); } -inline void Atomic::store(jlong store_value, volatile jlong* dest) { - _Atomic_move_long((volatile jlong*)&store_value, dest); +template<> +template +inline void Atomic::PlatformStore<8>::operator()(T store_value, + T volatile* dest) const { + STATIC_ASSERT(8 == sizeof(T)); + _Atomic_move_long(reinterpret_cast(&store_value), reinterpret_cast(dest)); } #endif // AMD64