169 verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); |
169 verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); |
170 return AccessInternal::atomic_cmpxchg_at<decorators>(new_value, base, offset, compare_value); |
170 return AccessInternal::atomic_cmpxchg_at<decorators>(new_value, base, offset, compare_value); |
171 } |
171 } |
172 |
172 |
173 template <typename T> |
173 template <typename T> |
174 static inline T atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { |
174 static inline T atomic_xchg_at(oop base, ptrdiff_t offset, T new_value) { |
175 verify_primitive_decorators<atomic_xchg_mo_decorators>(); |
175 verify_primitive_decorators<atomic_xchg_mo_decorators>(); |
176 return AccessInternal::atomic_xchg_at<decorators>(new_value, base, offset); |
176 return AccessInternal::atomic_xchg_at<decorators>(base, offset, new_value); |
177 } |
177 } |
178 |
178 |
179 // Oop heap accesses |
179 // Oop heap accesses |
180 static inline AccessInternal::OopLoadAtProxy<decorators> oop_load_at(oop base, ptrdiff_t offset) { |
180 static inline AccessInternal::OopLoadAtProxy<decorators> oop_load_at(oop base, ptrdiff_t offset) { |
181 verify_heap_oop_decorators<load_mo_decorators>(); |
181 verify_heap_oop_decorators<load_mo_decorators>(); |
198 OopType compare_oop_value = compare_value; |
198 OopType compare_oop_value = compare_value; |
199 return AccessInternal::atomic_cmpxchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset, compare_oop_value); |
199 return AccessInternal::atomic_cmpxchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset, compare_oop_value); |
200 } |
200 } |
201 |
201 |
202 template <typename T> |
202 template <typename T> |
203 static inline T oop_atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) { |
203 static inline T oop_atomic_xchg_at(oop base, ptrdiff_t offset, T new_value) { |
204 verify_heap_oop_decorators<atomic_xchg_mo_decorators>(); |
204 verify_heap_oop_decorators<atomic_xchg_mo_decorators>(); |
205 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
205 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
206 OopType new_oop_value = new_value; |
206 OopType new_oop_value = new_value; |
207 return AccessInternal::atomic_xchg_at<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, base, offset); |
207 return AccessInternal::atomic_xchg_at<decorators | INTERNAL_VALUE_IS_OOP>(base, offset, new_oop_value); |
208 } |
208 } |
209 |
209 |
210 // Clone an object from src to dst |
210 // Clone an object from src to dst |
211 static inline void clone(oop src, oop dst, size_t size) { |
211 static inline void clone(oop src, oop dst, size_t size) { |
212 verify_decorators<IN_HEAP>(); |
212 verify_decorators<IN_HEAP>(); |
231 verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); |
231 verify_primitive_decorators<atomic_cmpxchg_mo_decorators>(); |
232 return AccessInternal::atomic_cmpxchg<decorators>(new_value, addr, compare_value); |
232 return AccessInternal::atomic_cmpxchg<decorators>(new_value, addr, compare_value); |
233 } |
233 } |
234 |
234 |
235 template <typename P, typename T> |
235 template <typename P, typename T> |
236 static inline T atomic_xchg(T new_value, P* addr) { |
236 static inline T atomic_xchg(P* addr, T new_value) { |
237 verify_primitive_decorators<atomic_xchg_mo_decorators>(); |
237 verify_primitive_decorators<atomic_xchg_mo_decorators>(); |
238 return AccessInternal::atomic_xchg<decorators>(new_value, addr); |
238 return AccessInternal::atomic_xchg<decorators>(addr, new_value); |
239 } |
239 } |
240 |
240 |
241 // Oop accesses |
241 // Oop accesses |
242 template <typename P> |
242 template <typename P> |
243 static inline AccessInternal::OopLoadProxy<P, decorators> oop_load(P* addr) { |
243 static inline AccessInternal::OopLoadProxy<P, decorators> oop_load(P* addr) { |
261 OopType compare_oop_value = compare_value; |
261 OopType compare_oop_value = compare_value; |
262 return AccessInternal::atomic_cmpxchg<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, addr, compare_oop_value); |
262 return AccessInternal::atomic_cmpxchg<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, addr, compare_oop_value); |
263 } |
263 } |
264 |
264 |
265 template <typename P, typename T> |
265 template <typename P, typename T> |
266 static inline T oop_atomic_xchg(T new_value, P* addr) { |
266 static inline T oop_atomic_xchg(P* addr, T new_value) { |
267 verify_oop_decorators<atomic_xchg_mo_decorators>(); |
267 verify_oop_decorators<atomic_xchg_mo_decorators>(); |
268 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
268 typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType; |
269 OopType new_oop_value = new_value; |
269 OopType new_oop_value = new_value; |
270 return AccessInternal::atomic_xchg<decorators | INTERNAL_VALUE_IS_OOP>(new_oop_value, addr); |
270 return AccessInternal::atomic_xchg<decorators | INTERNAL_VALUE_IS_OOP>(addr, new_oop_value); |
271 } |
271 } |
272 |
272 |
273 static oop resolve(oop obj) { |
273 static oop resolve(oop obj) { |
274 verify_decorators<DECORATORS_NONE>(); |
274 verify_decorators<DECORATORS_NONE>(); |
275 return AccessInternal::resolve<decorators>(obj); |
275 return AccessInternal::resolve<decorators>(obj); |