< prev index next >

src/hotspot/share/runtime/orderAccess.inline.hpp

Print this page




  37 template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::postfix() { OrderAccess::fence();   }
  38 
  39 
  40 template <typename FieldType, ScopedFenceType FenceType>
  41 inline void OrderAccess::ordered_store(volatile FieldType* p, FieldType v) {
  42   ScopedFence<FenceType> f((void*)p);
  43   Atomic::store(v, p);
  44 }
  45 
  46 template <typename FieldType, ScopedFenceType FenceType>
  47 inline FieldType OrderAccess::ordered_load(const volatile FieldType* p) {
  48   ScopedFence<FenceType> f((void*)p);
  49   return Atomic::load(p);
  50 }
  51 
  52 template <typename T>
  53 inline T OrderAccess::load_acquire(const volatile T* p) {
  54   return LoadImpl<T, PlatformOrderedLoad<sizeof(T), X_ACQUIRE> >()(p);
  55 }
  56 
  57 inline intptr_t OrderAccess::load_ptr_acquire(const volatile intptr_t*   p) {
  58   return load_acquire(p);
  59 }
  60 
  61 inline void*    OrderAccess::load_ptr_acquire(const volatile void*       p) {
  62   return load_acquire(static_cast<void* const volatile *>(p));
  63 }
  64 
  65 template <typename T, typename D>
  66 inline void OrderAccess::release_store(volatile D* p, T v) {
  67   StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X> >()(v, p);
  68 }
  69 
  70 inline void     OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { release_store(p, v); }
  71 inline void     OrderAccess::release_store_ptr(volatile void*     p, void*    v) { release_store(static_cast<void* volatile*>(p), v); }
  72 
  73 template <typename T, typename D>
  74 inline void OrderAccess::release_store_fence(volatile D* p, T v) {
  75   StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X_FENCE> >()(v, p);
  76 }
  77 
  78 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { release_store_fence(p, v); }
  79 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) { release_store_fence(static_cast<void* volatile*>(p), v); }
  80 
  81 #endif // SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP


  37 template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::postfix() { OrderAccess::fence();   }
  38 
  39 
  40 template <typename FieldType, ScopedFenceType FenceType>
  41 inline void OrderAccess::ordered_store(volatile FieldType* p, FieldType v) {
  42   ScopedFence<FenceType> f((void*)p);
  43   Atomic::store(v, p);
  44 }
  45 
  46 template <typename FieldType, ScopedFenceType FenceType>
  47 inline FieldType OrderAccess::ordered_load(const volatile FieldType* p) {
  48   ScopedFence<FenceType> f((void*)p);
  49   return Atomic::load(p);
  50 }
  51 
  52 template <typename T>
  53 inline T OrderAccess::load_acquire(const volatile T* p) {
  54   return LoadImpl<T, PlatformOrderedLoad<sizeof(T), X_ACQUIRE> >()(p);
  55 }
  56 








  57 template <typename T, typename D>
  58 inline void OrderAccess::release_store(volatile D* p, T v) {
  59   StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X> >()(v, p);
  60 }
  61 



  62 template <typename T, typename D>
  63 inline void OrderAccess::release_store_fence(volatile D* p, T v) {
  64   StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X_FENCE> >()(v, p);
  65 }




  66 #endif // SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
< prev index next >