Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/heapRegionSet.hpp @ 4072:8aae2050e83e
7092309: G1: introduce old region set
Summary: Keep track of all the old regions in the heap with a heap region set.
Reviewed-by: brutisso, johnc
author | tonyp |
---|---|
date | Mon, 07 Nov 2011 22:11:12 -0500 |
parents | ae5b2f1dcf12 |
children | 0b3d1ec6eaee |
comparison
equal
deleted
inserted
replaced
4071:ed80554efa25 | 4072:8aae2050e83e |
---|---|
45 // (e.g., length, region num, used bytes sum) plus any shared | 45 // (e.g., length, region num, used bytes sum) plus any shared |
46 // functionality (e.g., verification). | 46 // functionality (e.g., verification). |
47 | 47 |
48 class hrs_ext_msg; | 48 class hrs_ext_msg; |
49 | 49 |
50 typedef enum { | |
51 HRSPhaseNone, | |
52 HRSPhaseEvacuation, | |
53 HRSPhaseCleanup, | |
54 HRSPhaseFullGC | |
55 } HRSPhase; | |
56 | |
57 class HRSPhaseSetter; | |
58 | |
50 class HeapRegionSetBase VALUE_OBJ_CLASS_SPEC { | 59 class HeapRegionSetBase VALUE_OBJ_CLASS_SPEC { |
51 friend class hrs_ext_msg; | 60 friend class hrs_ext_msg; |
61 friend class HRSPhaseSetter; | |
52 | 62 |
53 protected: | 63 protected: |
54 static size_t calculate_region_num(HeapRegion* hr); | 64 static size_t calculate_region_num(HeapRegion* hr); |
55 | 65 |
56 static size_t _unrealistically_long_length; | 66 static size_t _unrealistically_long_length; |
77 bool _verify_in_progress; | 87 bool _verify_in_progress; |
78 size_t _calc_length; | 88 size_t _calc_length; |
79 size_t _calc_region_num; | 89 size_t _calc_region_num; |
80 size_t _calc_total_capacity_bytes; | 90 size_t _calc_total_capacity_bytes; |
81 size_t _calc_total_used_bytes; | 91 size_t _calc_total_used_bytes; |
92 | |
93 // This is here so that it can be used in the subclasses to assert | |
94 // something different depending on which phase the GC is in. This | |
95 // can be particularly helpful in the check_mt_safety() methods. | |
96 static HRSPhase _phase; | |
97 | |
98 // Only used by HRSPhaseSetter. | |
99 static void clear_phase(); | |
100 static void set_phase(HRSPhase phase); | |
82 | 101 |
83 // verify_region() is used to ensure that the contents of a region | 102 // verify_region() is used to ensure that the contents of a region |
84 // added to / removed from a set are consistent. Different sets | 103 // added to / removed from a set are consistent. Different sets |
85 // make different assumptions about the regions added to them. So | 104 // make different assumptions about the regions added to them. So |
86 // each set can override verify_region_extra(), which is called | 105 // each set can override verify_region_extra(), which is called |
175 hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") { | 194 hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") { |
176 set->fill_in_ext_msg(this, message); | 195 set->fill_in_ext_msg(this, message); |
177 } | 196 } |
178 }; | 197 }; |
179 | 198 |
199 class HRSPhaseSetter { | |
200 public: | |
201 HRSPhaseSetter(HRSPhase phase) { | |
202 HeapRegionSetBase::set_phase(phase); | |
203 } | |
204 ~HRSPhaseSetter() { | |
205 HeapRegionSetBase::clear_phase(); | |
206 } | |
207 }; | |
208 | |
180 // These two macros are provided for convenience, to keep the uses of | 209 // These two macros are provided for convenience, to keep the uses of |
181 // these two asserts a bit more concise. | 210 // these two asserts a bit more concise. |
182 | 211 |
183 #define hrs_assert_mt_safety_ok(_set_) \ | 212 #define hrs_assert_mt_safety_ok(_set_) \ |
184 do { \ | 213 do { \ |