320 HeapWord* const end = mr.end();
321
322 // Find the obj that extends onto mr.start().
323 // Update BOT as needed while finding start of (possibly dead)
324 // object containing the start of the region.
325 HeapWord* cur = block_start(start);
326
327 #ifdef ASSERT
328 {
329 assert(cur <= start,
330 "cur: " PTR_FORMAT ", start: " PTR_FORMAT, p2i(cur), p2i(start));
331 HeapWord* next = cur + block_size(cur);
332 assert(start < next,
333 "start: " PTR_FORMAT ", next: " PTR_FORMAT, p2i(start), p2i(next));
334 }
335 #endif
336
337 const G1CMBitMap* const bitmap = g1h->concurrent_mark()->prevMarkBitMap();
338 do {
339 oop obj = oop(cur);
340 assert(obj->is_oop(true), "Not an oop at " PTR_FORMAT, p2i(cur));
341 assert(obj->klass_or_null() != NULL,
342 "Unparsable heap at " PTR_FORMAT, p2i(cur));
343
344 size_t size;
345 bool is_dead = is_obj_dead_with_size(obj, bitmap, &size);
346
347 cur += size;
348 if (!is_dead) {
349 // Process live object's references.
350
351 // Non-objArrays are usually marked imprecise at the object
352 // start, in which case we need to iterate over them in full.
353 // objArrays are precisely marked, but can still be iterated
354 // over in full if completely covered.
355 if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
356 obj->oop_iterate(cl);
357 } else {
358 obj->oop_iterate(cl, mr);
359 }
360 }
|
320 HeapWord* const end = mr.end();
321
322 // Find the obj that extends onto mr.start().
323 // Update BOT as needed while finding start of (possibly dead)
324 // object containing the start of the region.
325 HeapWord* cur = block_start(start);
326
327 #ifdef ASSERT
328 {
329 assert(cur <= start,
330 "cur: " PTR_FORMAT ", start: " PTR_FORMAT, p2i(cur), p2i(start));
331 HeapWord* next = cur + block_size(cur);
332 assert(start < next,
333 "start: " PTR_FORMAT ", next: " PTR_FORMAT, p2i(start), p2i(next));
334 }
335 #endif
336
337 const G1CMBitMap* const bitmap = g1h->concurrent_mark()->prevMarkBitMap();
338 do {
339 oop obj = oop(cur);
340 assert(oopDesc::is_oop(obj,true), "Not an oop at " PTR_FORMAT, p2i(cur));
341 assert(obj->klass_or_null() != NULL,
342 "Unparsable heap at " PTR_FORMAT, p2i(cur));
343
344 size_t size;
345 bool is_dead = is_obj_dead_with_size(obj, bitmap, &size);
346
347 cur += size;
348 if (!is_dead) {
349 // Process live object's references.
350
351 // Non-objArrays are usually marked imprecise at the object
352 // start, in which case we need to iterate over them in full.
353 // objArrays are precisely marked, but can still be iterated
354 // over in full if completely covered.
355 if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
356 obj->oop_iterate(cl);
357 } else {
358 obj->oop_iterate(cl, mr);
359 }
360 }
|