82 _length = 0; 83 84 empty_list(_survivor_head); 85 _survivor_head = NULL; 86 _survivor_tail = NULL; 87 _survivor_length = 0; 88 89 _last_sampled_rs_lengths = 0; 90 91 assert(check_list_empty(false), "just making sure..."); 92 } 93 94 bool YoungList::check_list_well_formed() { 95 bool ret = true; 96 97 uint length = 0; 98 HeapRegion* curr = _head; 99 HeapRegion* last = NULL; 100 while (curr != NULL) { 101 if (!curr->is_young()) { 102 log_info(gc, verify)("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " " 103 "incorrectly tagged (y: %d, surv: %d)", 104 p2i(curr->bottom()), p2i(curr->end()), 105 curr->is_young(), curr->is_survivor()); 106 ret = false; 107 } 108 ++length; 109 last = curr; 110 curr = curr->get_next_young_region(); 111 } 112 ret = ret && (length == _length); 113 114 if (!ret) { 115 log_info(gc, verify)("### YOUNG LIST seems not well formed!"); 116 log_info(gc, verify)("### list has %u entries, _length is %u", length, _length); 117 } 118 119 return ret; 120 } 121 122 bool YoungList::check_list_empty(bool check_sample) { 123 bool ret = true; 124 125 if (_length != 0) { 126 log_info(gc, verify)("### YOUNG LIST should have 0 length, not %u", _length); 127 ret = false; 128 } 129 if (check_sample && _last_sampled_rs_lengths != 0) { 130 log_info(gc, verify)("### YOUNG LIST has non-zero last sampled RS lengths"); 131 ret = false; 132 } 133 if (_head != NULL) { 134 log_info(gc, verify)("### YOUNG LIST does not have a NULL head"); 135 ret = false; 136 } 137 if (!ret) { 138 log_info(gc, verify)("### YOUNG LIST does not seem empty"); 139 } 140 141 return ret; 142 } 143 144 void 145 YoungList::rs_length_sampling_init() { 146 _sampled_rs_lengths = 0; 147 _curr = _head; 148 } 149 150 bool 151 YoungList::rs_length_sampling_more() { 152 return _curr != NULL; 153 } 154 155 void 156 YoungList::rs_length_sampling_next() { 157 assert( _curr != NULL, "invariant" ); 158 size_t rs_length = _curr->rem_set()->occupied(); | 82 _length = 0; 83 84 empty_list(_survivor_head); 85 _survivor_head = NULL; 86 _survivor_tail = NULL; 87 _survivor_length = 0; 88 89 _last_sampled_rs_lengths = 0; 90 91 assert(check_list_empty(false), "just making sure..."); 92 } 93 94 bool YoungList::check_list_well_formed() { 95 bool ret = true; 96 97 uint length = 0; 98 HeapRegion* curr = _head; 99 HeapRegion* last = NULL; 100 while (curr != NULL) { 101 if (!curr->is_young()) { 102 log_error(gc, verify)("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " " 103 "incorrectly tagged (y: %d, surv: %d)", 104 p2i(curr->bottom()), p2i(curr->end()), 105 curr->is_young(), curr->is_survivor()); 106 ret = false; 107 } 108 ++length; 109 last = curr; 110 curr = curr->get_next_young_region(); 111 } 112 ret = ret && (length == _length); 113 114 if (!ret) { 115 log_error(gc, verify)("### YOUNG LIST seems not well formed!"); 116 log_error(gc, verify)("### list has %u entries, _length is %u", length, _length); 117 } 118 119 return ret; 120 } 121 122 bool YoungList::check_list_empty(bool check_sample) { 123 bool ret = true; 124 125 if (_length != 0) { 126 log_error(gc, verify)("### YOUNG LIST should have 0 length, not %u", _length); 127 ret = false; 128 } 129 if (check_sample && _last_sampled_rs_lengths != 0) { 130 log_error(gc, verify)("### YOUNG LIST has non-zero last sampled RS lengths"); 131 ret = false; 132 } 133 if (_head != NULL) { 134 log_error(gc, verify)("### YOUNG LIST does not have a NULL head"); 135 ret = false; 136 } 137 if (!ret) { 138 log_error(gc, verify)("### YOUNG LIST does not seem empty"); 139 } 140 141 return ret; 142 } 143 144 void 145 YoungList::rs_length_sampling_init() { 146 _sampled_rs_lengths = 0; 147 _curr = _head; 148 } 149 150 bool 151 YoungList::rs_length_sampling_more() { 152 return _curr != NULL; 153 } 154 155 void 156 YoungList::rs_length_sampling_next() { 157 assert( _curr != NULL, "invariant" ); 158 size_t rs_length = _curr->rem_set()->occupied(); |