517 move_candidates_to_collection_set(num_selected_regions); |
517 move_candidates_to_collection_set(num_selected_regions); |
518 |
518 |
519 _num_optional_regions -= num_selected_regions; |
519 _num_optional_regions -= num_selected_regions; |
520 |
520 |
521 stop_incremental_building(); |
521 stop_incremental_building(); |
|
522 |
|
523 _g1h->verify_region_attr_remset_update(); |
|
524 |
522 return num_selected_regions > 0; |
525 return num_selected_regions > 0; |
523 } |
526 } |
524 |
527 |
525 void G1CollectionSet::abandon_optional_collection_set(G1ParScanThreadStateSet* pss) { |
528 void G1CollectionSet::abandon_optional_collection_set(G1ParScanThreadStateSet* pss) { |
526 for (uint i = 0; i < _num_optional_regions; i++) { |
529 for (uint i = 0; i < _num_optional_regions; i++) { |
527 HeapRegion* r = candidates()->at(candidates()->cur_idx() + i); |
530 HeapRegion* r = candidates()->at(candidates()->cur_idx() + i); |
528 pss->record_unused_optional_region(r); |
531 pss->record_unused_optional_region(r); |
|
532 // Clear collection set marker and make sure that the remembered set information |
|
533 // is correct as we still need it later. |
529 _g1h->clear_region_attr(r); |
534 _g1h->clear_region_attr(r); |
|
535 _g1h->register_region_with_region_attr(r); |
530 r->clear_index_in_opt_cset(); |
536 r->clear_index_in_opt_cset(); |
531 } |
537 } |
532 free_optional_regions(); |
538 free_optional_regions(); |
|
539 |
|
540 _g1h->verify_region_attr_remset_update(); |
533 } |
541 } |
534 |
542 |
535 #ifdef ASSERT |
543 #ifdef ASSERT |
536 class G1VerifyYoungCSetIndicesClosure : public HeapRegionClosure { |
544 class G1VerifyYoungCSetIndicesClosure : public HeapRegionClosure { |
537 private: |
545 private: |