< prev index next >

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

Print this page
rev 49182 : 8198445: Access API for primitive/native arraycopy


 746       return atomic_xchg<decorators>(new_value, field_addr(base, offset));
 747     }
 748 
 749     template <DecoratorSet decorators, typename T>
 750     inline static typename EnableIf<
 751       !HasDecorator<decorators, AS_RAW>::value, T>::type
 752     atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) {
 753       if (is_hardwired_primitive<decorators>()) {
 754         const DecoratorSet expanded_decorators = decorators | AS_RAW;
 755         return PreRuntimeDispatch::atomic_xchg<expanded_decorators>(new_value, base, offset);
 756       } else {
 757         return RuntimeDispatch<decorators, T, BARRIER_ATOMIC_XCHG_AT>::atomic_xchg_at(new_value, base, offset);
 758       }
 759     }
 760 
 761     template <DecoratorSet decorators, typename T>
 762     inline static typename EnableIf<
 763       HasDecorator<decorators, AS_RAW>::value, bool>::type
 764     arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) {
 765       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
 766       return Raw::arraycopy(src, dst, length);
 767     }
 768 
 769     template <DecoratorSet decorators, typename T>
 770     inline static typename EnableIf<
 771       !HasDecorator<decorators, AS_RAW>::value, bool>::type
 772     arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) {
 773       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
 774       if (is_hardwired_primitive<decorators>()) {
 775         const DecoratorSet expanded_decorators = decorators | AS_RAW;
 776         return PreRuntimeDispatch::arraycopy<expanded_decorators>(src_obj, dst_obj, src, dst, length);
 777       } else {
 778         return RuntimeDispatch<decorators, T, BARRIER_ARRAYCOPY>::arraycopy(src_obj, dst_obj, src, dst, length);
 779       }
 780     }
 781 
 782     template <DecoratorSet decorators>
 783     inline static typename EnableIf<
 784       HasDecorator<decorators, AS_RAW>::value>::type
 785     clone(oop src, oop dst, size_t size) {
 786       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;




 746       return atomic_xchg<decorators>(new_value, field_addr(base, offset));
 747     }
 748 
 749     template <DecoratorSet decorators, typename T>
 750     inline static typename EnableIf<
 751       !HasDecorator<decorators, AS_RAW>::value, T>::type
 752     atomic_xchg_at(T new_value, oop base, ptrdiff_t offset) {
 753       if (is_hardwired_primitive<decorators>()) {
 754         const DecoratorSet expanded_decorators = decorators | AS_RAW;
 755         return PreRuntimeDispatch::atomic_xchg<expanded_decorators>(new_value, base, offset);
 756       } else {
 757         return RuntimeDispatch<decorators, T, BARRIER_ATOMIC_XCHG_AT>::atomic_xchg_at(new_value, base, offset);
 758       }
 759     }
 760 
 761     template <DecoratorSet decorators, typename T>
 762     inline static typename EnableIf<
 763       HasDecorator<decorators, AS_RAW>::value, bool>::type
 764     arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) {
 765       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
 766       return Raw::arraycopy(src_obj, dst_obj, src, dst, length);
 767     }
 768 
 769     template <DecoratorSet decorators, typename T>
 770     inline static typename EnableIf<
 771       !HasDecorator<decorators, AS_RAW>::value, bool>::type
 772     arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) {
 773       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
 774       if (is_hardwired_primitive<decorators>()) {
 775         const DecoratorSet expanded_decorators = decorators | AS_RAW;
 776         return PreRuntimeDispatch::arraycopy<expanded_decorators>(src_obj, dst_obj, src, dst, length);
 777       } else {
 778         return RuntimeDispatch<decorators, T, BARRIER_ARRAYCOPY>::arraycopy(src_obj, dst_obj, src, dst, length);
 779       }
 780     }
 781 
 782     template <DecoratorSet decorators>
 783     inline static typename EnableIf<
 784       HasDecorator<decorators, AS_RAW>::value>::type
 785     clone(oop src, oop dst, size_t size) {
 786       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;


< prev index next >