230 for (int i = 0; i < _index; ++i) { |
230 for (int i = 0; i < _index; ++i) { |
231 fn(_base[i]); |
231 fn(_base[i]); |
232 } |
232 } |
233 } |
233 } |
234 |
234 |
|
235 // It scans an object and visits its children. |
|
236 inline void CMTask::scan_object(oop obj) { process_grey_object<true>(obj); } |
|
237 |
235 inline void CMTask::push(oop obj) { |
238 inline void CMTask::push(oop obj) { |
236 HeapWord* objAddr = (HeapWord*) obj; |
239 HeapWord* objAddr = (HeapWord*) obj; |
237 assert(_g1h->is_in_g1_reserved(objAddr), "invariant"); |
240 assert(_g1h->is_in_g1_reserved(objAddr), "invariant"); |
238 assert(!_g1h->is_on_master_free_list( |
241 assert(!_g1h->is_on_master_free_list( |
239 _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant"); |
242 _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant"); |
296 } // Else check global finger. |
299 } // Else check global finger. |
297 } |
300 } |
298 // Check global finger. |
301 // Check global finger. |
299 return objAddr < global_finger; |
302 return objAddr < global_finger; |
300 } |
303 } |
|
304 |
|
305 template<bool scan> |
|
306 inline void CMTask::process_grey_object(oop obj) { |
|
307 assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray"); |
|
308 assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant"); |
|
309 |
|
310 if (_cm->verbose_high()) { |
|
311 gclog_or_tty->print_cr("[%u] processing grey object " PTR_FORMAT, |
|
312 _worker_id, p2i((void*) obj)); |
|
313 } |
|
314 |
|
315 size_t obj_size = obj->size(); |
|
316 _words_scanned += obj_size; |
|
317 |
|
318 if (scan) { |
|
319 obj->oop_iterate(_cm_oop_closure); |
|
320 } |
|
321 statsOnly( ++_objs_scanned ); |
|
322 check_limits(); |
|
323 } |
|
324 |
|
325 |
301 |
326 |
302 inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) { |
327 inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) { |
303 if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) { |
328 if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) { |
304 |
329 |
305 if (_cm->verbose_high()) { |
330 if (_cm->verbose_high()) { |