src/hotspot/share/oops/access.hpp
changeset 59252 623722a6aeb9
parent 59251 4cbfa5077d68
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   163     verify_primitive_decorators<store_mo_decorators>();
   163     verify_primitive_decorators<store_mo_decorators>();
   164     AccessInternal::store_at<decorators>(base, offset, value);
   164     AccessInternal::store_at<decorators>(base, offset, value);
   165   }
   165   }
   166 
   166 
   167   template <typename T>
   167   template <typename T>
   168   static inline T atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) {
   168   static inline T atomic_cmpxchg_at(oop base, ptrdiff_t offset, T compare_value, T new_value) {
   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>(base, offset, compare_value, new_value);
   171   }
   171   }
   172 
   172 
   173   template <typename T>
   173   template <typename T>
   174   static inline T atomic_xchg_at(oop base, ptrdiff_t offset, T new_value) {
   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>();
   189     OopType oop_value = value;
   189     OopType oop_value = value;
   190     AccessInternal::store_at<decorators | INTERNAL_VALUE_IS_OOP>(base, offset, oop_value);
   190     AccessInternal::store_at<decorators | INTERNAL_VALUE_IS_OOP>(base, offset, oop_value);
   191   }
   191   }
   192 
   192 
   193   template <typename T>
   193   template <typename T>
   194   static inline T oop_atomic_cmpxchg_at(T new_value, oop base, ptrdiff_t offset, T compare_value) {
   194   static inline T oop_atomic_cmpxchg_at(oop base, ptrdiff_t offset, T compare_value, T new_value) {
   195     verify_heap_oop_decorators<atomic_cmpxchg_mo_decorators>();
   195     verify_heap_oop_decorators<atomic_cmpxchg_mo_decorators>();
   196     typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType;
   196     typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType;
   197     OopType new_oop_value = new_value;
   197     OopType new_oop_value = new_value;
   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>(base, offset, compare_oop_value, new_oop_value);
   200   }
   200   }
   201 
   201 
   202   template <typename T>
   202   template <typename T>
   203   static inline T oop_atomic_xchg_at(oop base, ptrdiff_t offset, T new_value) {
   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>();
   225     verify_primitive_decorators<store_mo_decorators>();
   225     verify_primitive_decorators<store_mo_decorators>();
   226     AccessInternal::store<decorators>(addr, value);
   226     AccessInternal::store<decorators>(addr, value);
   227   }
   227   }
   228 
   228 
   229   template <typename P, typename T>
   229   template <typename P, typename T>
   230   static inline T atomic_cmpxchg(T new_value, P* addr, T compare_value) {
   230   static inline T atomic_cmpxchg(P* addr, T compare_value, T new_value) {
   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>(addr, compare_value, new_value);
   233   }
   233   }
   234 
   234 
   235   template <typename P, typename T>
   235   template <typename P, typename T>
   236   static inline T atomic_xchg(P* addr, T new_value) {
   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>();
   252     OopType oop_value = value;
   252     OopType oop_value = value;
   253     AccessInternal::store<decorators | INTERNAL_VALUE_IS_OOP>(addr, oop_value);
   253     AccessInternal::store<decorators | INTERNAL_VALUE_IS_OOP>(addr, oop_value);
   254   }
   254   }
   255 
   255 
   256   template <typename P, typename T>
   256   template <typename P, typename T>
   257   static inline T oop_atomic_cmpxchg(T new_value, P* addr, T compare_value) {
   257   static inline T oop_atomic_cmpxchg(P* addr, T compare_value, T new_value) {
   258     verify_oop_decorators<atomic_cmpxchg_mo_decorators>();
   258     verify_oop_decorators<atomic_cmpxchg_mo_decorators>();
   259     typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType;
   259     typedef typename AccessInternal::OopOrNarrowOop<T>::type OopType;
   260     OopType new_oop_value = new_value;
   260     OopType new_oop_value = new_value;
   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>(addr, compare_oop_value, new_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(P* addr, T new_value) {
   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>();