< prev index next >

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

8198949_arraycopy

29 
30 class Klass;                                                                                                                         
31 
32 class ModRefBarrierSet: public BarrierSet {                                                                                          
33 protected:                                                                                                                           
34   ModRefBarrierSet(const BarrierSet::FakeRtti& fake_rtti)                                                                            
35     : BarrierSet(fake_rtti.add_tag(BarrierSet::ModRef)) { }                                                                          
36   ~ModRefBarrierSet() { }                                                                                                            
37 
38 public:                                                                                                                              
39   template <DecoratorSet decorators, typename T>                                                                                     
40   inline void write_ref_field_pre(T* addr) {}                                                                                        
41 
42   template <DecoratorSet decorators, typename T>                                                                                     
43   inline void write_ref_field_post(T *addr, oop new_value) {}                                                                        
44 
45   // Causes all refs in "mr" to be assumed to be modified.                                                                           
46   virtual void invalidate(MemRegion mr) = 0;                                                                                         
47   virtual void write_region(MemRegion mr) = 0;                                                                                       
48 
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
49   // The ModRef abstraction introduces pre and post barriers                                                                         
50   template <DecoratorSet decorators, typename BarrierSetT>                                                                           
51   class AccessBarrier: public BarrierSet::AccessBarrier<decorators, BarrierSetT> {                                                   
52     typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;                                                                  
53 
54   public:                                                                                                                            
55     template <typename T>                                                                                                            
56     static void oop_store_in_heap(T* addr, oop value);                                                                               
57     template <typename T>                                                                                                            
58     static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value);                                                
59     template <typename T>                                                                                                            
60     static oop oop_atomic_xchg_in_heap(oop new_value, T* addr);                                                                      
61 
62     template <typename T>                                                                                                            
63     static bool oop_arraycopy_in_heap(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length);                            
64 
65     static void clone_in_heap(oop src, oop dst, size_t size);                                                                        
66 
67     static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {                                                        

29 
30 class Klass;
31 
32 class ModRefBarrierSet: public BarrierSet {
33 protected:
34   ModRefBarrierSet(const BarrierSet::FakeRtti& fake_rtti)
35     : BarrierSet(fake_rtti.add_tag(BarrierSet::ModRef)) { }
36   ~ModRefBarrierSet() { }
37 
38 public:
39   template <DecoratorSet decorators, typename T>
40   inline void write_ref_field_pre(T* addr) {}
41 
42   template <DecoratorSet decorators, typename T>
43   inline void write_ref_field_post(T *addr, oop new_value) {}
44 
45   // Causes all refs in "mr" to be assumed to be modified.
46   virtual void invalidate(MemRegion mr) = 0;
47   virtual void write_region(MemRegion mr) = 0;
48 
49   // Operations on arrays, or general regions (e.g., for "clone") may be
50   // optimized by some barriers.
51 
52   // Below length is the # array elements being written
53   virtual void write_ref_array_pre(oop* dst, int length,
54                                    bool dest_uninitialized = false) {}
55   virtual void write_ref_array_pre(narrowOop* dst, int length,
56                                    bool dest_uninitialized = false) {}
57   // Below count is the # array elements being written, starting
58   // at the address "start", which may not necessarily be HeapWord-aligned
59   inline void write_ref_array(HeapWord* start, size_t count);
60 
61  protected:
62   virtual void write_ref_array_work(MemRegion mr) = 0;
63 
64  public:
65   // The ModRef abstraction introduces pre and post barriers
66   template <DecoratorSet decorators, typename BarrierSetT>
67   class AccessBarrier: public BarrierSet::AccessBarrier<decorators, BarrierSetT> {
68     typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
69 
70   public:
71     template <typename T>
72     static void oop_store_in_heap(T* addr, oop value);
73     template <typename T>
74     static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value);
75     template <typename T>
76     static oop oop_atomic_xchg_in_heap(oop new_value, T* addr);
77 
78     template <typename T>
79     static bool oop_arraycopy_in_heap(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length);
80 
81     static void clone_in_heap(oop src, oop dst, size_t size);
82 
83     static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
< prev index next >