348 size_t marked_bytes) { |
348 size_t marked_bytes) { |
349 assert(marked_bytes <= used(), |
349 assert(marked_bytes <= used(), |
350 "marked: " SIZE_FORMAT " used: " SIZE_FORMAT, marked_bytes, used()); |
350 "marked: " SIZE_FORMAT " used: " SIZE_FORMAT, marked_bytes, used()); |
351 _prev_top_at_mark_start = top(); |
351 _prev_top_at_mark_start = top(); |
352 _prev_marked_bytes = marked_bytes; |
352 _prev_marked_bytes = marked_bytes; |
353 } |
|
354 |
|
355 HeapWord* |
|
356 HeapRegion::object_iterate_mem_careful(MemRegion mr, |
|
357 ObjectClosure* cl) { |
|
358 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
|
359 // We used to use "block_start_careful" here. But we're actually happy |
|
360 // to update the BOT while we do this... |
|
361 HeapWord* cur = block_start(mr.start()); |
|
362 mr = mr.intersection(used_region()); |
|
363 if (mr.is_empty()) return NULL; |
|
364 // Otherwise, find the obj that extends onto mr.start(). |
|
365 |
|
366 assert(cur <= mr.start() |
|
367 && (oop(cur)->klass_or_null() == NULL || |
|
368 cur + oop(cur)->size() > mr.start()), |
|
369 "postcondition of block_start"); |
|
370 oop obj; |
|
371 while (cur < mr.end()) { |
|
372 obj = oop(cur); |
|
373 if (obj->klass_or_null() == NULL) { |
|
374 // Ran into an unparseable point. |
|
375 return cur; |
|
376 } else if (!g1h->is_obj_dead(obj)) { |
|
377 cl->do_object(obj); |
|
378 } |
|
379 cur += block_size(cur); |
|
380 } |
|
381 return NULL; |
|
382 } |
353 } |
383 |
354 |
384 HeapWord* |
355 HeapWord* |
385 HeapRegion:: |
356 HeapRegion:: |
386 oops_on_card_seq_iterate_careful(MemRegion mr, |
357 oops_on_card_seq_iterate_careful(MemRegion mr, |