--- old/src/hotspot/share/runtime/atomic.hpp 2019-11-21 11:52:15.138035102 +0100 +++ new/src/hotspot/share/runtime/atomic.hpp 2019-11-21 11:52:14.706028043 +0100 @@ -79,13 +79,13 @@ // The type T must be either a pointer type convertible to or equal // to D, an integral/enum type equal to D, or a type equal to D that // is primitive convertible using PrimitiveConversions. - template - inline static void store(T store_value, volatile D* dest); + template + inline static void store(volatile D* dest, T store_value); - template + template inline static void release_store(volatile D* dest, T store_value); - template + template inline static void release_store_fence(volatile D* dest, T store_value); // Atomically load from a location @@ -168,7 +168,7 @@ // Dispatch handler for store. Provides type-based validity // checking and limited conversions around calls to the platform- // specific implementation layer provided by PlatformOp. - template + template struct StoreImpl; // Platform-specific implementation of store. Support for sizes @@ -450,9 +450,9 @@ PlatformOp, typename EnableIf::value || IsRegisteredEnum::value>::type> { - void operator()(T new_value, T volatile* dest) const { + void operator()(T volatile* dest, T new_value) const { // Forward to the platform handler for the size of T. - PlatformOp()(new_value, dest); + PlatformOp()(dest, new_value); } }; @@ -461,16 +461,16 @@ // The new_value must be implicitly convertible to the // destination's type; it must be type-correct to store the // new_value in the destination. -template +template struct Atomic::StoreImpl< - T*, D*, + D*, T*, PlatformOp, typename EnableIf::value>::type> { - void operator()(T* new_value, D* volatile* dest) const { + void operator()(D* volatile* dest, T* new_value) const { // Allow derived to base conversion, and adding cv-qualifiers. D* value = new_value; - PlatformOp()(value, dest); + PlatformOp()(dest, value); } }; @@ -486,12 +486,12 @@ PlatformOp, typename EnableIf::value>::type> { - void operator()(T new_value, T volatile* dest) const { + void operator()(T volatile* dest, T new_value) const { typedef PrimitiveConversions::Translate Translator; typedef typename Translator::Decayed Decayed; STATIC_ASSERT(sizeof(T) == sizeof(Decayed)); - PlatformOp()(Translator::decay(new_value), - reinterpret_cast(dest)); + PlatformOp()(reinterpret_cast(dest), + Translator::decay(new_value)); } }; @@ -504,8 +504,8 @@ template struct Atomic::PlatformStore { template - void operator()(T new_value, - T volatile* dest) const { + void operator()(T volatile* dest, + T new_value) const { STATIC_ASSERT(sizeof(T) <= sizeof(void*)); // wide atomics need specialization (void)const_cast(*dest = new_value); } @@ -654,28 +654,28 @@ return LoadImpl >()(p); } -template -inline void Atomic::store(T store_value, volatile D* dest) { - StoreImpl >()(store_value, dest); +template +inline void Atomic::store(volatile D* dest, T store_value) { + StoreImpl >()(dest, store_value); } template struct Atomic::PlatformOrderedStore { template - void operator()(T v, volatile T* p) const { + void operator()(volatile T* p, T v) const { ScopedFence f((void*)p); - Atomic::store(v, p); + Atomic::store(p, v); } }; -template +template inline void Atomic::release_store(volatile D* p, T v) { - StoreImpl >()(v, p); + StoreImpl >()(p, v); } -template +template inline void Atomic::release_store_fence(volatile D* p, T v) { - StoreImpl >()(v, p); + StoreImpl >()(p, v); } template