< prev index next >

src/hotspot/share/gc/shared/barrierSet.hpp

Print this page




 194     static T load_in_heap(T* addr) {
 195       return Raw::template load<T>(addr);
 196     }
 197 
 198     template <typename T>
 199     static T load_in_heap_at(oop base, ptrdiff_t offset) {
 200       return Raw::template load_at<T>(base, offset);
 201     }
 202 
 203     template <typename T>
 204     static void store_in_heap(T* addr, T value) {
 205       Raw::store(addr, value);
 206     }
 207 
 208     template <typename T>
 209     static void store_in_heap_at(oop base, ptrdiff_t offset, T value) {
 210       Raw::store_at(base, offset, value);
 211     }
 212 
 213     template <typename T>
 214     static T atomic_cmpxchg_in_heap(T new_value, T* addr, T compare_value) {
 215       return Raw::atomic_cmpxchg(new_value, addr, compare_value);
 216     }
 217 
 218     template <typename T>
 219     static T atomic_cmpxchg_in_heap_at(T new_value, oop base, ptrdiff_t offset, T compare_value) {
 220       return Raw::atomic_cmpxchg_at(new_value, base, offset, compare_value);
 221     }
 222 
 223     template <typename T>
 224     static T atomic_xchg_in_heap(T* addr, T new_value) {
 225       return Raw::atomic_xchg(addr, new_value);
 226     }
 227 
 228     template <typename T>
 229     static T atomic_xchg_in_heap_at(oop base, ptrdiff_t offset, T new_value) {
 230       return Raw::atomic_xchg_at(base, offset, new_value);
 231     }
 232 
 233     template <typename T>
 234     static void arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
 235                                   arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 236                                   size_t length) {
 237       Raw::arraycopy(src_obj, src_offset_in_bytes, src_raw,
 238                      dst_obj, dst_offset_in_bytes, dst_raw,
 239                      length);
 240     }


 244     // an oop_* overload, and the barrier strength is AS_NORMAL.
 245     template <typename T>
 246     static oop oop_load_in_heap(T* addr) {
 247       return Raw::template oop_load<oop>(addr);
 248     }
 249 
 250     static oop oop_load_in_heap_at(oop base, ptrdiff_t offset) {
 251       return Raw::template oop_load_at<oop>(base, offset);
 252     }
 253 
 254     template <typename T>
 255     static void oop_store_in_heap(T* addr, oop value) {
 256       Raw::oop_store(addr, value);
 257     }
 258 
 259     static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
 260       Raw::oop_store_at(base, offset, value);
 261     }
 262 
 263     template <typename T>
 264     static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value) {
 265       return Raw::oop_atomic_cmpxchg(new_value, addr, compare_value);
 266     }
 267 
 268     static oop oop_atomic_cmpxchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset, oop compare_value) {
 269       return Raw::oop_atomic_cmpxchg_at(new_value, base, offset, compare_value);
 270     }
 271 
 272     template <typename T>
 273     static oop oop_atomic_xchg_in_heap(T* addr, oop new_value) {
 274       return Raw::oop_atomic_xchg(addr, new_value);
 275     }
 276 
 277     static oop oop_atomic_xchg_in_heap_at(oop base, ptrdiff_t offset, oop new_value) {
 278       return Raw::oop_atomic_xchg_at(base, offset, new_value);
 279     }
 280 
 281     template <typename T>
 282     static bool oop_arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
 283                                       arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 284                                       size_t length);
 285 
 286     // Off-heap oop accesses. These accessors get resolved when
 287     // IN_HEAP is not set (e.g. when using the NativeAccess API), it is
 288     // an oop* overload, and the barrier strength is AS_NORMAL.
 289     template <typename T>
 290     static oop oop_load_not_in_heap(T* addr) {
 291       return Raw::template oop_load<oop>(addr);
 292     }
 293 
 294     template <typename T>
 295     static void oop_store_not_in_heap(T* addr, oop value) {
 296       Raw::oop_store(addr, value);
 297     }
 298 
 299     template <typename T>
 300     static oop oop_atomic_cmpxchg_not_in_heap(oop new_value, T* addr, oop compare_value) {
 301       return Raw::oop_atomic_cmpxchg(new_value, addr, compare_value);
 302     }
 303 
 304     template <typename T>
 305     static oop oop_atomic_xchg_not_in_heap(T* addr, oop new_value) {
 306       return Raw::oop_atomic_xchg(addr, new_value);
 307     }
 308 
 309     // Clone barrier support
 310     static void clone_in_heap(oop src, oop dst, size_t size) {
 311       Raw::clone(src, dst, size);
 312     }
 313 
 314     static oop resolve(oop obj) {
 315       return Raw::resolve(obj);
 316     }
 317   };
 318 };
 319 
 320 template<typename T>
 321 inline T* barrier_set_cast(BarrierSet* bs) {


 194     static T load_in_heap(T* addr) {
 195       return Raw::template load<T>(addr);
 196     }
 197 
 198     template <typename T>
 199     static T load_in_heap_at(oop base, ptrdiff_t offset) {
 200       return Raw::template load_at<T>(base, offset);
 201     }
 202 
 203     template <typename T>
 204     static void store_in_heap(T* addr, T value) {
 205       Raw::store(addr, value);
 206     }
 207 
 208     template <typename T>
 209     static void store_in_heap_at(oop base, ptrdiff_t offset, T value) {
 210       Raw::store_at(base, offset, value);
 211     }
 212 
 213     template <typename T>
 214     static T atomic_cmpxchg_in_heap(T* addr, T compare_value, T new_value) {
 215       return Raw::atomic_cmpxchg(addr, compare_value, new_value);
 216     }
 217 
 218     template <typename T>
 219     static T atomic_cmpxchg_in_heap_at(oop base, ptrdiff_t offset, T compare_value, T new_value) {
 220       return Raw::atomic_cmpxchg_at(base, offset, compare_value, new_value);
 221     }
 222 
 223     template <typename T>
 224     static T atomic_xchg_in_heap(T* addr, T new_value) {
 225       return Raw::atomic_xchg(addr, new_value);
 226     }
 227 
 228     template <typename T>
 229     static T atomic_xchg_in_heap_at(oop base, ptrdiff_t offset, T new_value) {
 230       return Raw::atomic_xchg_at(base, offset, new_value);
 231     }
 232 
 233     template <typename T>
 234     static void arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
 235                                   arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 236                                   size_t length) {
 237       Raw::arraycopy(src_obj, src_offset_in_bytes, src_raw,
 238                      dst_obj, dst_offset_in_bytes, dst_raw,
 239                      length);
 240     }


 244     // an oop_* overload, and the barrier strength is AS_NORMAL.
 245     template <typename T>
 246     static oop oop_load_in_heap(T* addr) {
 247       return Raw::template oop_load<oop>(addr);
 248     }
 249 
 250     static oop oop_load_in_heap_at(oop base, ptrdiff_t offset) {
 251       return Raw::template oop_load_at<oop>(base, offset);
 252     }
 253 
 254     template <typename T>
 255     static void oop_store_in_heap(T* addr, oop value) {
 256       Raw::oop_store(addr, value);
 257     }
 258 
 259     static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
 260       Raw::oop_store_at(base, offset, value);
 261     }
 262 
 263     template <typename T>
 264     static oop oop_atomic_cmpxchg_in_heap(T* addr, oop compare_value, oop new_value) {
 265       return Raw::oop_atomic_cmpxchg(addr, compare_value, new_value);
 266     }
 267 
 268     static oop oop_atomic_cmpxchg_in_heap_at(oop base, ptrdiff_t offset, oop compare_value, oop new_value) {
 269       return Raw::oop_atomic_cmpxchg_at(base, offset, compare_value, new_value);
 270     }
 271 
 272     template <typename T>
 273     static oop oop_atomic_xchg_in_heap(T* addr, oop new_value) {
 274       return Raw::oop_atomic_xchg(addr, new_value);
 275     }
 276 
 277     static oop oop_atomic_xchg_in_heap_at(oop base, ptrdiff_t offset, oop new_value) {
 278       return Raw::oop_atomic_xchg_at(base, offset, new_value);
 279     }
 280 
 281     template <typename T>
 282     static bool oop_arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
 283                                       arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 284                                       size_t length);
 285 
 286     // Off-heap oop accesses. These accessors get resolved when
 287     // IN_HEAP is not set (e.g. when using the NativeAccess API), it is
 288     // an oop* overload, and the barrier strength is AS_NORMAL.
 289     template <typename T>
 290     static oop oop_load_not_in_heap(T* addr) {
 291       return Raw::template oop_load<oop>(addr);
 292     }
 293 
 294     template <typename T>
 295     static void oop_store_not_in_heap(T* addr, oop value) {
 296       Raw::oop_store(addr, value);
 297     }
 298 
 299     template <typename T>
 300     static oop oop_atomic_cmpxchg_not_in_heap(T* addr, oop compare_value, oop new_value) {
 301       return Raw::oop_atomic_cmpxchg(addr, compare_value, new_value);
 302     }
 303 
 304     template <typename T>
 305     static oop oop_atomic_xchg_not_in_heap(T* addr, oop new_value) {
 306       return Raw::oop_atomic_xchg(addr, new_value);
 307     }
 308 
 309     // Clone barrier support
 310     static void clone_in_heap(oop src, oop dst, size_t size) {
 311       Raw::clone(src, dst, size);
 312     }
 313 
 314     static oop resolve(oop obj) {
 315       return Raw::resolve(obj);
 316     }
 317   };
 318 };
 319 
 320 template<typename T>
 321 inline T* barrier_set_cast(BarrierSet* bs) {
< prev index next >