100 guarantee(regions_at(index) == NULL,
101 "all entries before _curr_index should be NULL");
102 index += 1;
103 }
104 HeapRegion *prev = NULL;
105 while (index < _length) {
106 HeapRegion *curr = regions_at(index++);
107 guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
108 guarantee(!curr->is_young(), "should not be young!");
109 guarantee(!curr->isHumongous(), "should not be humongous!");
110 if (prev != NULL) {
111 guarantee(order_regions(prev, curr) != 1,
112 err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
113 prev->gc_efficiency(), curr->gc_efficiency()));
114 }
115 sum_of_reclaimable_bytes += curr->reclaimable_bytes();
116 prev = curr;
117 }
118 guarantee(sum_of_reclaimable_bytes == _remaining_reclaimable_bytes,
119 err_msg("reclaimable bytes inconsistent, "
120 "remaining: "SIZE_FORMAT" sum: "SIZE_FORMAT,
121 _remaining_reclaimable_bytes, sum_of_reclaimable_bytes));
122 }
123 #endif // !PRODUCT
124
125 void CollectionSetChooser::sort_regions() {
126 // First trim any unused portion of the top in the parallel case.
127 if (_first_par_unreserved_idx > 0) {
128 assert(_first_par_unreserved_idx <= regions_length(),
129 "Or we didn't reserved enough length");
130 regions_trunc_to(_first_par_unreserved_idx);
131 }
132 _regions.sort(order_regions);
133 assert(_length <= regions_length(), "Requirement");
134 #ifdef ASSERT
135 for (uint i = 0; i < _length; i++) {
136 assert(regions_at(i) != NULL, "Should be true by sorting!");
137 }
138 #endif // ASSERT
139 if (G1PrintRegionLivenessInfo) {
140 G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting");
|
100 guarantee(regions_at(index) == NULL,
101 "all entries before _curr_index should be NULL");
102 index += 1;
103 }
104 HeapRegion *prev = NULL;
105 while (index < _length) {
106 HeapRegion *curr = regions_at(index++);
107 guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
108 guarantee(!curr->is_young(), "should not be young!");
109 guarantee(!curr->isHumongous(), "should not be humongous!");
110 if (prev != NULL) {
111 guarantee(order_regions(prev, curr) != 1,
112 err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
113 prev->gc_efficiency(), curr->gc_efficiency()));
114 }
115 sum_of_reclaimable_bytes += curr->reclaimable_bytes();
116 prev = curr;
117 }
118 guarantee(sum_of_reclaimable_bytes == _remaining_reclaimable_bytes,
119 err_msg("reclaimable bytes inconsistent, "
120 "remaining: " SIZE_FORMAT " sum: " SIZE_FORMAT,
121 _remaining_reclaimable_bytes, sum_of_reclaimable_bytes));
122 }
123 #endif // !PRODUCT
124
125 void CollectionSetChooser::sort_regions() {
126 // First trim any unused portion of the top in the parallel case.
127 if (_first_par_unreserved_idx > 0) {
128 assert(_first_par_unreserved_idx <= regions_length(),
129 "Or we didn't reserved enough length");
130 regions_trunc_to(_first_par_unreserved_idx);
131 }
132 _regions.sort(order_regions);
133 assert(_length <= regions_length(), "Requirement");
134 #ifdef ASSERT
135 for (uint i = 0; i < _length; i++) {
136 assert(regions_at(i) != NULL, "Should be true by sorting!");
137 }
138 #endif // ASSERT
139 if (G1PrintRegionLivenessInfo) {
140 G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting");
|