< prev index next >

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

Print this page
rev 58558 : 8241605: Shenandoah: More aggressive reference discovery


  75     T heap_oop = RawAccess<>::oop_load(field);
  76     if (!CompressedOops::is_null(heap_oop)) {
  77       enqueue(CompressedOops::decode(heap_oop));
  78     }
  79   }
  80 }
  81 
  82 inline void ShenandoahBarrierSet::satb_enqueue(oop value) {
  83   assert(value != NULL, "checked before");
  84   if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
  85     enqueue(value);
  86   }
  87 }
  88 
  89 inline void ShenandoahBarrierSet::storeval_barrier(oop obj) {
  90   if (obj != NULL && ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_traversal_in_progress()) {
  91     enqueue(obj);
  92   }
  93 }
  94 
  95 inline void ShenandoahBarrierSet::keep_alive_barrier(oop value) {
  96   assert(value != NULL, "checked before");
  97   if (ShenandoahKeepAliveBarrier && _heap->is_concurrent_mark_in_progress()) {
  98     enqueue(value);
  99   }
 100 }
 101 
 102 inline void ShenandoahBarrierSet::keep_alive_if_weak(DecoratorSet decorators, oop value) {
 103   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
 104   const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
 105   const bool peek              = (decorators & AS_NO_KEEPALIVE) != 0;
 106   if (!peek && !on_strong_oop_ref) {
 107     keep_alive_barrier(value);
 108   }
 109 }
 110 
 111 template <DecoratorSet decorators>
 112 inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) {
 113   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
 114   if (!HasDecorator<decorators, ON_STRONG_OOP_REF>::value &&
 115       !HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
 116     keep_alive_barrier(value);
 117   }
 118 }
 119 
 120 template <DecoratorSet decorators, typename BarrierSetT>
 121 template <typename T>
 122 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
 123   oop value = Raw::oop_load_not_in_heap(addr);
 124   if (value != NULL) {
 125     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
 126     value = bs->load_reference_barrier_native(value, addr);
 127     if (value != NULL) {
 128       bs->keep_alive_if_weak<decorators>(value);
 129     }
 130   }
 131   return value;
 132 }
 133 
 134 template <DecoratorSet decorators, typename BarrierSetT>
 135 template <typename T>
 136 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {




  75     T heap_oop = RawAccess<>::oop_load(field);
  76     if (!CompressedOops::is_null(heap_oop)) {
  77       enqueue(CompressedOops::decode(heap_oop));
  78     }
  79   }
  80 }
  81 
  82 inline void ShenandoahBarrierSet::satb_enqueue(oop value) {
  83   assert(value != NULL, "checked before");
  84   if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
  85     enqueue(value);
  86   }
  87 }
  88 
  89 inline void ShenandoahBarrierSet::storeval_barrier(oop obj) {
  90   if (obj != NULL && ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_traversal_in_progress()) {
  91     enqueue(obj);
  92   }
  93 }
  94 







  95 inline void ShenandoahBarrierSet::keep_alive_if_weak(DecoratorSet decorators, oop value) {
  96   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
  97   const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
  98   const bool peek              = (decorators & AS_NO_KEEPALIVE) != 0;
  99   if (!peek && !on_strong_oop_ref) {
 100     satb_enqueue(value);
 101   }
 102 }
 103 
 104 template <DecoratorSet decorators>
 105 inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) {
 106   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
 107   if (!HasDecorator<decorators, ON_STRONG_OOP_REF>::value &&
 108       !HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
 109     satb_enqueue(value);
 110   }
 111 }
 112 
 113 template <DecoratorSet decorators, typename BarrierSetT>
 114 template <typename T>
 115 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
 116   oop value = Raw::oop_load_not_in_heap(addr);
 117   if (value != NULL) {
 118     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
 119     value = bs->load_reference_barrier_native(value, addr);
 120     if (value != NULL) {
 121       bs->keep_alive_if_weak<decorators>(value);
 122     }
 123   }
 124   return value;
 125 }
 126 
 127 template <DecoratorSet decorators, typename BarrierSetT>
 128 template <typename T>
 129 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {


< prev index next >