< prev index next >

src/hotspot/share/oops/accessBackend.hpp

BarrierSetC1_v2

962     resolve(oop obj) {                                                                                                               
963       return RuntimeDispatch<decorators, oop, BARRIER_RESOLVE>::resolve(obj);                                                        
964     }                                                                                                                                
965 
966     template <DecoratorSet decorators>                                                                                               
967     inline static typename EnableIf<                                                                                                 
968       HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type                                                   
969     equals(oop o1, oop o2) {                                                                                                         
970       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;                                                                 
971       return Raw::equals(o1, o2);                                                                                                    
972     }                                                                                                                                
973 
974     template <DecoratorSet decorators>                                                                                               
975     inline static typename EnableIf<                                                                                                 
976       !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type                                                  
977     equals(oop o1, oop o2) {                                                                                                         
978       return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2);                                                       
979     }                                                                                                                                
980   };                                                                                                                                 
981 
982   // This class adds implied decorators that follow according to decorator rules.                                                    
983   // For example adding default reference strength and default memory ordering                                                       
984   // semantics.                                                                                                                      
985   template <DecoratorSet input_decorators>                                                                                           
986   struct DecoratorFixup: AllStatic {                                                                                                 
987     // If no reference strength has been picked, then strong will be picked                                                          
988     static const DecoratorSet ref_strength_default = input_decorators |                                                              
989       (((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?                            
990        ON_STRONG_OOP_REF : INTERNAL_EMPTY);                                                                                          
991     // If no memory ordering has been picked, unordered will be picked                                                               
992     static const DecoratorSet memory_ordering_default = ref_strength_default |                                                       
993       ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : INTERNAL_EMPTY);                                             
994     // If no barrier strength has been picked, normal will be used                                                                   
995     static const DecoratorSet barrier_strength_default = memory_ordering_default |                                                   
996       ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY);                                             
997     // Heap array accesses imply it is a heap access                                                                                 
998     static const DecoratorSet heap_array_is_in_heap = barrier_strength_default |                                                     
999       ((IN_HEAP_ARRAY & barrier_strength_default) != 0 ? IN_HEAP : INTERNAL_EMPTY);                                                  
1000     static const DecoratorSet conc_root_is_root = heap_array_is_in_heap |                                                            
1001       ((IN_CONCURRENT_ROOT & heap_array_is_in_heap) != 0 ? IN_ROOT : INTERNAL_EMPTY);                                                
1002     static const DecoratorSet archive_root_is_root = conc_root_is_root |                                                             
1003       ((IN_ARCHIVE_ROOT & conc_root_is_root) != 0 ? IN_ROOT : INTERNAL_EMPTY);                                                       
1004     static const DecoratorSet value = archive_root_is_root | BT_BUILDTIME_DECORATORS;                                                
1005   };                                                                                                                                 
1006                                                                                                                                      
1007   // Step 2: Reduce types.                                                                                                           
1008   // Enforce that for non-oop types, T and P have to be strictly the same.                                                           
1009   // P is the type of the address and T is the type of the values.                                                                   
1010   // As for oop types, it is allow to send T in {narrowOop, oop} and                                                                 
1011   // P in {narrowOop, oop, HeapWord*}. The following rules apply according to                                                        
1012   // the subsequent table. (columns are P, rows are T)                                                                               
1013   // |           | HeapWord  |   oop   | narrowOop |                                                                                 
1014   // |   oop     |  rt-comp  | hw-none |  hw-comp  |                                                                                 
1015   // | narrowOop |     x     |    x    |  hw-none  |                                                                                 
1016   //                                                                                                                                 
1017   // x means not allowed                                                                                                             
1018   // rt-comp means it must be checked at runtime whether the oop is compressed.                                                      
1019   // hw-none means it is statically known the oop will not be compressed.                                                            
1020   // hw-comp means it is statically known the oop will be compressed.                                                                
1021 
1022   template <DecoratorSet decorators, typename T>                                                                                     
1023   inline void store_reduce_types(T* addr, T value) {                                                                                 
1024     PreRuntimeDispatch::store<decorators>(addr, value);                                                                              
1025   }                                                                                                                                  

962     resolve(oop obj) {
963       return RuntimeDispatch<decorators, oop, BARRIER_RESOLVE>::resolve(obj);
964     }
965 
966     template <DecoratorSet decorators>
967     inline static typename EnableIf<
968       HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
969     equals(oop o1, oop o2) {
970       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
971       return Raw::equals(o1, o2);
972     }
973 
974     template <DecoratorSet decorators>
975     inline static typename EnableIf<
976       !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
977     equals(oop o1, oop o2) {
978       return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2);
979     }
980   };
981 

























982   // Step 2: Reduce types.
983   // Enforce that for non-oop types, T and P have to be strictly the same.
984   // P is the type of the address and T is the type of the values.
985   // As for oop types, it is allow to send T in {narrowOop, oop} and
986   // P in {narrowOop, oop, HeapWord*}. The following rules apply according to
987   // the subsequent table. (columns are P, rows are T)
988   // |           | HeapWord  |   oop   | narrowOop |
989   // |   oop     |  rt-comp  | hw-none |  hw-comp  |
990   // | narrowOop |     x     |    x    |  hw-none  |
991   //
992   // x means not allowed
993   // rt-comp means it must be checked at runtime whether the oop is compressed.
994   // hw-none means it is statically known the oop will not be compressed.
995   // hw-comp means it is statically known the oop will be compressed.
996 
997   template <DecoratorSet decorators, typename T>
998   inline void store_reduce_types(T* addr, T value) {
999     PreRuntimeDispatch::store<decorators>(addr, value);
1000   }
< prev index next >