145 void verify_next_region(HeapRegion* hr);
146 void verify_end();
147
148 #if HEAP_REGION_SET_FORCE_VERIFY
149 void verify_optional() {
150 verify();
151 }
152 #else // HEAP_REGION_SET_FORCE_VERIFY
153 void verify_optional() { }
154 #endif // HEAP_REGION_SET_FORCE_VERIFY
155
156 virtual void print_on(outputStream* out, bool print_contents = false);
157 };
158
159 // Customized err_msg for heap region sets. Apart from a
160 // assert/guarantee-specific message it also prints out the values of
161 // the fields of the associated set. This can be very helpful in
162 // diagnosing failures.
163 class hrs_ext_msg : public hrs_err_msg {
164 public:
165 hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") {
166 set->fill_in_ext_msg(this, message);
167 }
168 };
169
170 #define hrs_assert_sets_match(_set1_, _set2_) \
171 do { \
172 assert(((_set1_)->regions_humongous() == \
173 (_set2_)->regions_humongous()) && \
174 ((_set1_)->regions_empty() == (_set2_)->regions_empty()), \
175 hrs_err_msg("the contents of set %s and set %s should match", \
176 (_set1_)->name(), (_set2_)->name())); \
177 } while (0)
178
179 // This class represents heap region sets whose members are not
180 // explicitly tracked. It's helpful to group regions using such sets
181 // so that we can reason about all the region groups in the heap using
182 // the same interface (namely, the HeapRegionSetBase API).
183
184 class HeapRegionSet : public HeapRegionSetBase {
185 public:
|
145 void verify_next_region(HeapRegion* hr);
146 void verify_end();
147
148 #if HEAP_REGION_SET_FORCE_VERIFY
149 void verify_optional() {
150 verify();
151 }
152 #else // HEAP_REGION_SET_FORCE_VERIFY
153 void verify_optional() { }
154 #endif // HEAP_REGION_SET_FORCE_VERIFY
155
156 virtual void print_on(outputStream* out, bool print_contents = false);
157 };
158
159 // Customized err_msg for heap region sets. Apart from a
160 // assert/guarantee-specific message it also prints out the values of
161 // the fields of the associated set. This can be very helpful in
162 // diagnosing failures.
163 class hrs_ext_msg : public hrs_err_msg {
164 public:
165 hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("%s","") {
166 set->fill_in_ext_msg(this, message);
167 }
168 };
169
170 #define hrs_assert_sets_match(_set1_, _set2_) \
171 do { \
172 assert(((_set1_)->regions_humongous() == \
173 (_set2_)->regions_humongous()) && \
174 ((_set1_)->regions_empty() == (_set2_)->regions_empty()), \
175 hrs_err_msg("the contents of set %s and set %s should match", \
176 (_set1_)->name(), (_set2_)->name())); \
177 } while (0)
178
179 // This class represents heap region sets whose members are not
180 // explicitly tracked. It's helpful to group regions using such sets
181 // so that we can reason about all the region groups in the heap using
182 // the same interface (namely, the HeapRegionSetBase API).
183
184 class HeapRegionSet : public HeapRegionSetBase {
185 public:
|