< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp

Print this page
rev 57948 : 8238574: Shenandoah: Assertion failure due to missing null check


 103     keep_alive_barrier(value);
 104   }
 105 }
 106 
 107 template <DecoratorSet decorators>
 108 inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) {
 109   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
 110   if (!HasDecorator<decorators, ON_STRONG_OOP_REF>::value &&
 111       !HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
 112     keep_alive_barrier(value);
 113   }
 114 }
 115 
 116 template <DecoratorSet decorators, typename BarrierSetT>
 117 template <typename T>
 118 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
 119   oop value = Raw::oop_load_not_in_heap(addr);
 120   if (value != NULL) {
 121     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
 122     value = bs->load_reference_barrier_native(value, addr);

 123     bs->keep_alive_if_weak<decorators>(value);

 124   }
 125   return value;
 126 }
 127 
 128 template <DecoratorSet decorators, typename BarrierSetT>
 129 template <typename T>
 130 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {
 131   oop value = Raw::oop_load_in_heap(addr);
 132   if (value != NULL) {
 133     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
 134     value = bs->load_reference_barrier_not_null(value);
 135     bs->keep_alive_if_weak<decorators>(value);
 136   }
 137   return value;
 138 }
 139 
 140 template <DecoratorSet decorators, typename BarrierSetT>
 141 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap_at(oop base, ptrdiff_t offset) {
 142   oop value = Raw::oop_load_in_heap_at(base, offset);
 143   if (value != NULL) {




 103     keep_alive_barrier(value);
 104   }
 105 }
 106 
 107 template <DecoratorSet decorators>
 108 inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) {
 109   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
 110   if (!HasDecorator<decorators, ON_STRONG_OOP_REF>::value &&
 111       !HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
 112     keep_alive_barrier(value);
 113   }
 114 }
 115 
 116 template <DecoratorSet decorators, typename BarrierSetT>
 117 template <typename T>
 118 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
 119   oop value = Raw::oop_load_not_in_heap(addr);
 120   if (value != NULL) {
 121     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
 122     value = bs->load_reference_barrier_native(value, addr);
 123     if (value != NULL) {
 124       bs->keep_alive_if_weak<decorators>(value);
 125     }
 126   }
 127   return value;
 128 }
 129 
 130 template <DecoratorSet decorators, typename BarrierSetT>
 131 template <typename T>
 132 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {
 133   oop value = Raw::oop_load_in_heap(addr);
 134   if (value != NULL) {
 135     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
 136     value = bs->load_reference_barrier_not_null(value);
 137     bs->keep_alive_if_weak<decorators>(value);
 138   }
 139   return value;
 140 }
 141 
 142 template <DecoratorSet decorators, typename BarrierSetT>
 143 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap_at(oop base, ptrdiff_t offset) {
 144   oop value = Raw::oop_load_in_heap_at(base, offset);
 145   if (value != NULL) {


< prev index next >