195
196 // == Arraycopy Decorators ==
197 // * ARRAYCOPY_CHECKCAST: This property means that the class of the objects in source
198 // are not guaranteed to be subclasses of the class of the destination array. This requires
199 // a check-cast barrier during the copying operation. If this is not set, it is assumed
200 // that the array is covariant: (the source array type is-a destination array type)
201 // * ARRAYCOPY_DISJOINT: This property means that it is known that the two array ranges
202 // are disjoint.
203 // * ARRAYCOPY_ARRAYOF: The copy is in the arrayof form.
204 // * ARRAYCOPY_ATOMIC: The accesses have to be atomic over the size of its elements.
205 // * ARRAYCOPY_ALIGNED: The accesses have to be aligned on a HeapWord.
206 const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 24;
207 const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 25;
208 const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 26;
209 const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 27;
210 const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 28;
211 const DecoratorSet ARRAYCOPY_DECORATOR_MASK = ARRAYCOPY_CHECKCAST | ARRAYCOPY_DISJOINT |
212 ARRAYCOPY_DISJOINT | ARRAYCOPY_ARRAYOF |
213 ARRAYCOPY_ATOMIC | ARRAYCOPY_ALIGNED;
214
215 // Keep track of the last decorator.
216 const DecoratorSet DECORATOR_LAST = UCONST64(1) << 28;
217
218 namespace AccessInternal {
219 // This class adds implied decorators that follow according to decorator rules.
220 // For example adding default reference strength and default memory ordering
221 // semantics.
222 template <DecoratorSet input_decorators>
223 struct DecoratorFixup: AllStatic {
224 // If no reference strength has been picked, then strong will be picked
225 static const DecoratorSet ref_strength_default = input_decorators |
226 (((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?
227 ON_STRONG_OOP_REF : INTERNAL_EMPTY);
228 // If no memory ordering has been picked, unordered will be picked
229 static const DecoratorSet memory_ordering_default = ref_strength_default |
230 ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : INTERNAL_EMPTY);
231 // If no barrier strength has been picked, normal will be used
232 static const DecoratorSet barrier_strength_default = memory_ordering_default |
233 ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY);
234 static const DecoratorSet value = barrier_strength_default | BT_BUILDTIME_DECORATORS;
235 };
236
|
195
196 // == Arraycopy Decorators ==
197 // * ARRAYCOPY_CHECKCAST: This property means that the class of the objects in source
198 // are not guaranteed to be subclasses of the class of the destination array. This requires
199 // a check-cast barrier during the copying operation. If this is not set, it is assumed
200 // that the array is covariant: (the source array type is-a destination array type)
201 // * ARRAYCOPY_DISJOINT: This property means that it is known that the two array ranges
202 // are disjoint.
203 // * ARRAYCOPY_ARRAYOF: The copy is in the arrayof form.
204 // * ARRAYCOPY_ATOMIC: The accesses have to be atomic over the size of its elements.
205 // * ARRAYCOPY_ALIGNED: The accesses have to be aligned on a HeapWord.
206 const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 24;
207 const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 25;
208 const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 26;
209 const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 27;
210 const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 28;
211 const DecoratorSet ARRAYCOPY_DECORATOR_MASK = ARRAYCOPY_CHECKCAST | ARRAYCOPY_DISJOINT |
212 ARRAYCOPY_DISJOINT | ARRAYCOPY_ARRAYOF |
213 ARRAYCOPY_ATOMIC | ARRAYCOPY_ALIGNED;
214
215 // == Resolve barrier decorators ==
216 // * ACCESS_READ: Indicate that the resolved object is accessed read-only. This allows the GC
217 // backend to use weaker and more efficient barriers.
218 // * ACCESS_WRITE: Indicate that the resolved object is used for write access.
219 const DecoratorSet ACCESS_READ = UCONST64(1) << 29;
220 const DecoratorSet ACCESS_WRITE = UCONST64(1) << 30;
221
222 // Keep track of the last decorator.
223 const DecoratorSet DECORATOR_LAST = UCONST64(1) << 30;
224
225 namespace AccessInternal {
226 // This class adds implied decorators that follow according to decorator rules.
227 // For example adding default reference strength and default memory ordering
228 // semantics.
229 template <DecoratorSet input_decorators>
230 struct DecoratorFixup: AllStatic {
231 // If no reference strength has been picked, then strong will be picked
232 static const DecoratorSet ref_strength_default = input_decorators |
233 (((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?
234 ON_STRONG_OOP_REF : INTERNAL_EMPTY);
235 // If no memory ordering has been picked, unordered will be picked
236 static const DecoratorSet memory_ordering_default = ref_strength_default |
237 ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : INTERNAL_EMPTY);
238 // If no barrier strength has been picked, normal will be used
239 static const DecoratorSet barrier_strength_default = memory_ordering_default |
240 ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY);
241 static const DecoratorSet value = barrier_strength_default | BT_BUILDTIME_DECORATORS;
242 };
243
|