420 void HeapRegionManager::verify() {
421 guarantee(length() <= _allocated_heapregions_length,
422 err_msg("invariant: _length: %u _allocated_length: %u",
423 length(), _allocated_heapregions_length));
424 guarantee(_allocated_heapregions_length <= max_length(),
425 err_msg("invariant: _allocated_length: %u _max_length: %u",
426 _allocated_heapregions_length, max_length()));
427
428 bool prev_committed = true;
429 uint num_committed = 0;
430 HeapWord* prev_end = heap_bottom();
431 for (uint i = 0; i < _allocated_heapregions_length; i++) {
432 if (!is_available(i)) {
433 prev_committed = false;
434 continue;
435 }
436 num_committed++;
437 HeapRegion* hr = _regions.get_by_index(i);
438 guarantee(hr != NULL, err_msg("invariant: i: %u", i));
439 guarantee(!prev_committed || hr->bottom() == prev_end,
440 err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT,
441 i, HR_FORMAT_PARAMS(hr), p2i(prev_end)));
442 guarantee(hr->hrm_index() == i,
443 err_msg("invariant: i: %u hrm_index(): %u", i, hr->hrm_index()));
444 // Asserts will fire if i is >= _length
445 HeapWord* addr = hr->bottom();
446 guarantee(addr_to_region(addr) == hr, "sanity");
447 // We cannot check whether the region is part of a particular set: at the time
448 // this method may be called, we have only completed allocation of the regions,
449 // but not put into a region set.
450 prev_committed = true;
451 if (hr->is_starts_humongous()) {
452 prev_end = hr->orig_end();
453 } else {
454 prev_end = hr->end();
455 }
456 }
457 for (uint i = _allocated_heapregions_length; i < max_length(); i++) {
458 guarantee(_regions.get_by_index(i) == NULL, err_msg("invariant i: %u", i));
459 }
460
|
420 void HeapRegionManager::verify() {
421 guarantee(length() <= _allocated_heapregions_length,
422 err_msg("invariant: _length: %u _allocated_length: %u",
423 length(), _allocated_heapregions_length));
424 guarantee(_allocated_heapregions_length <= max_length(),
425 err_msg("invariant: _allocated_length: %u _max_length: %u",
426 _allocated_heapregions_length, max_length()));
427
428 bool prev_committed = true;
429 uint num_committed = 0;
430 HeapWord* prev_end = heap_bottom();
431 for (uint i = 0; i < _allocated_heapregions_length; i++) {
432 if (!is_available(i)) {
433 prev_committed = false;
434 continue;
435 }
436 num_committed++;
437 HeapRegion* hr = _regions.get_by_index(i);
438 guarantee(hr != NULL, err_msg("invariant: i: %u", i));
439 guarantee(!prev_committed || hr->bottom() == prev_end,
440 err_msg("invariant i: %u " HR_FORMAT " prev_end: " PTR_FORMAT,
441 i, HR_FORMAT_PARAMS(hr), p2i(prev_end)));
442 guarantee(hr->hrm_index() == i,
443 err_msg("invariant: i: %u hrm_index(): %u", i, hr->hrm_index()));
444 // Asserts will fire if i is >= _length
445 HeapWord* addr = hr->bottom();
446 guarantee(addr_to_region(addr) == hr, "sanity");
447 // We cannot check whether the region is part of a particular set: at the time
448 // this method may be called, we have only completed allocation of the regions,
449 // but not put into a region set.
450 prev_committed = true;
451 if (hr->is_starts_humongous()) {
452 prev_end = hr->orig_end();
453 } else {
454 prev_end = hr->end();
455 }
456 }
457 for (uint i = _allocated_heapregions_length; i < max_length(); i++) {
458 guarantee(_regions.get_by_index(i) == NULL, err_msg("invariant i: %u", i));
459 }
460
|