139 140 template <typename T> 141 static inline void store_at(oop base, ptrdiff_t offset, T value) { 142 verify_primitive_decorators<store_mo_decorators>(); 143 AccessInternal::store_at<decorators>(base, offset, value); 144 } 145 146 template <typename T> 147 static inline T atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) { 148 verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); 149 return AccessInternal::atomic_cmpxchg_at<decorators>(new_value, base, offset, compare_value); 150 } 151 152 template <typename T> 153 static inline T atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { 154 verify_primitive_decorators<atomic_xchg_mo_decorators>(); 155 return AccessInternal::atomic_xchg_at<decorators>(new_value, base, offset); 156 } 157 158 template <typename T> 159 static inline void arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length) { 160 verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP | 161 AS_DECORATOR_MASK>(); 162 AccessInternal::arraycopy<decorators>(src_obj, dst_obj, src, dst, length); 163 } 164 165 // Oop heap accesses 166 static inline AccessInternal::OopLoadAtProxy<decorators> oop_load_at(oop base, ptrdiff_t offset) { 167 verify_heap_oop_decorators<load_mo_decorators>(); 168 return AccessInternal::OopLoadAtProxy<decorators>(base, offset); 169 } 170 171 template <typename T> 172 static inline void oop_store_at(oop base, ptrdiff_t offset, T value) { 173 verify_heap_oop_decorators<store_mo_decorators>(); 174 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; 175 OopType oop_value = value; 176 AccessInternal::store_at<decorators | INTERNAL_VALUE_IS_OOP>(base, offset, oop_value); 177 } 178 179 template <typename T> 180 static inline T oop_atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) { 181 verify_heap_oop_decorators<atomic_cmpxchg_mo_decorators>(); 182 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; 183 OopType new_oop_value = new_value; 184 OopType compare_oop_value = compare_value; 185 return AccessInternal::atomic_cmpxchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset, compare_oop_value); 186 } 187 188 template <typename T> 189 static inline T oop_atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { 190 verify_heap_oop_decorators<atomic_xchg_mo_decorators>(); 191 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; 192 OopType new_oop_value = new_value; 193 return AccessInternal::atomic_xchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset); 194 } 195 196 template <typename T> 197 static inline bool oop_arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length) { 198 verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP | AS_DECORATOR_MASK>(); 199 return AccessInternal::arraycopy<decorators | INTERNAL_VALUE_IS_OOP>(src_obj, dst_obj, src, dst, length); 200 } 201 202 // Clone an object from src to dst 203 static inline void clone(oop src, oop dst, size_t size) { 204 verify_decorators<IN_HEAP>(); 205 AccessInternal::clone<decorators>(src, dst, size); 206 } 207 208 // Primitive accesses 209 template <typename P> 210 static inline P load(P* addr) { 211 verify_primitive_decorators<load_mo_decorators>(); 212 return AccessInternal::load<decorators, P, P>(addr); 213 } 214 215 template <typename P, typename T> 216 static inline void store(P* addr, T value) { 217 verify_primitive_decorators<store_mo_decorators>(); 218 AccessInternal::store<decorators>(addr, value); 219 } | 139 140 template <typename T> 141 static inline void store_at(oop base, ptrdiff_t offset, T value) { 142 verify_primitive_decorators<store_mo_decorators>(); 143 AccessInternal::store_at<decorators>(base, offset, value); 144 } 145 146 template <typename T> 147 static inline T atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) { 148 verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); 149 return AccessInternal::atomic_cmpxchg_at<decorators>(new_value, base, offset, compare_value); 150 } 151 152 template <typename T> 153 static inline T atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { 154 verify_primitive_decorators<atomic_xchg_mo_decorators>(); 155 return AccessInternal::atomic_xchg_at<decorators>(new_value, base, offset); 156 } 157 158 template <typename T> 159 static inline void arraycopy(arrayOop src_obj, ptrdiff_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, ptrdiff_t dst_offset_in_bytes, T* dst_raw, size_t length) { 160 verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP | 161 AS_DECORATOR_MASK>(); 162 AccessInternal::arraycopy<decorators>(src_obj, src_offset_in_bytes, src_raw, dst_obj, dst_offset_in_bytes, dst_raw, length); 163 } 164 165 // Oop heap accesses 166 static inline AccessInternal::OopLoadAtProxy<decorators> oop_load_at(oop base, ptrdiff_t offset) { 167 verify_heap_oop_decorators<load_mo_decorators>(); 168 return AccessInternal::OopLoadAtProxy<decorators>(base, offset); 169 } 170 171 template <typename T> 172 static inline void oop_store_at(oop base, ptrdiff_t offset, T value) { 173 verify_heap_oop_decorators<store_mo_decorators>(); 174 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; 175 OopType oop_value = value; 176 AccessInternal::store_at<decorators | INTERNAL_VALUE_IS_OOP>(base, offset, oop_value); 177 } 178 179 template <typename T> 180 static inline T oop_atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) { 181 verify_heap_oop_decorators<atomic_cmpxchg_mo_decorators>(); 182 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; 183 OopType new_oop_value = new_value; 184 OopType compare_oop_value = compare_value; 185 return AccessInternal::atomic_cmpxchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset, compare_oop_value); 186 } 187 188 template <typename T> 189 static inline T oop_atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { 190 verify_heap_oop_decorators<atomic_xchg_mo_decorators>(); 191 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; 192 OopType new_oop_value = new_value; 193 return AccessInternal::atomic_xchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset); 194 } 195 196 template <typename T> 197 static inline bool oop_arraycopy(arrayOop src_obj, ptrdiff_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, ptrdiff_t dst_offset_in_bytes, T* dst_raw, size_t length) { 198 verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP | AS_DECORATOR_MASK>(); 199 return AccessInternal::arraycopy<decorators | INTERNAL_VALUE_IS_OOP>(src_obj, src_offset_in_bytes, src_raw, dst_obj, dst_offset_in_bytes, dst_raw, length); 200 } 201 202 // Clone an object from src to dst 203 static inline void clone(oop src, oop dst, size_t size) { 204 verify_decorators<IN_HEAP>(); 205 AccessInternal::clone<decorators>(src, dst, size); 206 } 207 208 // Primitive accesses 209 template <typename P> 210 static inline P load(P* addr) { 211 verify_primitive_decorators<load_mo_decorators>(); 212 return AccessInternal::load<decorators, P, P>(addr); 213 } 214 215 template <typename P, typename T> 216 static inline void store(P* addr, T value) { 217 verify_primitive_decorators<store_mo_decorators>(); 218 AccessInternal::store<decorators>(addr, value); 219 } |