Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/heapRegionSet.cpp @ 6254:a2f7274eb6ef
7114678: G1: various small fixes, code cleanup, and refactoring
Summary: Various cleanups as a prelude to introducing iterators for HeapRegions.
Reviewed-by: johnc, brutisso
author | tonyp |
---|---|
date | Thu, 19 Jul 2012 15:15:54 -0700 |
parents | d42fe3c3001d |
children | 992f62c457b0 58fc1b1523dc |
comparison
equal
deleted
inserted
replaced
6253:db823a892a55 | 6254:a2f7274eb6ef |
---|---|
33 void HeapRegionSetBase::set_unrealistically_long_length(uint len) { | 33 void HeapRegionSetBase::set_unrealistically_long_length(uint len) { |
34 guarantee(_unrealistically_long_length == 0, "should only be set once"); | 34 guarantee(_unrealistically_long_length == 0, "should only be set once"); |
35 _unrealistically_long_length = len; | 35 _unrealistically_long_length = len; |
36 } | 36 } |
37 | 37 |
38 uint HeapRegionSetBase::calculate_region_num(HeapRegion* hr) { | |
39 assert(hr->startsHumongous(), "pre-condition"); | |
40 assert(hr->capacity() % HeapRegion::GrainBytes == 0, "invariant"); | |
41 uint region_num = (uint) (hr->capacity() >> HeapRegion::LogOfHRGrainBytes); | |
42 assert(region_num > 0, "sanity"); | |
43 return region_num; | |
44 } | |
45 | |
46 void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) { | 38 void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) { |
47 msg->append("[%s] %s ln: %u rn: %u cy: "SIZE_FORMAT" ud: "SIZE_FORMAT, | 39 msg->append("[%s] %s ln: %u rn: %u cy: "SIZE_FORMAT" ud: "SIZE_FORMAT, |
48 name(), message, length(), region_num(), | 40 name(), message, length(), region_num(), |
49 total_capacity_bytes(), total_used_bytes()); | 41 total_capacity_bytes(), total_used_bytes()); |
50 fill_in_ext_msg_extra(msg); | 42 fill_in_ext_msg_extra(msg); |
150 hrs_ext_msg(this, "verification should be in progress")); | 142 hrs_ext_msg(this, "verification should be in progress")); |
151 | 143 |
152 guarantee(verify_region(hr, this), hrs_ext_msg(this, "region verification")); | 144 guarantee(verify_region(hr, this), hrs_ext_msg(this, "region verification")); |
153 | 145 |
154 _calc_length += 1; | 146 _calc_length += 1; |
155 if (!hr->isHumongous()) { | 147 _calc_region_num += hr->region_num(); |
156 _calc_region_num += 1; | |
157 } else { | |
158 _calc_region_num += calculate_region_num(hr); | |
159 } | |
160 _calc_total_capacity_bytes += hr->capacity(); | 148 _calc_total_capacity_bytes += hr->capacity(); |
161 _calc_total_used_bytes += hr->used(); | 149 _calc_total_used_bytes += hr->used(); |
162 } | 150 } |
163 | 151 |
164 void HeapRegionSetBase::verify_end() { | 152 void HeapRegionSetBase::verify_end() { |