69 bool _during_marking; |
69 bool _during_marking; |
70 bool _mark_in_progress; |
70 bool _mark_in_progress; |
71 bool _in_marking_window; |
71 bool _in_marking_window; |
72 bool _in_marking_window_im; |
72 bool _in_marking_window_im; |
73 |
73 |
74 // Are we going into a mixed gc phase. |
|
75 bool _mixed_gc_pending; |
|
76 |
|
77 bool _full_collection; |
74 bool _full_collection; |
78 |
75 |
79 public: |
76 public: |
80 G1CollectorState() : |
77 G1CollectorState() : |
81 _gcs_are_young(true), |
78 _gcs_are_young(true), |
82 _last_gc_was_young(false), |
79 _last_gc_was_young(false), |
83 _last_young_gc(false), |
80 _last_young_gc(false), |
84 _mixed_gc_pending(false), |
|
85 |
81 |
86 _during_initial_mark_pause(false), |
82 _during_initial_mark_pause(false), |
87 _initiate_conc_mark_if_possible(false), |
83 _initiate_conc_mark_if_possible(false), |
88 |
84 |
89 _during_marking(false), |
85 _during_marking(false), |
93 _full_collection(false) {} |
89 _full_collection(false) {} |
94 |
90 |
95 // Setters |
91 // Setters |
96 void set_gcs_are_young(bool v) { _gcs_are_young = v; } |
92 void set_gcs_are_young(bool v) { _gcs_are_young = v; } |
97 void set_last_gc_was_young(bool v) { _last_gc_was_young = v; } |
93 void set_last_gc_was_young(bool v) { _last_gc_was_young = v; } |
98 void set_last_young_gc(bool v) { _last_young_gc = v; _mixed_gc_pending = false;} |
94 void set_last_young_gc(bool v) { _last_young_gc = v; } |
99 void set_during_initial_mark_pause(bool v) { _during_initial_mark_pause = v; } |
95 void set_during_initial_mark_pause(bool v) { _during_initial_mark_pause = v; } |
100 void set_initiate_conc_mark_if_possible(bool v) { _initiate_conc_mark_if_possible = v; } |
96 void set_initiate_conc_mark_if_possible(bool v) { _initiate_conc_mark_if_possible = v; } |
101 void set_during_marking(bool v) { _during_marking = v; } |
97 void set_during_marking(bool v) { _during_marking = v; } |
102 void set_mark_in_progress(bool v) { _mark_in_progress = v; } |
98 void set_mark_in_progress(bool v) { _mark_in_progress = v; } |
103 void set_in_marking_window(bool v) { _in_marking_window = v; } |
99 void set_in_marking_window(bool v) { _in_marking_window = v; } |
104 void set_in_marking_window_im(bool v) { _in_marking_window_im = v; } |
100 void set_in_marking_window_im(bool v) { _in_marking_window_im = v; } |
105 void set_mixed_gc_pending(bool v) { _mixed_gc_pending = v; } |
|
106 void set_full_collection(bool v) { _full_collection = v; } |
101 void set_full_collection(bool v) { _full_collection = v; } |
107 |
102 |
108 // Getters |
103 // Getters |
109 bool gcs_are_young() const { return _gcs_are_young; } |
104 bool gcs_are_young() const { return _gcs_are_young; } |
110 bool last_gc_was_young() const { return _last_gc_was_young; } |
105 bool last_gc_was_young() const { return _last_gc_was_young; } |
113 bool initiate_conc_mark_if_possible() const { return _initiate_conc_mark_if_possible; } |
108 bool initiate_conc_mark_if_possible() const { return _initiate_conc_mark_if_possible; } |
114 bool during_marking() const { return _during_marking; } |
109 bool during_marking() const { return _during_marking; } |
115 bool mark_in_progress() const { return _mark_in_progress; } |
110 bool mark_in_progress() const { return _mark_in_progress; } |
116 bool in_marking_window() const { return _in_marking_window; } |
111 bool in_marking_window() const { return _in_marking_window; } |
117 bool in_marking_window_im() const { return _in_marking_window_im; } |
112 bool in_marking_window_im() const { return _in_marking_window_im; } |
118 bool mixed_gc_pending() const { return _mixed_gc_pending; } |
|
119 bool full_collection() const { return _full_collection; } |
113 bool full_collection() const { return _full_collection; } |
120 |
114 |
121 // Composite booleans (clients worry about flickering) |
115 // Composite booleans (clients worry about flickering) |
122 bool during_concurrent_mark() const { |
116 bool during_concurrent_mark() const { |
123 return (_in_marking_window && !_in_marking_window_im); |
117 return (_in_marking_window && !_in_marking_window_im); |