< prev index next >

src/hotspot/share/gc/g1/g1CollectorState.hpp

Print this page
rev 49484 : imported patch 8197573-remove-secondary-free-list
rev 49494 : imported patch 8199742-collectorstate-fixes
rev 49495 : [mq]: 8199742-stefanj-review
rev 49497 : [mq]: 8200234-g1concurrentmark-refactorings


  47   // we'll have to wait for the concurrent marking thread to finish
  48   // what it is doing. In this case we will postpone the marking cycle
  49   // initiation decision for the next pause. When we eventually decide
  50   // to start a cycle, we will set _in_initial_mark_gc which
  51   // will stay true until the end of the initial-mark pause doing the
  52   // initial-mark work.
  53   volatile bool _in_initial_mark_gc;
  54 
  55   // At the end of a pause we check the heap occupancy and we decide
  56   // whether we will start a marking cycle during the next pause. If
  57   // we decide that we want to do that, set this parameter. This parameter will
  58   // stay set until the beginning of a subsequent pause (not necessarily
  59   // the next one) when we decide that we will indeed start a marking cycle and
  60   // do the initial-mark work.
  61   volatile bool _initiate_conc_mark_if_possible;
  62 
  63   // Marking or rebuilding remembered set work is in progress. Set from the end
  64   // of the initial mark pause to the end of the Cleanup pause.
  65   bool _mark_or_rebuild_in_progress;
  66 




  67   // Set during a full gc pause.
  68   bool _in_full_gc;
  69 
  70 public:
  71   G1CollectorState() :
  72     _in_young_only_phase(true),
  73     _in_young_gc_before_mixed(false),
  74 
  75     _in_initial_mark_gc(false),
  76     _initiate_conc_mark_if_possible(false),
  77 
  78     _mark_or_rebuild_in_progress(false),

  79     _in_full_gc(false) { }
  80 
  81   // Phase setters
  82   void set_in_young_only_phase(bool v) { _in_young_only_phase = v; }
  83 
  84   // Pause setters
  85   void set_in_young_gc_before_mixed(bool v) { _in_young_gc_before_mixed = v; }
  86   void set_in_initial_mark_gc(bool v) { _in_initial_mark_gc = v; }
  87   void set_in_full_gc(bool v) { _in_full_gc = v; }
  88 
  89   void set_initiate_conc_mark_if_possible(bool v) { _initiate_conc_mark_if_possible = v; }
  90 
  91   void set_mark_or_rebuild_in_progress(bool v) { _mark_or_rebuild_in_progress = v; }

  92 
  93   // Phase getters
  94   bool in_young_only_phase() const { return _in_young_only_phase && !_in_full_gc; }
  95   bool in_mixed_phase() const { return !in_young_only_phase() && !_in_full_gc; }
  96 
  97   // Specific pauses
  98   bool in_young_gc_before_mixed() const { return _in_young_gc_before_mixed; }
  99   bool in_full_gc() const { return _in_full_gc; }
 100   bool in_initial_mark_gc() const { return _in_initial_mark_gc; }
 101   
 102   bool initiate_conc_mark_if_possible() const { return _initiate_conc_mark_if_possible; }
 103 
 104   bool mark_or_rebuild_in_progress() const { return _mark_or_rebuild_in_progress; }

 105 
 106   G1YCType yc_type() const {
 107     if (in_initial_mark_gc()) {
 108       return InitialMark;
 109     } else if (mark_or_rebuild_in_progress()) {
 110       return DuringMarkOrRebuild;
 111     } else if (in_young_only_phase()) {
 112       return Normal;
 113     } else {
 114       return Mixed;
 115     }
 116   }
 117 };
 118 
 119 #endif // SHARE_VM_GC_G1_G1COLLECTORSTATE_HPP


  47   // we'll have to wait for the concurrent marking thread to finish
  48   // what it is doing. In this case we will postpone the marking cycle
  49   // initiation decision for the next pause. When we eventually decide
  50   // to start a cycle, we will set _in_initial_mark_gc which
  51   // will stay true until the end of the initial-mark pause doing the
  52   // initial-mark work.
  53   volatile bool _in_initial_mark_gc;
  54 
  55   // At the end of a pause we check the heap occupancy and we decide
  56   // whether we will start a marking cycle during the next pause. If
  57   // we decide that we want to do that, set this parameter. This parameter will
  58   // stay set until the beginning of a subsequent pause (not necessarily
  59   // the next one) when we decide that we will indeed start a marking cycle and
  60   // do the initial-mark work.
  61   volatile bool _initiate_conc_mark_if_possible;
  62 
  63   // Marking or rebuilding remembered set work is in progress. Set from the end
  64   // of the initial mark pause to the end of the Cleanup pause.
  65   bool _mark_or_rebuild_in_progress;
  66 
  67   // The next bitmap is currently being cleared or about to be cleared. TAMS and bitmap
  68   // may be out of sync.
  69   bool _clearing_next_bitmap;
  70 
  71   // Set during a full gc pause.
  72   bool _in_full_gc;
  73 
  74 public:
  75   G1CollectorState() :
  76     _in_young_only_phase(true),
  77     _in_young_gc_before_mixed(false),
  78 
  79     _in_initial_mark_gc(false),
  80     _initiate_conc_mark_if_possible(false),
  81 
  82     _mark_or_rebuild_in_progress(false),
  83     _clearing_next_bitmap(false),
  84     _in_full_gc(false) { }
  85 
  86   // Phase setters
  87   void set_in_young_only_phase(bool v) { _in_young_only_phase = v; }
  88 
  89   // Pause setters
  90   void set_in_young_gc_before_mixed(bool v) { _in_young_gc_before_mixed = v; }
  91   void set_in_initial_mark_gc(bool v) { _in_initial_mark_gc = v; }
  92   void set_in_full_gc(bool v) { _in_full_gc = v; }
  93 
  94   void set_initiate_conc_mark_if_possible(bool v) { _initiate_conc_mark_if_possible = v; }
  95 
  96   void set_mark_or_rebuild_in_progress(bool v) { _mark_or_rebuild_in_progress = v; }
  97   void set_clearing_next_bitmap(bool v) { _clearing_next_bitmap = v; }
  98 
  99   // Phase getters
 100   bool in_young_only_phase() const { return _in_young_only_phase && !_in_full_gc; }
 101   bool in_mixed_phase() const { return !in_young_only_phase() && !_in_full_gc; }
 102 
 103   // Specific pauses
 104   bool in_young_gc_before_mixed() const { return _in_young_gc_before_mixed; }
 105   bool in_full_gc() const { return _in_full_gc; }
 106   bool in_initial_mark_gc() const { return _in_initial_mark_gc; }
 107   
 108   bool initiate_conc_mark_if_possible() const { return _initiate_conc_mark_if_possible; }
 109 
 110   bool mark_or_rebuild_in_progress() const { return _mark_or_rebuild_in_progress; }
 111   bool clearing_next_bitmap() const { return _clearing_next_bitmap; }
 112 
 113   G1YCType yc_type() const {
 114     if (in_initial_mark_gc()) {
 115       return InitialMark;
 116     } else if (mark_or_rebuild_in_progress()) {
 117       return DuringMarkOrRebuild;
 118     } else if (in_young_only_phase()) {
 119       return Normal;
 120     } else {
 121       return Mixed;
 122     }
 123   }
 124 };
 125 
 126 #endif // SHARE_VM_GC_G1_G1COLLECTORSTATE_HPP
< prev index next >