< prev index next >

src/hotspot/share/oops/access.hpp

Print this page




 103   static void verify_decorators();
 104 
 105   template <DecoratorSet expected_mo_decorators>
 106   static void verify_primitive_decorators() {
 107     const DecoratorSet primitive_decorators = (AS_DECORATOR_MASK ^ AS_NO_KEEPALIVE) |
 108                                               IN_HEAP | IS_ARRAY;
 109     verify_decorators<expected_mo_decorators | primitive_decorators>();
 110   }
 111 
 112   template <DecoratorSet expected_mo_decorators>
 113   static void verify_oop_decorators() {
 114     const DecoratorSet oop_decorators = AS_DECORATOR_MASK | IN_DECORATOR_MASK |
 115                                         (ON_DECORATOR_MASK ^ ON_UNKNOWN_OOP_REF) | // no unknown oop refs outside of the heap
 116                                         IS_ARRAY | IS_NOT_NULL | IS_DEST_UNINITIALIZED;
 117     verify_decorators<expected_mo_decorators | oop_decorators>();
 118   }
 119 
 120   template <DecoratorSet expected_mo_decorators>
 121   static void verify_heap_oop_decorators() {
 122     const DecoratorSet heap_oop_decorators = AS_DECORATOR_MASK | ON_DECORATOR_MASK |
 123                                              IN_HEAP | IS_ARRAY | IS_NOT_NULL;
 124     verify_decorators<expected_mo_decorators | heap_oop_decorators>();
 125   }
 126 
 127   static const DecoratorSet load_mo_decorators = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | MO_ACQUIRE | MO_SEQ_CST;
 128   static const DecoratorSet store_mo_decorators = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | MO_RELEASE | MO_SEQ_CST;
 129   static const DecoratorSet atomic_xchg_mo_decorators = MO_SEQ_CST;
 130   static const DecoratorSet atomic_cmpxchg_mo_decorators = MO_RELAXED | MO_SEQ_CST;
 131 
 132 protected:
 133   template <typename T>
 134   static inline bool oop_arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const T* src_raw,
 135                                    arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 136                                    size_t length) {
 137     verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP |
 138                       AS_DECORATOR_MASK | IS_ARRAY | IS_DEST_UNINITIALIZED>();
 139     return AccessInternal::arraycopy<decorators | INTERNAL_VALUE_IS_OOP>(src_obj, src_offset_in_bytes, src_raw,
 140                                                                          dst_obj, dst_offset_in_bytes, dst_raw,
 141                                                                          length);
 142   }
 143 




 103   static void verify_decorators();
 104 
 105   template <DecoratorSet expected_mo_decorators>
 106   static void verify_primitive_decorators() {
 107     const DecoratorSet primitive_decorators = (AS_DECORATOR_MASK ^ AS_NO_KEEPALIVE) |
 108                                               IN_HEAP | IS_ARRAY;
 109     verify_decorators<expected_mo_decorators | primitive_decorators>();
 110   }
 111 
 112   template <DecoratorSet expected_mo_decorators>
 113   static void verify_oop_decorators() {
 114     const DecoratorSet oop_decorators = AS_DECORATOR_MASK | IN_DECORATOR_MASK |
 115                                         (ON_DECORATOR_MASK ^ ON_UNKNOWN_OOP_REF) | // no unknown oop refs outside of the heap
 116                                         IS_ARRAY | IS_NOT_NULL | IS_DEST_UNINITIALIZED;
 117     verify_decorators<expected_mo_decorators | oop_decorators>();
 118   }
 119 
 120   template <DecoratorSet expected_mo_decorators>
 121   static void verify_heap_oop_decorators() {
 122     const DecoratorSet heap_oop_decorators = AS_DECORATOR_MASK | ON_DECORATOR_MASK |
 123                                              IN_HEAP | IS_ARRAY | IS_NOT_NULL | IS_DEST_UNINITIALIZED;
 124     verify_decorators<expected_mo_decorators | heap_oop_decorators>();
 125   }
 126 
 127   static const DecoratorSet load_mo_decorators = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | MO_ACQUIRE | MO_SEQ_CST;
 128   static const DecoratorSet store_mo_decorators = MO_UNORDERED | MO_VOLATILE | MO_RELAXED | MO_RELEASE | MO_SEQ_CST;
 129   static const DecoratorSet atomic_xchg_mo_decorators = MO_SEQ_CST;
 130   static const DecoratorSet atomic_cmpxchg_mo_decorators = MO_RELAXED | MO_SEQ_CST;
 131 
 132 protected:
 133   template <typename T>
 134   static inline bool oop_arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const T* src_raw,
 135                                    arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
 136                                    size_t length) {
 137     verify_decorators<ARRAYCOPY_DECORATOR_MASK | IN_HEAP |
 138                       AS_DECORATOR_MASK | IS_ARRAY | IS_DEST_UNINITIALIZED>();
 139     return AccessInternal::arraycopy<decorators | INTERNAL_VALUE_IS_OOP>(src_obj, src_offset_in_bytes, src_raw,
 140                                                                          dst_obj, dst_offset_in_bytes, dst_raw,
 141                                                                          length);
 142   }
 143 


< prev index next >