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

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp
          +++ new/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp
↓ open down ↓ 32 lines elided ↑ open up ↑
  33   33  
  34   34  class ConcurrentMark;
  35   35  
  36   36  class ConcurrentMarkThread: public ConcurrentGCThread {
  37   37    friend class VMStructs;
  38   38  
  39   39    double _vtime_start;  // Initial virtual time.
  40   40    double _vtime_accum;  // Accumulated virtual time.
  41   41  
  42   42    double _vtime_mark_accum;
  43      -  double _vtime_count_accum;
  44   43  
  45   44   public:
  46   45    virtual void run();
  47   46  
  48   47   private:
  49   48    ConcurrentMark*                  _cm;
  50   49    volatile bool                    _started;
  51   50    volatile bool                    _in_progress;
  52   51  
  53   52    void sleepBeforeNextCycle();
↓ open down ↓ 8 lines elided ↑ open up ↑
  62   61    static SurrogateLockerThread* slt() { return _slt; }
  63   62  
  64   63    // Printing
  65   64    void print_on(outputStream* st) const;
  66   65    void print() const;
  67   66  
  68   67    // Total virtual time so far.
  69   68    double vtime_accum();
  70   69    // Marking virtual time so far
  71   70    double vtime_mark_accum();
  72      -  // Counting virtual time so far.
  73      -  double vtime_count_accum() { return _vtime_count_accum; }
  74   71  
  75   72    ConcurrentMark* cm()     { return _cm; }
  76   73  
  77   74    void set_started()       { assert(!_in_progress, "cycle in progress"); _started = true;  }
  78   75    void clear_started()     { assert(_in_progress, "must be starting a cycle"); _started = false; }
  79   76    bool started()           { return _started;  }
  80   77  
  81   78    void set_in_progress()   { assert(_started, "must be starting a cycle"); _in_progress = true;  }
  82   79    void clear_in_progress() { assert(!_started, "must not be starting a new cycle"); _in_progress = false; }
  83   80    bool in_progress()       { return _in_progress;  }
↓ open down ↓ 19 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX