< prev index next >

src/hotspot/share/oops/accessBackend.inline.hpp

Print this page




 117 }
 118 
 119 template <DecoratorSet decorators>
 120 template <typename T>
 121 inline bool RawAccessBarrier<decorators>::oop_arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
 122                                                         arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 123                                                         size_t length) {
 124   return arraycopy(src_obj, src_offset_in_bytes, src_raw,
 125                    dst_obj, dst_offset_in_bytes, dst_raw,
 126                    length);
 127 }
 128 
 129 template <DecoratorSet decorators>
 130 template <DecoratorSet ds, typename T>
 131 inline typename EnableIf<
 132   HasDecorator<ds, MO_SEQ_CST>::value, T>::type
 133 RawAccessBarrier<decorators>::load_internal(void* addr) {
 134   if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
 135     OrderAccess::fence();
 136   }
 137   return OrderAccess::load_acquire(reinterpret_cast<const volatile T*>(addr));
 138 }
 139 
 140 template <DecoratorSet decorators>
 141 template <DecoratorSet ds, typename T>
 142 inline typename EnableIf<
 143   HasDecorator<ds, MO_ACQUIRE>::value, T>::type
 144 RawAccessBarrier<decorators>::load_internal(void* addr) {
 145   return OrderAccess::load_acquire(reinterpret_cast<const volatile T*>(addr));
 146 }
 147 
 148 template <DecoratorSet decorators>
 149 template <DecoratorSet ds, typename T>
 150 inline typename EnableIf<
 151   HasDecorator<ds, MO_RELAXED>::value, T>::type
 152 RawAccessBarrier<decorators>::load_internal(void* addr) {
 153   return Atomic::load(reinterpret_cast<const volatile T*>(addr));
 154 }
 155 
 156 template <DecoratorSet decorators>
 157 template <DecoratorSet ds, typename T>
 158 inline typename EnableIf<
 159   HasDecorator<ds, MO_SEQ_CST>::value>::type
 160 RawAccessBarrier<decorators>::store_internal(void* addr, T value) {
 161   OrderAccess::release_store_fence(reinterpret_cast<volatile T*>(addr), value);
 162 }
 163 
 164 template <DecoratorSet decorators>
 165 template <DecoratorSet ds, typename T>
 166 inline typename EnableIf<
 167   HasDecorator<ds, MO_RELEASE>::value>::type
 168 RawAccessBarrier<decorators>::store_internal(void* addr, T value) {
 169   OrderAccess::release_store(reinterpret_cast<volatile T*>(addr), value);
 170 }
 171 
 172 template <DecoratorSet decorators>
 173 template <DecoratorSet ds, typename T>
 174 inline typename EnableIf<
 175   HasDecorator<ds, MO_RELAXED>::value>::type
 176 RawAccessBarrier<decorators>::store_internal(void* addr, T value) {
 177   Atomic::store(value, reinterpret_cast<volatile T*>(addr));
 178 }
 179 
 180 template <DecoratorSet decorators>
 181 template <DecoratorSet ds, typename T>
 182 inline typename EnableIf<
 183   HasDecorator<ds, MO_RELAXED>::value, T>::type
 184 RawAccessBarrier<decorators>::atomic_cmpxchg_internal(T new_value, void* addr, T compare_value) {
 185   return Atomic::cmpxchg(new_value,
 186                          reinterpret_cast<volatile T*>(addr),
 187                          compare_value,
 188                          memory_order_relaxed);
 189 }




 117 }
 118 
 119 template <DecoratorSet decorators>
 120 template <typename T>
 121 inline bool RawAccessBarrier<decorators>::oop_arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
 122                                                         arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 123                                                         size_t length) {
 124   return arraycopy(src_obj, src_offset_in_bytes, src_raw,
 125                    dst_obj, dst_offset_in_bytes, dst_raw,
 126                    length);
 127 }
 128 
 129 template <DecoratorSet decorators>
 130 template <DecoratorSet ds, typename T>
 131 inline typename EnableIf<
 132   HasDecorator<ds, MO_SEQ_CST>::value, T>::type
 133 RawAccessBarrier<decorators>::load_internal(void* addr) {
 134   if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
 135     OrderAccess::fence();
 136   }
 137   return Atomic::load_acquire(reinterpret_cast<const volatile T*>(addr));
 138 }
 139 
 140 template <DecoratorSet decorators>
 141 template <DecoratorSet ds, typename T>
 142 inline typename EnableIf<
 143   HasDecorator<ds, MO_ACQUIRE>::value, T>::type
 144 RawAccessBarrier<decorators>::load_internal(void* addr) {
 145   return Atomic::load_acquire(reinterpret_cast<const volatile T*>(addr));
 146 }
 147 
 148 template <DecoratorSet decorators>
 149 template <DecoratorSet ds, typename T>
 150 inline typename EnableIf<
 151   HasDecorator<ds, MO_RELAXED>::value, T>::type
 152 RawAccessBarrier<decorators>::load_internal(void* addr) {
 153   return Atomic::load(reinterpret_cast<const volatile T*>(addr));
 154 }
 155 
 156 template <DecoratorSet decorators>
 157 template <DecoratorSet ds, typename T>
 158 inline typename EnableIf<
 159   HasDecorator<ds, MO_SEQ_CST>::value>::type
 160 RawAccessBarrier<decorators>::store_internal(void* addr, T value) {
 161   Atomic::release_store_fence(reinterpret_cast<volatile T*>(addr), value);
 162 }
 163 
 164 template <DecoratorSet decorators>
 165 template <DecoratorSet ds, typename T>
 166 inline typename EnableIf<
 167   HasDecorator<ds, MO_RELEASE>::value>::type
 168 RawAccessBarrier<decorators>::store_internal(void* addr, T value) {
 169   Atomic::release_store(reinterpret_cast<volatile T*>(addr), value);
 170 }
 171 
 172 template <DecoratorSet decorators>
 173 template <DecoratorSet ds, typename T>
 174 inline typename EnableIf<
 175   HasDecorator<ds, MO_RELAXED>::value>::type
 176 RawAccessBarrier<decorators>::store_internal(void* addr, T value) {
 177   Atomic::store(value, reinterpret_cast<volatile T*>(addr));
 178 }
 179 
 180 template <DecoratorSet decorators>
 181 template <DecoratorSet ds, typename T>
 182 inline typename EnableIf<
 183   HasDecorator<ds, MO_RELAXED>::value, T>::type
 184 RawAccessBarrier<decorators>::atomic_cmpxchg_internal(T new_value, void* addr, T compare_value) {
 185   return Atomic::cmpxchg(new_value,
 186                          reinterpret_cast<volatile T*>(addr),
 187                          compare_value,
 188                          memory_order_relaxed);
 189 }


< prev index next >