81 template <typename T>
82 inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
83 oop_load_in_heap(T* addr) {
84 oop value = ModRef::oop_load_in_heap(addr);
85 enqueue_if_weak(decorators, value);
86 return value;
87 }
88
89 template <DecoratorSet decorators, typename BarrierSetT>
90 inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
91 oop_load_in_heap_at(oop base, ptrdiff_t offset) {
92 oop value = ModRef::oop_load_in_heap_at(base, offset);
93 enqueue_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
94 return value;
95 }
96
97 template <DecoratorSet decorators, typename BarrierSetT>
98 template <typename T>
99 inline void G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
100 oop_store_not_in_heap(T* addr, oop new_value) {
101 if (HasDecorator<decorators, IN_CONCURRENT_ROOT>::value) {
102 // For roots not scanned in a safepoint, we have to apply SATB barriers
103 // even for roots.
104 G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
105 bs->write_ref_field_pre<decorators>(addr);
106 }
107 Raw::oop_store(addr, new_value);
108 }
109
110 #endif // SHARE_VM_GC_G1_G1BARRIERSET_INLINE_HPP
|
81 template <typename T>
82 inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
83 oop_load_in_heap(T* addr) {
84 oop value = ModRef::oop_load_in_heap(addr);
85 enqueue_if_weak(decorators, value);
86 return value;
87 }
88
89 template <DecoratorSet decorators, typename BarrierSetT>
90 inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
91 oop_load_in_heap_at(oop base, ptrdiff_t offset) {
92 oop value = ModRef::oop_load_in_heap_at(base, offset);
93 enqueue_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
94 return value;
95 }
96
97 template <DecoratorSet decorators, typename BarrierSetT>
98 template <typename T>
99 inline void G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
100 oop_store_not_in_heap(T* addr, oop new_value) {
101 // Apply SATB barriers for all non-heap references, to allow
102 // concurrent scanning of such references.
103 G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
104 bs->write_ref_field_pre<decorators>(addr);
105 Raw::oop_store(addr, new_value);
106 }
107
108 #endif // SHARE_VM_GC_G1_G1BARRIERSET_INLINE_HPP
|