comparison src/share/vm/gc_implementation/g1/heapRegionSet.cpp @ 20377:a8ea2f110d87

8054819: Rename HeapRegionSeq to HeapRegionManager Reviewed-by: jwilhelm, jmasa
author tschatzl
date Tue, 26 Aug 2014 09:36:53 +0200
parents 1f1d373cd044
children c02ec279b062
comparison
equal deleted inserted replaced
20359:4d3a43351904 20377:a8ea2f110d87
37 fill_in_ext_msg_extra(msg); 37 fill_in_ext_msg_extra(msg);
38 } 38 }
39 39
40 #ifndef PRODUCT 40 #ifndef PRODUCT
41 void HeapRegionSetBase::verify_region(HeapRegion* hr) { 41 void HeapRegionSetBase::verify_region(HeapRegion* hr) {
42 assert(hr->containing_set() == this, err_msg("Inconsistent containing set for %u", hr->hrs_index())); 42 assert(hr->containing_set() == this, err_msg("Inconsistent containing set for %u", hr->hrm_index()));
43 assert(!hr->is_young(), err_msg("Adding young region %u", hr->hrs_index())); // currently we don't use these sets for young regions 43 assert(!hr->is_young(), err_msg("Adding young region %u", hr->hrm_index())); // currently we don't use these sets for young regions
44 assert(hr->isHumongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrs_index(), name())); 44 assert(hr->isHumongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrm_index(), name()));
45 assert(hr->is_empty() == regions_empty(), err_msg("Wrong empty state for region %u and set %s", hr->hrs_index(), name())); 45 assert(hr->is_empty() == regions_empty(), err_msg("Wrong empty state for region %u and set %s", hr->hrm_index(), name()));
46 assert(hr->rem_set()->verify_ready_for_par_iteration(), err_msg("Wrong iteration state %u", hr->hrs_index())); 46 assert(hr->rem_set()->verify_ready_for_par_iteration(), err_msg("Wrong iteration state %u", hr->hrm_index()));
47 } 47 }
48 #endif 48 #endif
49 49
50 void HeapRegionSetBase::verify() { 50 void HeapRegionSetBase::verify() {
51 // It's important that we also observe the MT safety protocol even 51 // It's important that we also observe the MT safety protocol even
156 } else { 156 } else {
157 HeapRegion* curr_to = _head; 157 HeapRegion* curr_to = _head;
158 HeapRegion* curr_from = from_list->_head; 158 HeapRegion* curr_from = from_list->_head;
159 159
160 while (curr_from != NULL) { 160 while (curr_from != NULL) {
161 while (curr_to != NULL && curr_to->hrs_index() < curr_from->hrs_index()) { 161 while (curr_to != NULL && curr_to->hrm_index() < curr_from->hrm_index()) {
162 curr_to = curr_to->next(); 162 curr_to = curr_to->next();
163 } 163 }
164 164
165 if (curr_to == NULL) { 165 if (curr_to == NULL) {
166 // The rest of the from list should be added as tail 166 // The rest of the from list should be added as tail
181 181
182 curr_from = next_from; 182 curr_from = next_from;
183 } 183 }
184 } 184 }
185 185
186 if (_tail->hrs_index() < from_list->_tail->hrs_index()) { 186 if (_tail->hrm_index() < from_list->_tail->hrm_index()) {
187 _tail = from_list->_tail; 187 _tail = from_list->_tail;
188 } 188 }
189 } 189 }
190 190
191 _count.increment(from_list->length(), from_list->total_capacity_bytes()); 191 _count.increment(from_list->length(), from_list->total_capacity_bytes());
307 hrs_err_msg("[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: "PTR_FORMAT" prev0: "PTR_FORMAT" " "prev1: "PTR_FORMAT" length: %u", name(), count, curr, prev0, prev1, length())); 307 hrs_err_msg("[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: "PTR_FORMAT" prev0: "PTR_FORMAT" " "prev1: "PTR_FORMAT" length: %u", name(), count, curr, prev0, prev1, length()));
308 308
309 if (curr->next() != NULL) { 309 if (curr->next() != NULL) {
310 guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up"); 310 guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up");
311 } 311 }
312 guarantee(curr->hrs_index() == 0 || curr->hrs_index() > last_index, "List should be sorted"); 312 guarantee(curr->hrm_index() == 0 || curr->hrm_index() > last_index, "List should be sorted");
313 last_index = curr->hrs_index(); 313 last_index = curr->hrm_index();
314 314
315 capacity += curr->capacity(); 315 capacity += curr->capacity();
316 316
317 prev1 = prev0; 317 prev1 = prev0;
318 prev0 = curr; 318 prev0 = curr;
319 curr = curr->next(); 319 curr = curr->next();
320 } 320 }
321 321
322 guarantee(_tail == prev0, err_msg("Expected %s to end with %u but it ended with %u.", name(), _tail->hrs_index(), prev0->hrs_index())); 322 guarantee(_tail == prev0, err_msg("Expected %s to end with %u but it ended with %u.", name(), _tail->hrm_index(), prev0->hrm_index()));
323 guarantee(_tail == NULL || _tail->next() == NULL, "_tail should not have a next"); 323 guarantee(_tail == NULL || _tail->next() == NULL, "_tail should not have a next");
324 guarantee(length() == count, err_msg("%s count mismatch. Expected %u, actual %u.", name(), length(), count)); 324 guarantee(length() == count, err_msg("%s count mismatch. Expected %u, actual %u.", name(), length(), count));
325 guarantee(total_capacity_bytes() == capacity, err_msg("%s capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, 325 guarantee(total_capacity_bytes() == capacity, err_msg("%s capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT,
326 name(), total_capacity_bytes(), capacity)); 326 name(), total_capacity_bytes(), capacity));
327 } 327 }