< prev index next >
src/hotspot/share/runtime/atomic.hpp
Print this page
@@ -365,11 +365,10 @@
template<typename T, typename PlatformOp>
struct Atomic::LoadImpl<
T,
PlatformOp,
typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value || IsPointer<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
T operator()(T const volatile* dest) const {
// Forward to the platform handler for the size of T.
return PlatformOp()(dest);
}
@@ -385,11 +384,10 @@
template<typename T, typename PlatformOp>
struct Atomic::LoadImpl<
T,
PlatformOp,
typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
T operator()(T const volatile* dest) const {
typedef PrimitiveConversions::Translate<T> Translator;
typedef typename Translator::Decayed Decayed;
STATIC_ASSERT(sizeof(T) == sizeof(Decayed));
@@ -403,11 +401,11 @@
// For increased safety, the default implementation only allows
// load types that are pointer sized or smaller. If a platform still
// supports wide atomics, then it has to use specialization
// of Atomic::PlatformLoad for that wider size class.
template<size_t byte_size>
-struct Atomic::PlatformLoad VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformLoad {
template<typename T>
T operator()(T const volatile* dest) const {
STATIC_ASSERT(sizeof(T) <= sizeof(void*)); // wide atomics need specialization
return *dest;
}
@@ -419,11 +417,10 @@
template<typename T, typename PlatformOp>
struct Atomic::StoreImpl<
T, T,
PlatformOp,
typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
void operator()(T new_value, T volatile* dest) const {
// Forward to the platform handler for the size of T.
PlatformOp()(new_value, dest);
}
@@ -437,11 +434,10 @@
template<typename T, typename D, typename PlatformOp>
struct Atomic::StoreImpl<
T*, D*,
PlatformOp,
typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
void operator()(T* new_value, D* volatile* dest) const {
// Allow derived to base conversion, and adding cv-qualifiers.
D* value = new_value;
PlatformOp()(value, dest);
@@ -457,11 +453,10 @@
template<typename T, typename PlatformOp>
struct Atomic::StoreImpl<
T, T,
PlatformOp,
typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
void operator()(T new_value, T volatile* dest) const {
typedef PrimitiveConversions::Translate<T> Translator;
typedef typename Translator::Decayed Decayed;
STATIC_ASSERT(sizeof(T) == sizeof(Decayed));
@@ -475,11 +470,11 @@
// For increased safety, the default implementation only allows
// storing types that are pointer sized or smaller. If a platform still
// supports wide atomics, then it has to use specialization
// of Atomic::PlatformStore for that wider size class.
template<size_t byte_size>
-struct Atomic::PlatformStore VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformStore {
template<typename T>
void operator()(T new_value,
T volatile* dest) const {
STATIC_ASSERT(sizeof(T) <= sizeof(void*)); // wide atomics need specialization
(void)const_cast<T&>(*dest = new_value);
@@ -489,17 +484,17 @@
// Define FetchAndAdd and AddAndFetch helper classes before including
// platform file, which may use these as base classes, requiring they
// be complete.
template<typename Derived>
-struct Atomic::FetchAndAdd VALUE_OBJ_CLASS_SPEC {
+struct Atomic::FetchAndAdd {
template<typename I, typename D>
D operator()(I add_value, D volatile* dest) const;
};
template<typename Derived>
-struct Atomic::AddAndFetch VALUE_OBJ_CLASS_SPEC {
+struct Atomic::AddAndFetch {
template<typename I, typename D>
D operator()(I add_value, D volatile* dest) const;
};
template<typename D>
@@ -539,22 +534,22 @@
// the operator definition. No generic definition of specializations
// of the operator template are provided, nor are there any generic
// specializations of the class. The platform file is responsible for
// providing those.
template<size_t byte_size>
-struct Atomic::PlatformCmpxchg VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformCmpxchg {
template<typename T>
T operator()(T exchange_value,
T volatile* dest,
T compare_value,
cmpxchg_memory_order order) const;
};
// Define the class before including platform file, which may use this
// as a base class, requiring it be complete. The definition is later
// in this file, near the other definitions related to cmpxchg.
-struct Atomic::CmpxchgByteUsingInt VALUE_OBJ_CLASS_SPEC {
+struct Atomic::CmpxchgByteUsingInt {
template<typename T>
T operator()(T exchange_value,
T volatile* dest,
T compare_value,
cmpxchg_memory_order order) const;
@@ -564,11 +559,11 @@
// the operator definition. No generic definition of specializations
// of the operator template are provided, nor are there any generic
// specializations of the class. The platform file is responsible for
// providing those.
template<size_t byte_size>
-struct Atomic::PlatformXchg VALUE_OBJ_CLASS_SPEC {
+struct Atomic::PlatformXchg {
template<typename T>
T operator()(T exchange_value,
T volatile* dest) const;
};
@@ -603,11 +598,10 @@
I, D,
typename EnableIf<IsIntegral<I>::value &&
IsIntegral<D>::value &&
(sizeof(I) <= sizeof(D)) &&
(IsSigned<I>::value == IsSigned<D>::value)>::type>
- VALUE_OBJ_CLASS_SPEC
{
D operator()(I add_value, D volatile* dest) const {
D addend = add_value;
return PlatformAdd<sizeof(D)>()(addend, dest);
}
@@ -615,11 +609,10 @@
template<typename I, typename P>
struct Atomic::AddImpl<
I, P*,
typename EnableIf<IsIntegral<I>::value && (sizeof(I) <= sizeof(P*))>::type>
- VALUE_OBJ_CLASS_SPEC
{
P* operator()(I add_value, P* volatile* dest) const {
STATIC_ASSERT(sizeof(intptr_t) == sizeof(P*));
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(P*));
typedef typename Conditional<IsSigned<I>::value,
@@ -638,11 +631,11 @@
// The least significant parts of this 32-bit word will never be affected, even
// in case of overflow/underflow.
//
// Use the ATOMIC_SHORT_PAIR macro (see macros.hpp) to get the desired alignment.
template<>
-struct Atomic::AddImpl<short, short> VALUE_OBJ_CLASS_SPEC {
+struct Atomic::AddImpl<short, short> {
short operator()(short add_value, short volatile* dest) const {
#ifdef VM_LITTLE_ENDIAN
assert((intx(dest) & 0x03) == 0x02, "wrong alignment");
int new_value = Atomic::add(add_value << 16, (volatile int*)(dest-1));
#else
@@ -705,11 +698,10 @@
// All the involved types must be identical.
template<typename T>
struct Atomic::CmpxchgImpl<
T, T, T,
typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
T operator()(T exchange_value, T volatile* dest, T compare_value,
cmpxchg_memory_order order) const {
// Forward to the platform handler for the size of T.
return PlatformCmpxchg<sizeof(T)>()(exchange_value,
@@ -732,11 +724,10 @@
struct Atomic::CmpxchgImpl<
T*, D*, U*,
typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value &&
IsSame<typename RemoveCV<D>::type,
typename RemoveCV<U>::type>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
D* operator()(T* exchange_value, D* volatile* dest, U* compare_value,
cmpxchg_memory_order order) const {
// Allow derived to base conversion, and adding cv-qualifiers.
D* new_value = exchange_value;
@@ -756,11 +747,10 @@
// call.
template<typename T>
struct Atomic::CmpxchgImpl<
T, T, T,
typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
T operator()(T exchange_value, T volatile* dest, T compare_value,
cmpxchg_memory_order order) const {
typedef PrimitiveConversions::Translate<T> Translator;
typedef typename Translator::Decayed Decayed;
@@ -828,11 +818,10 @@
// All the involved types must be identical.
template<typename T>
struct Atomic::XchgImpl<
T, T,
typename EnableIf<IsIntegral<T>::value || IsRegisteredEnum<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
T operator()(T exchange_value, T volatile* dest) const {
// Forward to the platform handler for the size of T.
return PlatformXchg<sizeof(T)>()(exchange_value, dest);
}
@@ -845,11 +834,10 @@
// exchange_value in the destination.
template<typename T, typename D>
struct Atomic::XchgImpl<
T*, D*,
typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
D* operator()(T* exchange_value, D* volatile* dest) const {
// Allow derived to base conversion, and adding cv-qualifiers.
D* new_value = exchange_value;
return PlatformXchg<sizeof(D*)>()(new_value, dest);
@@ -865,11 +853,10 @@
// call.
template<typename T>
struct Atomic::XchgImpl<
T, T,
typename EnableIf<PrimitiveConversions::Translate<T>::value>::type>
- VALUE_OBJ_CLASS_SPEC
{
T operator()(T exchange_value, T volatile* dest) const {
typedef PrimitiveConversions::Translate<T> Translator;
typedef typename Translator::Decayed Decayed;
STATIC_ASSERT(sizeof(T) == sizeof(Decayed));
< prev index next >