137 |
137 |
138 template <class GCBarrierType, DecoratorSet decorators> |
138 template <class GCBarrierType, DecoratorSet decorators> |
139 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ARRAYCOPY, decorators>: public AllStatic { |
139 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ARRAYCOPY, decorators>: public AllStatic { |
140 template <typename T> |
140 template <typename T> |
141 static bool access_barrier(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) { |
141 static bool access_barrier(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) { |
142 return GCBarrierType::arraycopy_in_heap(src_obj, dst_obj, src, dst, length); |
142 GCBarrierType::arraycopy_in_heap(src_obj, dst_obj, src, dst, length); |
|
143 return true; |
143 } |
144 } |
144 |
145 |
145 template <typename T> |
146 template <typename T> |
146 static bool oop_access_barrier(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) { |
147 static bool oop_access_barrier(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) { |
147 typedef typename HeapOopType<decorators>::type OopType; |
148 typedef typename HeapOopType<decorators>::type OopType; |
761 template <DecoratorSet decorators, typename T> |
762 template <DecoratorSet decorators, typename T> |
762 inline static typename EnableIf< |
763 inline static typename EnableIf< |
763 HasDecorator<decorators, AS_RAW>::value, bool>::type |
764 HasDecorator<decorators, AS_RAW>::value, bool>::type |
764 arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) { |
765 arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) { |
765 typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw; |
766 typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw; |
766 return Raw::arraycopy(src, dst, length); |
767 return Raw::arraycopy(src_obj, dst_obj, src, dst, length); |
767 } |
768 } |
768 |
769 |
769 template <DecoratorSet decorators, typename T> |
770 template <DecoratorSet decorators, typename T> |
770 inline static typename EnableIf< |
771 inline static typename EnableIf< |
771 !HasDecorator<decorators, AS_RAW>::value, bool>::type |
772 !HasDecorator<decorators, AS_RAW>::value, bool>::type |
1075 return PreRuntimeDispatch::atomic_xchg_at<expanded_decorators>(new_decayed_value, base, offset); |
1076 return PreRuntimeDispatch::atomic_xchg_at<expanded_decorators>(new_decayed_value, base, offset); |
1076 } |
1077 } |
1077 |
1078 |
1078 template <DecoratorSet decorators, typename T> |
1079 template <DecoratorSet decorators, typename T> |
1079 inline bool arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length) { |
1080 inline bool arraycopy(arrayOop src_obj, arrayOop dst_obj, T *src, T *dst, size_t length) { |
1080 verify_types<decorators, T>(); |
1081 STATIC_ASSERT((HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value || |
|
1082 (IsSame<T, void>::value || IsIntegral<T>::value) || |
|
1083 IsFloatingPoint<T>::value)); // arraycopy allows type erased void elements |
1081 typedef typename Decay<T>::type DecayedT; |
1084 typedef typename Decay<T>::type DecayedT; |
1082 const DecoratorSet expanded_decorators = DecoratorFixup<decorators | IN_HEAP_ARRAY | IN_HEAP | |
1085 const DecoratorSet expanded_decorators = DecoratorFixup<decorators | IN_HEAP_ARRAY | IN_HEAP | |
1083 (HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ? |
1086 (HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ? |
1084 INTERNAL_CONVERT_COMPRESSED_OOP : INTERNAL_EMPTY)>::value; |
1087 INTERNAL_CONVERT_COMPRESSED_OOP : INTERNAL_EMPTY)>::value; |
1085 return PreRuntimeDispatch::arraycopy<expanded_decorators>(src_obj, dst_obj, |
1088 return PreRuntimeDispatch::arraycopy<expanded_decorators>(src_obj, dst_obj, |