--- old/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp 2017-10-03 14:31:24.030897866 +0200 +++ new/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp 2017-10-03 14:31:23.766897875 +0200 @@ -159,20 +159,6 @@ } #endif // ARM -inline void Atomic::store(jint store_value, volatile jint* dest) { -#if !defined(ARM) && !defined(M68K) - __sync_synchronize(); -#endif - *dest = store_value; -} - -inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { -#if !defined(ARM) && !defined(M68K) - __sync_synchronize(); -#endif - *dest = store_value; -} - template struct Atomic::PlatformAdd : Atomic::AddAndFetch > @@ -275,18 +261,21 @@ return __sync_val_compare_and_swap(dest, compare_value, exchange_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; - os::atomic_copy64(src, &dest); - return dest; -} - -inline void Atomic::store(jlong store_value, jlong* dest) { - os::atomic_copy64((volatile jlong*)&store_value, (volatile jlong*)dest); + os::atomic_copy64(reinterpret_cast(src), reinterpret_cast(&dest)); + return PrimitiveConversions::cast(dest); } -inline void Atomic::store(jlong store_value, volatile jlong* dest) { - os::atomic_copy64((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)); + os::atomic_copy64(reinterpret_cast(&store_value), reinterpret_cast(dest)); } #endif // OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_HPP