216 }
217
218 #ifndef PRODUCT
219 void HeapRegionSeq::verify_optional() {
220 guarantee(length() <= _allocated_length,
221 err_msg("invariant: _length: %u _allocated_length: %u",
222 length(), _allocated_length));
223 guarantee(_allocated_length <= max_length(),
224 err_msg("invariant: _allocated_length: %u _max_length: %u",
225 _allocated_length, max_length()));
226 guarantee(_next_search_index <= length(),
227 err_msg("invariant: _next_search_index: %u _length: %u",
228 _next_search_index, length()));
229
230 HeapWord* prev_end = heap_bottom();
231 for (uint i = 0; i < _allocated_length; i += 1) {
232 HeapRegion* hr = _regions.get_by_index(i);
233 guarantee(hr != NULL, err_msg("invariant: i: %u", i));
234 guarantee(hr->bottom() == prev_end,
235 err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT,
236 i, HR_FORMAT_PARAMS(hr), prev_end));
237 guarantee(hr->hrs_index() == i,
238 err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index()));
239 if (i < length()) {
240 // Asserts will fire if i is >= _length
241 HeapWord* addr = hr->bottom();
242 guarantee(addr_to_region(addr) == hr, "sanity");
243 } else {
244 guarantee(hr->is_empty(), "sanity");
245 guarantee(!hr->isHumongous(), "sanity");
246 // using assert instead of guarantee here since containing_set()
247 // is only available in non-product builds.
248 assert(hr->containing_set() == NULL, "sanity");
249 }
250 if (hr->startsHumongous()) {
251 prev_end = hr->orig_end();
252 } else {
253 prev_end = hr->end();
254 }
255 }
256 for (uint i = _allocated_length; i < max_length(); i += 1) {
|
216 }
217
218 #ifndef PRODUCT
219 void HeapRegionSeq::verify_optional() {
220 guarantee(length() <= _allocated_length,
221 err_msg("invariant: _length: %u _allocated_length: %u",
222 length(), _allocated_length));
223 guarantee(_allocated_length <= max_length(),
224 err_msg("invariant: _allocated_length: %u _max_length: %u",
225 _allocated_length, max_length()));
226 guarantee(_next_search_index <= length(),
227 err_msg("invariant: _next_search_index: %u _length: %u",
228 _next_search_index, length()));
229
230 HeapWord* prev_end = heap_bottom();
231 for (uint i = 0; i < _allocated_length; i += 1) {
232 HeapRegion* hr = _regions.get_by_index(i);
233 guarantee(hr != NULL, err_msg("invariant: i: %u", i));
234 guarantee(hr->bottom() == prev_end,
235 err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT,
236 i, HR_FORMAT_PARAMS(hr), p2i(prev_end)));
237 guarantee(hr->hrs_index() == i,
238 err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index()));
239 if (i < length()) {
240 // Asserts will fire if i is >= _length
241 HeapWord* addr = hr->bottom();
242 guarantee(addr_to_region(addr) == hr, "sanity");
243 } else {
244 guarantee(hr->is_empty(), "sanity");
245 guarantee(!hr->isHumongous(), "sanity");
246 // using assert instead of guarantee here since containing_set()
247 // is only available in non-product builds.
248 assert(hr->containing_set() == NULL, "sanity");
249 }
250 if (hr->startsHumongous()) {
251 prev_end = hr->orig_end();
252 } else {
253 prev_end = hr->end();
254 }
255 }
256 for (uint i = _allocated_length; i < max_length(); i += 1) {
|