src/share/vm/gc/g1/g1RemSet.hpp

Print this page




  34 
  35 // A G1RemSet provides ways of iterating over pointers into a selected
  36 // collection set.
  37 
  38 class BitMap;
  39 class CardTableModRefBS;
  40 class G1BlockOffsetTable;
  41 class CodeBlobClosure;
  42 class G1CollectedHeap;
  43 class G1HotCardCache;
  44 class G1ParPushHeapRSClosure;
  45 class G1RemSetScanState;
  46 class G1Policy;
  47 class G1SATBCardTableModRefBS;
  48 class HeapRegionClaimer;
  49 
  50 // A G1RemSet in which each heap region has a rem set that records the
  51 // external heap references into it.  Uses a mod ref bs to track updates,
  52 // so that they can be used to update the individual region remsets.
  53 class G1RemSet: public CHeapObj<mtGC> {


  54 private:
  55   G1RemSetScanState* _scan_state;
  56   G1CardLiveData _card_live_data;
  57 
  58   G1RemSetSummary _prev_period_summary;
  59 
  60   // A DirtyCardQueueSet that is used to hold cards that contain
  61   // references into the current collection set. This is used to
  62   // update the remembered sets of the regions in the collection
  63   // set in the event of an evacuation failure.
  64   DirtyCardQueueSet _into_cset_dirty_card_queue_set;
  65 
  66 protected:
  67   G1CollectedHeap* _g1;
  68   size_t _conc_refine_cards;
  69   uint n_workers();
  70 
  71 protected:
  72   CardTableModRefBS*     _ct_bs;
  73   G1Policy*              _g1p;


 119   // call.  Must call each of these once before and after (in sequential
 120   // code) any threads call oops_into_collection_set_do.  (This offers an
 121   // opportunity to sequential setup and teardown of structures needed by a
 122   // parallel iteration over the CS's RS.)
 123   void prepare_for_oops_into_collection_set_do();
 124   void cleanup_after_oops_into_collection_set_do();
 125 
 126   size_t scan_rem_set(G1ParPushHeapRSClosure* oops_in_heap_closure,
 127                       CodeBlobClosure* heap_region_codeblobs,
 128                       uint worker_i);
 129 
 130   G1RemSetScanState* scan_state() const { return _scan_state; }
 131 
 132   // Flush remaining refinement buffers into the remembered set,
 133   // applying oops_in_heap_closure on the references found.
 134   void update_rem_set(DirtyCardQueue* into_cset_dcq, G1ParPushHeapRSClosure* oops_in_heap_closure, uint worker_i);
 135 
 136   // Record, if necessary, the fact that *p (where "p" is in region "from",
 137   // which is required to be non-NULL) has changed to a new non-NULL value.
 138   template <class T> void par_write_ref(HeapRegion* from, T* p, uint tid);
 139 
 140   // Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region
 141   // or card, respectively, such that a region or card with a corresponding
 142   // 0 bit contains no part of any live object.  Eliminates any remembered
 143   // set entries that correspond to dead heap ranges. "worker_num" is the
 144   // parallel thread id of the current thread, and "hrclaimer" is the
 145   // HeapRegionClaimer that should be used.
 146   void scrub(uint worker_num, HeapRegionClaimer* hrclaimer);
 147 
 148   // Refine the card corresponding to "card_ptr".
 149   // If oops_in_heap_closure is not NULL, a true result is returned
 150   // if the given card contains oops that have references into the
 151   // current collection set.
 152   bool refine_card(jbyte* card_ptr,
 153                    uint worker_i,
 154                    G1ParPushHeapRSClosure* oops_in_heap_closure);
 155 
 156   // Print accumulated summary info from the start of the VM.
 157   void print_summary_info();
 158 
 159   // Print accumulated summary info from the last time called.
 160   void print_periodic_summary_info(const char* header, uint period_count);
 161 
 162   // Prepare remembered set for verification.
 163   void prepare_for_verify();
 164 
 165   size_t conc_refine_cards() const {
 166     return _conc_refine_cards;




  34 
  35 // A G1RemSet provides ways of iterating over pointers into a selected
  36 // collection set.
  37 
  38 class BitMap;
  39 class CardTableModRefBS;
  40 class G1BlockOffsetTable;
  41 class CodeBlobClosure;
  42 class G1CollectedHeap;
  43 class G1HotCardCache;
  44 class G1ParPushHeapRSClosure;
  45 class G1RemSetScanState;
  46 class G1Policy;
  47 class G1SATBCardTableModRefBS;
  48 class HeapRegionClaimer;
  49 
  50 // A G1RemSet in which each heap region has a rem set that records the
  51 // external heap references into it.  Uses a mod ref bs to track updates,
  52 // so that they can be used to update the individual region remsets.
  53 class G1RemSet: public CHeapObj<mtGC> {
  54   friend class G1ParScrubRemSetTask;
  55 
  56 private:
  57   G1RemSetScanState* _scan_state;
  58   G1CardLiveData _card_live_data;
  59 
  60   G1RemSetSummary _prev_period_summary;
  61 
  62   // A DirtyCardQueueSet that is used to hold cards that contain
  63   // references into the current collection set. This is used to
  64   // update the remembered sets of the regions in the collection
  65   // set in the event of an evacuation failure.
  66   DirtyCardQueueSet _into_cset_dirty_card_queue_set;
  67 
  68 protected:
  69   G1CollectedHeap* _g1;
  70   size_t _conc_refine_cards;
  71   uint n_workers();
  72 
  73 protected:
  74   CardTableModRefBS*     _ct_bs;
  75   G1Policy*              _g1p;


 121   // call.  Must call each of these once before and after (in sequential
 122   // code) any threads call oops_into_collection_set_do.  (This offers an
 123   // opportunity to sequential setup and teardown of structures needed by a
 124   // parallel iteration over the CS's RS.)
 125   void prepare_for_oops_into_collection_set_do();
 126   void cleanup_after_oops_into_collection_set_do();
 127 
 128   size_t scan_rem_set(G1ParPushHeapRSClosure* oops_in_heap_closure,
 129                       CodeBlobClosure* heap_region_codeblobs,
 130                       uint worker_i);
 131 
 132   G1RemSetScanState* scan_state() const { return _scan_state; }
 133 
 134   // Flush remaining refinement buffers into the remembered set,
 135   // applying oops_in_heap_closure on the references found.
 136   void update_rem_set(DirtyCardQueue* into_cset_dcq, G1ParPushHeapRSClosure* oops_in_heap_closure, uint worker_i);
 137 
 138   // Record, if necessary, the fact that *p (where "p" is in region "from",
 139   // which is required to be non-NULL) has changed to a new non-NULL value.
 140   template <class T> void par_write_ref(HeapRegion* from, T* p, uint tid);








 141 
 142   // Refine the card corresponding to "card_ptr".
 143   // If oops_in_heap_closure is not NULL, a true result is returned
 144   // if the given card contains oops that have references into the
 145   // current collection set.
 146   bool refine_card(jbyte* card_ptr,
 147                    uint worker_i,
 148                    G1ParPushHeapRSClosure* oops_in_heap_closure);
 149 
 150   // Print accumulated summary info from the start of the VM.
 151   void print_summary_info();
 152 
 153   // Print accumulated summary info from the last time called.
 154   void print_periodic_summary_info(const char* header, uint period_count);
 155 
 156   // Prepare remembered set for verification.
 157   void prepare_for_verify();
 158 
 159   size_t conc_refine_cards() const {
 160     return _conc_refine_cards;