< prev index next >

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

Print this page
rev 56544 : 8232010: Shenandoah: implement self-fixing native barrier


  52 template <typename T>
  53 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {
  54   oop value = Raw::oop_load_in_heap(addr);
  55   value = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(value);
  56   keep_alive_if_weak(decorators, value);
  57   return value;
  58 }
  59 
  60 template <DecoratorSet decorators, typename BarrierSetT>
  61 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap_at(oop base, ptrdiff_t offset) {
  62   oop value = Raw::oop_load_in_heap_at(base, offset);
  63   value = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(value);
  64   keep_alive_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
  65   return value;
  66 }
  67 
  68 template <DecoratorSet decorators, typename BarrierSetT>
  69 template <typename T>
  70 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
  71   oop value = Raw::oop_load_not_in_heap(addr);
  72   value = ShenandoahBarrierSet::barrier_set()->oop_load_from_native_barrier(value);
  73   keep_alive_if_weak(decorators, value);
  74   return value;
  75 }
  76 
  77 template <DecoratorSet decorators, typename BarrierSetT>
  78 template <typename T>
  79 inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_store_in_heap(T* addr, oop value) {
  80   ShenandoahBarrierSet::barrier_set()->storeval_barrier(value);
  81   const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
  82   if (keep_alive) {
  83     ShenandoahBarrierSet::barrier_set()->write_ref_field_pre_work(addr, value);
  84   }
  85   Raw::oop_store_in_heap(addr, value);
  86 }
  87 
  88 template <DecoratorSet decorators, typename BarrierSetT>
  89 inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
  90   oop_store_in_heap(AccessInternal::oop_field_addr<decorators>(base, offset), value);
  91 }
  92 




  52 template <typename T>
  53 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {
  54   oop value = Raw::oop_load_in_heap(addr);
  55   value = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(value);
  56   keep_alive_if_weak(decorators, value);
  57   return value;
  58 }
  59 
  60 template <DecoratorSet decorators, typename BarrierSetT>
  61 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap_at(oop base, ptrdiff_t offset) {
  62   oop value = Raw::oop_load_in_heap_at(base, offset);
  63   value = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(value);
  64   keep_alive_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
  65   return value;
  66 }
  67 
  68 template <DecoratorSet decorators, typename BarrierSetT>
  69 template <typename T>
  70 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
  71   oop value = Raw::oop_load_not_in_heap(addr);
  72   value = ShenandoahBarrierSet::barrier_set()->oop_load_from_native_barrier(value, addr);
  73   keep_alive_if_weak(decorators, value);
  74   return value;
  75 }
  76 
  77 template <DecoratorSet decorators, typename BarrierSetT>
  78 template <typename T>
  79 inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_store_in_heap(T* addr, oop value) {
  80   ShenandoahBarrierSet::barrier_set()->storeval_barrier(value);
  81   const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
  82   if (keep_alive) {
  83     ShenandoahBarrierSet::barrier_set()->write_ref_field_pre_work(addr, value);
  84   }
  85   Raw::oop_store_in_heap(addr, value);
  86 }
  87 
  88 template <DecoratorSet decorators, typename BarrierSetT>
  89 inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
  90   oop_store_in_heap(AccessInternal::oop_field_addr<decorators>(base, offset), value);
  91 }
  92 


< prev index next >