src/share/vm/gc_implementation/g1/heapRegionSet.cpp

Print this page
rev 3463 : 7114678: G1: various small fixes, code cleanup, and refactoring
Summary: Various cleanups as a prelude to introducing iterators for HeapRegions.
Reviewed-by: johnc
Contributed-by: tonyp

*** 33,50 **** void HeapRegionSetBase::set_unrealistically_long_length(uint len) { guarantee(_unrealistically_long_length == 0, "should only be set once"); _unrealistically_long_length = len; } - uint HeapRegionSetBase::calculate_region_num(HeapRegion* hr) { - assert(hr->startsHumongous(), "pre-condition"); - assert(hr->capacity() % HeapRegion::GrainBytes == 0, "invariant"); - uint region_num = (uint) (hr->capacity() >> HeapRegion::LogOfHRGrainBytes); - assert(region_num > 0, "sanity"); - return region_num; - } - void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) { msg->append("[%s] %s ln: %u rn: %u cy: "SIZE_FORMAT" ud: "SIZE_FORMAT, name(), message, length(), region_num(), total_capacity_bytes(), total_used_bytes()); fill_in_ext_msg_extra(msg); --- 33,42 ----
*** 150,164 **** hrs_ext_msg(this, "verification should be in progress")); guarantee(verify_region(hr, this), hrs_ext_msg(this, "region verification")); _calc_length += 1; ! if (!hr->isHumongous()) { ! _calc_region_num += 1; ! } else { ! _calc_region_num += calculate_region_num(hr); ! } _calc_total_capacity_bytes += hr->capacity(); _calc_total_used_bytes += hr->used(); } void HeapRegionSetBase::verify_end() { --- 142,152 ---- hrs_ext_msg(this, "verification should be in progress")); guarantee(verify_region(hr, this), hrs_ext_msg(this, "region verification")); _calc_length += 1; ! _calc_region_num += hr->region_num(); _calc_total_capacity_bytes += hr->capacity(); _calc_total_used_bytes += hr->used(); } void HeapRegionSetBase::verify_end() {