135 virtual void print_on(outputStream* st) const = 0; 136 137 static BarrierSet* barrier_set() { return _barrier_set; } 138 static void set_barrier_set(BarrierSet* barrier_set); 139 140 BarrierSetAssembler* barrier_set_assembler() { 141 assert(_barrier_set_assembler != NULL, "should be set"); 142 return _barrier_set_assembler; 143 } 144 145 BarrierSetC1* barrier_set_c1() { 146 assert(_barrier_set_c1 != NULL, "should be set"); 147 return _barrier_set_c1; 148 } 149 150 BarrierSetC2* barrier_set_c2() { 151 assert(_barrier_set_c2 != NULL, "should be set"); 152 return _barrier_set_c2; 153 } 154 155 #ifdef ASSERT 156 virtual void verify_safe_oop(oop p); 157 #endif 158 159 // The AccessBarrier of a BarrierSet subclass is called by the Access API 160 // (cf. oops/access.hpp) to perform decorated accesses. GC implementations 161 // may override these default access operations by declaring an 162 // AccessBarrier class in its BarrierSet. Its accessors will then be 163 // automatically resolved at runtime. 164 // 165 // In order to register a new FooBarrierSet::AccessBarrier with the Access API, 166 // the following steps should be taken: 167 // 1) Provide an enum "name" for the BarrierSet in barrierSetConfig.hpp 168 // 2) Make sure the barrier set headers are included from barrierSetConfig.inline.hpp 169 // 3) Provide specializations for BarrierSet::GetName and BarrierSet::GetType. 170 template <DecoratorSet decorators, typename BarrierSetT> 171 class AccessBarrier: protected RawAccessBarrier<decorators> { 172 private: 173 typedef RawAccessBarrier<decorators> Raw; 174 175 public: 176 // Primitive heap accesses. These accessors get resolved when 177 // IN_HEAP is set (e.g. when using the HeapAccess API), it is 178 // not an oop_* overload, and the barrier strength is AS_NORMAL. | 135 virtual void print_on(outputStream* st) const = 0; 136 137 static BarrierSet* barrier_set() { return _barrier_set; } 138 static void set_barrier_set(BarrierSet* barrier_set); 139 140 BarrierSetAssembler* barrier_set_assembler() { 141 assert(_barrier_set_assembler != NULL, "should be set"); 142 return _barrier_set_assembler; 143 } 144 145 BarrierSetC1* barrier_set_c1() { 146 assert(_barrier_set_c1 != NULL, "should be set"); 147 return _barrier_set_c1; 148 } 149 150 BarrierSetC2* barrier_set_c2() { 151 assert(_barrier_set_c2 != NULL, "should be set"); 152 return _barrier_set_c2; 153 } 154 155 // The AccessBarrier of a BarrierSet subclass is called by the Access API 156 // (cf. oops/access.hpp) to perform decorated accesses. GC implementations 157 // may override these default access operations by declaring an 158 // AccessBarrier class in its BarrierSet. Its accessors will then be 159 // automatically resolved at runtime. 160 // 161 // In order to register a new FooBarrierSet::AccessBarrier with the Access API, 162 // the following steps should be taken: 163 // 1) Provide an enum "name" for the BarrierSet in barrierSetConfig.hpp 164 // 2) Make sure the barrier set headers are included from barrierSetConfig.inline.hpp 165 // 3) Provide specializations for BarrierSet::GetName and BarrierSet::GetType. 166 template <DecoratorSet decorators, typename BarrierSetT> 167 class AccessBarrier: protected RawAccessBarrier<decorators> { 168 private: 169 typedef RawAccessBarrier<decorators> Raw; 170 171 public: 172 // Primitive heap accesses. These accessors get resolved when 173 // IN_HEAP is set (e.g. when using the HeapAccess API), it is 174 // not an oop_* overload, and the barrier strength is AS_NORMAL. |