134 // The problem is that, if evacuation fails, we might have
135 // remembered set entries missing given that we skipped cards on
136 // the collection set. So, we'll recreate such entries now.
137 obj->oop_iterate(_update_rset_cl);
138
139 _last_forwarded_object_end = obj_end;
140 _hr->cross_threshold(obj_addr, obj_end);
141 }
142 }
143
144 // Fill the memory area from start to end with filler objects, and update the BOT
145 // and the mark bitmap accordingly.
146 void zap_dead_objects(HeapWord* start, HeapWord* end) {
147 if (start == end) {
148 return;
149 }
150
151 size_t gap_size = pointer_delta(end, start);
152 MemRegion mr(start, gap_size);
153 if (gap_size >= CollectedHeap::min_fill_size()) {
154 CollectedHeap::fill_with_objects(start, gap_size);
155
156 HeapWord* end_first_obj = start + ((oop)start)->size();
157 _hr->cross_threshold(start, end_first_obj);
158 // Fill_with_objects() may have created multiple (i.e. two)
159 // objects, as the max_fill_size() is half a region.
160 // After updating the BOT for the first object, also update the
161 // BOT for the second object to make the BOT complete.
162 if (end_first_obj != end) {
163 _hr->cross_threshold(end_first_obj, end);
164 #ifdef ASSERT
165 size_t size_second_obj = ((oop)end_first_obj)->size();
166 HeapWord* end_of_second_obj = end_first_obj + size_second_obj;
167 assert(end == end_of_second_obj,
168 "More than two objects were used to fill the area from " PTR_FORMAT " to " PTR_FORMAT ", "
169 "second objects size " SIZE_FORMAT " ends at " PTR_FORMAT,
170 p2i(start), p2i(end), size_second_obj, p2i(end_of_second_obj));
171 #endif
172 }
173 }
174 _cm->clearRangePrevBitmap(mr);
|
134 // The problem is that, if evacuation fails, we might have
135 // remembered set entries missing given that we skipped cards on
136 // the collection set. So, we'll recreate such entries now.
137 obj->oop_iterate(_update_rset_cl);
138
139 _last_forwarded_object_end = obj_end;
140 _hr->cross_threshold(obj_addr, obj_end);
141 }
142 }
143
144 // Fill the memory area from start to end with filler objects, and update the BOT
145 // and the mark bitmap accordingly.
146 void zap_dead_objects(HeapWord* start, HeapWord* end) {
147 if (start == end) {
148 return;
149 }
150
151 size_t gap_size = pointer_delta(end, start);
152 MemRegion mr(start, gap_size);
153 if (gap_size >= CollectedHeap::min_fill_size()) {
154 G1CollectedHeap::fill_with_non_humongous_objects(start, gap_size);
155
156 HeapWord* end_first_obj = start + ((oop)start)->size();
157 _hr->cross_threshold(start, end_first_obj);
158 // Fill_with_objects() may have created multiple (i.e. two)
159 // objects, as the max_fill_size() is half a region.
160 // After updating the BOT for the first object, also update the
161 // BOT for the second object to make the BOT complete.
162 if (end_first_obj != end) {
163 _hr->cross_threshold(end_first_obj, end);
164 #ifdef ASSERT
165 size_t size_second_obj = ((oop)end_first_obj)->size();
166 HeapWord* end_of_second_obj = end_first_obj + size_second_obj;
167 assert(end == end_of_second_obj,
168 "More than two objects were used to fill the area from " PTR_FORMAT " to " PTR_FORMAT ", "
169 "second objects size " SIZE_FORMAT " ends at " PTR_FORMAT,
170 p2i(start), p2i(end), size_second_obj, p2i(end_of_second_obj));
171 #endif
172 }
173 }
174 _cm->clearRangePrevBitmap(mr);
|