< prev index next >

src/hotspot/share/gc/shared/modRefBarrierSet.hpp

Print this page




  62   inline void write_ref_array(HeapWord* start, size_t count);
  63 
  64  protected:
  65   virtual void write_ref_array_work(MemRegion mr) = 0;
  66 
  67  public:
  68   // The ModRef abstraction introduces pre and post barriers
  69   template <DecoratorSet decorators, typename BarrierSetT>
  70   class AccessBarrier: public BarrierSet::AccessBarrier<decorators, BarrierSetT> {
  71     typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
  72 
  73   public:
  74     template <typename T>
  75     static void oop_store_in_heap(T* addr, oop value);
  76     template <typename T>
  77     static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value);
  78     template <typename T>
  79     static oop oop_atomic_xchg_in_heap(oop new_value, T* addr);
  80 
  81     template <typename T>
  82     static bool oop_arraycopy_in_heap(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length);
  83 
  84     static void clone_in_heap(oop src, oop dst, size_t size);
  85 
  86     static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
  87       oop_store_in_heap(AccessInternal::oop_field_addr<decorators>(base, offset), value);
  88     }
  89 
  90     static oop oop_atomic_xchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset) {
  91       return oop_atomic_xchg_in_heap(new_value, AccessInternal::oop_field_addr<decorators>(base, offset));
  92     }
  93 
  94     static oop oop_atomic_cmpxchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset, oop compare_value) {
  95       return oop_atomic_cmpxchg_in_heap(new_value, AccessInternal::oop_field_addr<decorators>(base, offset), compare_value);
  96     }
  97   };
  98 };
  99 
 100 template<>
 101 struct BarrierSet::GetName<ModRefBarrierSet> {
 102   static const BarrierSet::Name value = BarrierSet::ModRef;


  62   inline void write_ref_array(HeapWord* start, size_t count);
  63 
  64  protected:
  65   virtual void write_ref_array_work(MemRegion mr) = 0;
  66 
  67  public:
  68   // The ModRef abstraction introduces pre and post barriers
  69   template <DecoratorSet decorators, typename BarrierSetT>
  70   class AccessBarrier: public BarrierSet::AccessBarrier<decorators, BarrierSetT> {
  71     typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
  72 
  73   public:
  74     template <typename T>
  75     static void oop_store_in_heap(T* addr, oop value);
  76     template <typename T>
  77     static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value);
  78     template <typename T>
  79     static oop oop_atomic_xchg_in_heap(oop new_value, T* addr);
  80 
  81     template <typename T>
  82     static bool oop_arraycopy_in_heap(arrayOop src_obj, ptrdiff_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, ptrdiff_t dst_offset_in_bytes, T* dst_raw, size_t length);
  83 
  84     static void clone_in_heap(oop src, oop dst, size_t size);
  85 
  86     static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
  87       oop_store_in_heap(AccessInternal::oop_field_addr<decorators>(base, offset), value);
  88     }
  89 
  90     static oop oop_atomic_xchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset) {
  91       return oop_atomic_xchg_in_heap(new_value, AccessInternal::oop_field_addr<decorators>(base, offset));
  92     }
  93 
  94     static oop oop_atomic_cmpxchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset, oop compare_value) {
  95       return oop_atomic_cmpxchg_in_heap(new_value, AccessInternal::oop_field_addr<decorators>(base, offset), compare_value);
  96     }
  97   };
  98 };
  99 
 100 template<>
 101 struct BarrierSet::GetName<ModRefBarrierSet> {
 102   static const BarrierSet::Name value = BarrierSet::ModRef;
< prev index next >