src/share/vm/gc_implementation/g1/g1OopClosures.hpp

Print this page
rev 2896 : 6484965: G1: piggy-back liveness accounting phase on marking
Summary: Remove the separate counting phase of concurrent marking by tracking the amount of marked bytes and the cards spanned by marked objects in marking task/worker thread local data structures, which are updated as individual objects are marked.
Reviewed-by: brutisso


  34 class CMMarkStack;
  35 class G1ParScanThreadState;
  36 class CMTask;
  37 class ReferenceProcessor;
  38 
  39 // A class that scans oops in a given heap region (much as OopsInGenClosure
  40 // scans oops in a generation.)
  41 class OopsInHeapRegionClosure: public OopsInGenClosure {
  42 protected:
  43   HeapRegion* _from;
  44 public:
  45   void set_region(HeapRegion* from) { _from = from; }
  46 };
  47 
  48 class G1ParClosureSuper : public OopsInHeapRegionClosure {
  49 protected:
  50   G1CollectedHeap* _g1;
  51   G1RemSet* _g1_rem;
  52   ConcurrentMark* _cm;
  53   G1ParScanThreadState* _par_scan_state;

  54   bool _during_initial_mark;
  55   bool _mark_in_progress;
  56 public:
  57   G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state);
  58   bool apply_to_weak_ref_discovered_field() { return true; }
  59 };
  60 
  61 class G1ParPushHeapRSClosure : public G1ParClosureSuper {
  62 public:
  63   G1ParPushHeapRSClosure(G1CollectedHeap* g1,
  64                          G1ParScanThreadState* par_scan_state):
  65     G1ParClosureSuper(g1, par_scan_state) { }
  66 
  67   template <class T> void do_oop_nv(T* p);
  68   virtual void do_oop(oop* p)          { do_oop_nv(p); }
  69   virtual void do_oop(narrowOop* p)    { do_oop_nv(p); }
  70 };
  71 
  72 class G1ParScanClosure : public G1ParClosureSuper {
  73 public:




  34 class CMMarkStack;
  35 class G1ParScanThreadState;
  36 class CMTask;
  37 class ReferenceProcessor;
  38 
  39 // A class that scans oops in a given heap region (much as OopsInGenClosure
  40 // scans oops in a generation.)
  41 class OopsInHeapRegionClosure: public OopsInGenClosure {
  42 protected:
  43   HeapRegion* _from;
  44 public:
  45   void set_region(HeapRegion* from) { _from = from; }
  46 };
  47 
  48 class G1ParClosureSuper : public OopsInHeapRegionClosure {
  49 protected:
  50   G1CollectedHeap* _g1;
  51   G1RemSet* _g1_rem;
  52   ConcurrentMark* _cm;
  53   G1ParScanThreadState* _par_scan_state;
  54   int _worker_i;
  55   bool _during_initial_mark;
  56   bool _mark_in_progress;
  57 public:
  58   G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state);
  59   bool apply_to_weak_ref_discovered_field() { return true; }
  60 };
  61 
  62 class G1ParPushHeapRSClosure : public G1ParClosureSuper {
  63 public:
  64   G1ParPushHeapRSClosure(G1CollectedHeap* g1,
  65                          G1ParScanThreadState* par_scan_state):
  66     G1ParClosureSuper(g1, par_scan_state) { }
  67 
  68   template <class T> void do_oop_nv(T* p);
  69   virtual void do_oop(oop* p)          { do_oop_nv(p); }
  70   virtual void do_oop(narrowOop* p)    { do_oop_nv(p); }
  71 };
  72 
  73 class G1ParScanClosure : public G1ParClosureSuper {
  74 public: