< prev index next >

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

BarrierSetC2

16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                                     
17  *                                                                                                                                   
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                           
19  * or visit www.oracle.com if you need additional information or have any                                                            
20  * questions.                                                                                                                        
21  *                                                                                                                                   
22  */                                                                                                                                  
23 
24 #ifndef SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP                                                                                      
25 #define SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP                                                                                      
26 
27 #include "gc/shared/barrierSet.hpp"                                                                                                  
28 #include "memory/memRegion.hpp"                                                                                                      
29 
30 class Klass;                                                                                                                         
31 
32 class ModRefBarrierSet: public BarrierSet {                                                                                          
33 protected:                                                                                                                           
34   ModRefBarrierSet(BarrierSetAssembler* barrier_set_assembler,                                                                       
35                    BarrierSetC1* barrier_set_c1,                                                                                     
                                                                                                                                     
36                    const BarrierSet::FakeRtti& fake_rtti)                                                                            
37     : BarrierSet(barrier_set_assembler,                                                                                              
38                  barrier_set_c1,                                                                                                     
                                                                                                                                     
39                  fake_rtti.add_tag(BarrierSet::ModRef)) { }                                                                          
40   ~ModRefBarrierSet() { }                                                                                                            
41 
42 public:                                                                                                                              
43   template <DecoratorSet decorators, typename T>                                                                                     
44   inline void write_ref_field_pre(T* addr) {}                                                                                        
45 
46   template <DecoratorSet decorators, typename T>                                                                                     
47   inline void write_ref_field_post(T *addr, oop new_value) {}                                                                        
48 
49   // Causes all refs in "mr" to be assumed to be modified.                                                                           
50   virtual void invalidate(MemRegion mr) = 0;                                                                                         
51   virtual void write_region(MemRegion mr) = 0;                                                                                       
52 
53   // Operations on arrays, or general regions (e.g., for "clone") may be                                                             
54   // optimized by some barriers.                                                                                                     
55 
56   // Below length is the # array elements being written                                                                              
57   virtual void write_ref_array_pre(oop* dst, size_t length,                                                                          

16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.
21  *
22  */
23 
24 #ifndef SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
25 #define SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
26 
27 #include "gc/shared/barrierSet.hpp"
28 #include "memory/memRegion.hpp"
29 
30 class Klass;
31 
32 class ModRefBarrierSet: public BarrierSet {
33 protected:
34   ModRefBarrierSet(BarrierSetAssembler* barrier_set_assembler,
35                    BarrierSetC1* barrier_set_c1,
36                    BarrierSetC2* barrier_set_c2,
37                    const BarrierSet::FakeRtti& fake_rtti)
38     : BarrierSet(barrier_set_assembler,
39                  barrier_set_c1,
40                  barrier_set_c2,
41                  fake_rtti.add_tag(BarrierSet::ModRef)) { }
42   ~ModRefBarrierSet() { }
43 
44 public:
45   template <DecoratorSet decorators, typename T>
46   inline void write_ref_field_pre(T* addr) {}
47 
48   template <DecoratorSet decorators, typename T>
49   inline void write_ref_field_post(T *addr, oop new_value) {}
50 
51   // Causes all refs in "mr" to be assumed to be modified.
52   virtual void invalidate(MemRegion mr) = 0;
53   virtual void write_region(MemRegion mr) = 0;
54 
55   // Operations on arrays, or general regions (e.g., for "clone") may be
56   // optimized by some barriers.
57 
58   // Below length is the # array elements being written
59   virtual void write_ref_array_pre(oop* dst, size_t length,
< prev index next >