< prev index next >

src/hotspot/share/oops/access.hpp

Print this page

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

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