978 equals(oop o1, oop o2) { |
978 equals(oop o1, oop o2) { |
979 return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2); |
979 return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2); |
980 } |
980 } |
981 }; |
981 }; |
982 |
982 |
983 // This class adds implied decorators that follow according to decorator rules. |
|
984 // For example adding default reference strength and default memory ordering |
|
985 // semantics. |
|
986 template <DecoratorSet input_decorators> |
|
987 struct DecoratorFixup: AllStatic { |
|
988 // If no reference strength has been picked, then strong will be picked |
|
989 static const DecoratorSet ref_strength_default = input_decorators | |
|
990 (((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ? |
|
991 ON_STRONG_OOP_REF : INTERNAL_EMPTY); |
|
992 // If no memory ordering has been picked, unordered will be picked |
|
993 static const DecoratorSet memory_ordering_default = ref_strength_default | |
|
994 ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : INTERNAL_EMPTY); |
|
995 // If no barrier strength has been picked, normal will be used |
|
996 static const DecoratorSet barrier_strength_default = memory_ordering_default | |
|
997 ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY); |
|
998 // Heap array accesses imply it is a heap access |
|
999 static const DecoratorSet heap_array_is_in_heap = barrier_strength_default | |
|
1000 ((IN_HEAP_ARRAY & barrier_strength_default) != 0 ? IN_HEAP : INTERNAL_EMPTY); |
|
1001 static const DecoratorSet conc_root_is_root = heap_array_is_in_heap | |
|
1002 ((IN_CONCURRENT_ROOT & heap_array_is_in_heap) != 0 ? IN_ROOT : INTERNAL_EMPTY); |
|
1003 static const DecoratorSet archive_root_is_root = conc_root_is_root | |
|
1004 ((IN_ARCHIVE_ROOT & conc_root_is_root) != 0 ? IN_ROOT : INTERNAL_EMPTY); |
|
1005 static const DecoratorSet value = archive_root_is_root | BT_BUILDTIME_DECORATORS; |
|
1006 }; |
|
1007 |
|
1008 // Step 2: Reduce types. |
983 // Step 2: Reduce types. |
1009 // Enforce that for non-oop types, T and P have to be strictly the same. |
984 // Enforce that for non-oop types, T and P have to be strictly the same. |
1010 // P is the type of the address and T is the type of the values. |
985 // P is the type of the address and T is the type of the values. |
1011 // As for oop types, it is allow to send T in {narrowOop, oop} and |
986 // As for oop types, it is allow to send T in {narrowOop, oop} and |
1012 // P in {narrowOop, oop, HeapWord*}. The following rules apply according to |
987 // P in {narrowOop, oop, HeapWord*}. The following rules apply according to |