< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp

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


  83 }
  84 
  85 bool ShenandoahBarrierSet::need_load_reference_barrier(DecoratorSet decorators, BasicType type) {
  86   if (!ShenandoahLoadRefBarrier) return false;
  87   // Only needed for references
  88   return is_reference_type(type);
  89 }
  90 
  91 bool ShenandoahBarrierSet::use_load_reference_barrier_native(DecoratorSet decorators, BasicType type) {
  92   assert(need_load_reference_barrier(decorators, type), "Should be subset of LRB");
  93   assert(is_reference_type(type), "Why we here?");
  94   // Native load reference barrier is only needed for concurrent root processing
  95   if (!ShenandoahConcurrentRoots::can_do_concurrent_roots()) {
  96     return false;
  97   }
  98 
  99   return (decorators & IN_NATIVE) != 0;
 100 }
 101 
 102 bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,BasicType type) {
 103   if (!ShenandoahKeepAliveBarrier) return false;
 104   // Only needed for references
 105   if (!is_reference_type(type)) return false;
 106 
 107   bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
 108   bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0;
 109   bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
 110   bool on_weak_ref = (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) != 0;
 111   return (on_weak_ref || unknown) && (keep_alive || is_traversal_mode);
 112 }
 113 
 114 oop ShenandoahBarrierSet::load_reference_barrier_not_null(oop obj) {
 115   if (ShenandoahLoadRefBarrier && _heap->has_forwarded_objects()) {
 116     return load_reference_barrier_impl(obj);
 117   } else {
 118     return obj;
 119   }
 120 }
 121 
 122 oop ShenandoahBarrierSet::load_reference_barrier(oop obj) {
 123   if (obj != NULL) {




  83 }
  84 
  85 bool ShenandoahBarrierSet::need_load_reference_barrier(DecoratorSet decorators, BasicType type) {
  86   if (!ShenandoahLoadRefBarrier) return false;
  87   // Only needed for references
  88   return is_reference_type(type);
  89 }
  90 
  91 bool ShenandoahBarrierSet::use_load_reference_barrier_native(DecoratorSet decorators, BasicType type) {
  92   assert(need_load_reference_barrier(decorators, type), "Should be subset of LRB");
  93   assert(is_reference_type(type), "Why we here?");
  94   // Native load reference barrier is only needed for concurrent root processing
  95   if (!ShenandoahConcurrentRoots::can_do_concurrent_roots()) {
  96     return false;
  97   }
  98 
  99   return (decorators & IN_NATIVE) != 0;
 100 }
 101 
 102 bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,BasicType type) {
 103   if (!ShenandoahSATBBarrier) return false;
 104   // Only needed for references
 105   if (!is_reference_type(type)) return false;
 106 
 107   bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
 108   bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0;
 109   bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
 110   bool on_weak_ref = (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) != 0;
 111   return (on_weak_ref || unknown) && (keep_alive || is_traversal_mode);
 112 }
 113 
 114 oop ShenandoahBarrierSet::load_reference_barrier_not_null(oop obj) {
 115   if (ShenandoahLoadRefBarrier && _heap->has_forwarded_objects()) {
 116     return load_reference_barrier_impl(obj);
 117   } else {
 118     return obj;
 119   }
 120 }
 121 
 122 oop ShenandoahBarrierSet::load_reference_barrier(oop obj) {
 123   if (obj != NULL) {


< prev index next >