392 continue;
393 }
394
395 // We claim lazily (so races are possible but they're benign), which reduces the
396 // number of duplicate scans (the rsets of the regions in the cset can intersect).
397 // Claim the card after checking bounds above: the remembered set may contain
398 // random cards into current survivor, and we would then have an incorrectly
399 // claimed card in survivor space. Card table clear does not reset the card table
400 // of survivor space regions.
401 claim_card(card_index, region_idx_for_card);
402
403 MemRegion const mr(card_start, MIN2(card_start + BOTConstants::N_words, top));
404
405 scan_card(mr, region_idx_for_card);
406 }
407 event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(_phase));
408 }
409
410 void G1ScanRSForRegionClosure::scan_strong_code_roots(HeapRegion* r) {
411 EventGCPhaseParallel event;
412 r->strong_code_roots_do(_pss->closures()->weak_codeblobs());
413 event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::CodeRoots));
414 }
415
416 bool G1ScanRSForRegionClosure::do_heap_region(HeapRegion* r) {
417 assert(r->in_collection_set(),
418 "Should only be called on elements of the collection set but region %u is not.",
419 r->hrm_index());
420 uint const region_idx = r->hrm_index();
421
422 // Do an early out if we know we are complete.
423 if (_scan_state->iter_is_complete(region_idx)) {
424 return false;
425 }
426
427 {
428 G1EvacPhaseWithTrimTimeTracker timer(_pss, _rem_set_root_scan_time, _rem_set_trim_partially_time);
429 scan_rem_set_roots(r);
430 }
431
|
392 continue;
393 }
394
395 // We claim lazily (so races are possible but they're benign), which reduces the
396 // number of duplicate scans (the rsets of the regions in the cset can intersect).
397 // Claim the card after checking bounds above: the remembered set may contain
398 // random cards into current survivor, and we would then have an incorrectly
399 // claimed card in survivor space. Card table clear does not reset the card table
400 // of survivor space regions.
401 claim_card(card_index, region_idx_for_card);
402
403 MemRegion const mr(card_start, MIN2(card_start + BOTConstants::N_words, top));
404
405 scan_card(mr, region_idx_for_card);
406 }
407 event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(_phase));
408 }
409
410 void G1ScanRSForRegionClosure::scan_strong_code_roots(HeapRegion* r) {
411 EventGCPhaseParallel event;
412 // We pass a weak code blobs closure to the remembered set scanning because we want to avoid
413 // treating the nmethods visited to act as roots for concurrent marking.
414 // We only want to make sure that the oops in the nmethods are adjusted with regard to the
415 // objects copied by the current evacuation.
416 r->strong_code_roots_do(_pss->closures()->weak_codeblobs());
417 event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::CodeRoots));
418 }
419
420 bool G1ScanRSForRegionClosure::do_heap_region(HeapRegion* r) {
421 assert(r->in_collection_set(),
422 "Should only be called on elements of the collection set but region %u is not.",
423 r->hrm_index());
424 uint const region_idx = r->hrm_index();
425
426 // Do an early out if we know we are complete.
427 if (_scan_state->iter_is_complete(region_idx)) {
428 return false;
429 }
430
431 {
432 G1EvacPhaseWithTrimTimeTracker timer(_pss, _rem_set_root_scan_time, _rem_set_trim_partially_time);
433 scan_rem_set_roots(r);
434 }
435
|