< prev index next >

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

8198949_arraycopy

36 // As it currently stands, this barrier is *imprecise*: when a ref field in                                                          
37 // an object "o" is modified, the card table entry for the card containing                                                           
38 // the head of "o" is dirtied, not necessarily the card containing the                                                               
39 // modified field itself.  For object arrays, however, the barrier *is*                                                              
40 // precise; only the card containing the modified element is dirtied.                                                                
41 // Closures used to scan dirty cards should take these                                                                               
42 // considerations into account.                                                                                                      
43 
44 class CardTableModRefBS: public ModRefBarrierSet {                                                                                   
45   // Some classes get to look at some private stuff.                                                                                 
46   friend class VMStructs;                                                                                                            
47  protected:                                                                                                                          
48 
49   // Used in support of ReduceInitialCardMarks; only consulted if COMPILER2                                                          
50   // or INCLUDE_JVMCI is being used                                                                                                  
51   bool       _defer_initial_card_mark;                                                                                               
52   CardTable* _card_table;                                                                                                            
53 
54   CardTableModRefBS(CardTable* card_table, const BarrierSet::FakeRtti& fake_rtti);                                                   
55 
                                                                                                                                     
                                                                                                                                     
56  public:                                                                                                                             
57   CardTableModRefBS(CardTable* card_table);                                                                                          
58   ~CardTableModRefBS();                                                                                                              
59 
60   CardTable* card_table() const { return _card_table; }                                                                              
61 
62   virtual void initialize();                                                                                                         
63 
64   void write_region(MemRegion mr) {                                                                                                  
65     invalidate(mr);                                                                                                                  
66   }                                                                                                                                  
67 
68  protected:                                                                                                                          
69   void write_ref_array_work(MemRegion mr);                                                                                           
70 
71  public:                                                                                                                             
72   // Record a reference update. Note that these versions are precise!                                                                
73   // The scanning code has to handle the fact that the write barrier may be                                                          
74   // either precise or imprecise. We make non-virtual inline variants of                                                             
75   // these functions here for performance.                                                                                           
76   template <DecoratorSet decorators, typename T>                                                                                     
77   void write_ref_field_post(T* field, oop newVal);                                                                                   
78 
79   virtual void invalidate(MemRegion mr);                                                                                             
80 
81   // ReduceInitialCardMarks                                                                                                          
82   void initialize_deferred_card_mark_barriers();                                                                                     
83 
84   // If the CollectedHeap was asked to defer a store barrier above,                                                                  
85   // this informs it to flush such a deferred store barrier to the                                                                   
86   // remembered set.                                                                                                                 
87   void flush_deferred_card_mark_barrier(JavaThread* thread);                                                                         

36 // As it currently stands, this barrier is *imprecise*: when a ref field in
37 // an object "o" is modified, the card table entry for the card containing
38 // the head of "o" is dirtied, not necessarily the card containing the
39 // modified field itself.  For object arrays, however, the barrier *is*
40 // precise; only the card containing the modified element is dirtied.
41 // Closures used to scan dirty cards should take these
42 // considerations into account.
43 
44 class CardTableModRefBS: public ModRefBarrierSet {
45   // Some classes get to look at some private stuff.
46   friend class VMStructs;
47  protected:
48 
49   // Used in support of ReduceInitialCardMarks; only consulted if COMPILER2
50   // or INCLUDE_JVMCI is being used
51   bool       _defer_initial_card_mark;
52   CardTable* _card_table;
53 
54   CardTableModRefBS(CardTable* card_table, const BarrierSet::FakeRtti& fake_rtti);
55 
56   BarrierSetCodeGen* make_code_gen();
57 
58  public:
59   CardTableModRefBS(CardTable* card_table);
60   ~CardTableModRefBS();
61 
62   CardTable* card_table() const { return _card_table; }
63 
64   virtual void initialize();
65 
66   void write_region(MemRegion mr) {
67     invalidate(mr);
68   }
69 

70   void write_ref_array_work(MemRegion mr);
71 
72  public:
73   // Record a reference update. Note that these versions are precise!
74   // The scanning code has to handle the fact that the write barrier may be
75   // either precise or imprecise. We make non-virtual inline variants of
76   // these functions here for performance.
77   template <DecoratorSet decorators, typename T>
78   void write_ref_field_post(T* field, oop newVal);
79 
80   virtual void invalidate(MemRegion mr);
81 
82   // ReduceInitialCardMarks
83   void initialize_deferred_card_mark_barriers();
84 
85   // If the CollectedHeap was asked to defer a store barrier above,
86   // this informs it to flush such a deferred store barrier to the
87   // remembered set.
88   void flush_deferred_card_mark_barrier(JavaThread* thread);
< prev index next >