191 if (top_obj != NULL && top_obj < (_sp->toContiguousSpace())->top()) {
192 if (_precision == CardTableModRefBS::ObjHeadPreciseArray) {
193 if (oop(top_obj)->is_objArray() || oop(top_obj)->is_typeArray()) {
194 // An arrayOop is starting on the dirty card - since we do exact
195 // store checks for objArrays we are done.
196 } else {
197 // Otherwise, it is possible that the object starting on the dirty
198 // card spans the entire card, and that the store happened on a
199 // later card. Figure out where the object ends.
200 assert(_sp->block_size(top_obj) == (size_t) oop(top_obj)->size(),
201 "Block size and object size mismatch");
202 top = top_obj + oop(top_obj)->size();
203 }
204 }
205 } else {
206 top = (_sp->toContiguousSpace())->top();
207 }
208 return top;
209 }
210
211 void Filtering_DCTOC::walk_mem_region(MemRegion mr,
212 HeapWord* bottom,
213 HeapWord* top) {
214 // Note that this assumption won't hold if we have a concurrent
215 // collector in this space, which may have freed up objects after
216 // they were dirtied and before the stop-the-world GC that is
217 // examining cards here.
218 assert(bottom < top, "ought to be at least one obj on a dirty card.");
219
220 if (_boundary != NULL) {
221 // We have a boundary outside of which we don't want to look
222 // at objects, so create a filtering closure around the
223 // oop closure before walking the region.
224 FilteringClosure filter(_boundary, _cl);
225 walk_mem_region_with_cl(mr, bottom, top, &filter);
226 } else {
227 // No boundary, simply walk the heap with the oop closure.
228 walk_mem_region_with_cl(mr, bottom, top, _cl);
229 }
230
231 }
|
191 if (top_obj != NULL && top_obj < (_sp->toContiguousSpace())->top()) {
192 if (_precision == CardTableModRefBS::ObjHeadPreciseArray) {
193 if (oop(top_obj)->is_objArray() || oop(top_obj)->is_typeArray()) {
194 // An arrayOop is starting on the dirty card - since we do exact
195 // store checks for objArrays we are done.
196 } else {
197 // Otherwise, it is possible that the object starting on the dirty
198 // card spans the entire card, and that the store happened on a
199 // later card. Figure out where the object ends.
200 assert(_sp->block_size(top_obj) == (size_t) oop(top_obj)->size(),
201 "Block size and object size mismatch");
202 top = top_obj + oop(top_obj)->size();
203 }
204 }
205 } else {
206 top = (_sp->toContiguousSpace())->top();
207 }
208 return top;
209 }
210
211 void FilteringDCTOC::walk_mem_region(MemRegion mr,
212 HeapWord* bottom,
213 HeapWord* top) {
214 // Note that this assumption won't hold if we have a concurrent
215 // collector in this space, which may have freed up objects after
216 // they were dirtied and before the stop-the-world GC that is
217 // examining cards here.
218 assert(bottom < top, "ought to be at least one obj on a dirty card.");
219
220 if (_boundary != NULL) {
221 // We have a boundary outside of which we don't want to look
222 // at objects, so create a filtering closure around the
223 // oop closure before walking the region.
224 FilteringClosure filter(_boundary, _cl);
225 walk_mem_region_with_cl(mr, bottom, top, &filter);
226 } else {
227 // No boundary, simply walk the heap with the oop closure.
228 walk_mem_region_with_cl(mr, bottom, top, _cl);
229 }
230
231 }
|