mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
7046182: G1: remove unnecessary iterations over the collection set
Remove two unnecessary iterations over the collection set which are supposed to prepare the RSet's of the CSet regions for parallel iterations (we'll make sure this is done incrementally). I'll piggyback on this CR the removal of the G1_REM_SET_LOGGING code. Reviewed-by: brutisso, johnc
This commit is contained in:
parent
7ceee7642b
commit
408e0b1bc1
9 changed files with 115 additions and 82 deletions
|
@ -1085,8 +1085,9 @@ int HeapRegionRemSet::num_par_rem_sets() {
|
|||
|
||||
HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa,
|
||||
HeapRegion* hr)
|
||||
: _bosa(bosa), _other_regions(hr), _iter_state(Unclaimed) { }
|
||||
|
||||
: _bosa(bosa), _other_regions(hr) {
|
||||
reset_for_par_iteration();
|
||||
}
|
||||
|
||||
void HeapRegionRemSet::setup_remset_size() {
|
||||
// Setup sparse and fine-grain tables sizes.
|
||||
|
@ -1101,10 +1102,6 @@ void HeapRegionRemSet::setup_remset_size() {
|
|||
guarantee(G1RSetSparseRegionEntries > 0 && G1RSetRegionEntries > 0 , "Sanity");
|
||||
}
|
||||
|
||||
void HeapRegionRemSet::init_for_par_iteration() {
|
||||
_iter_state = Unclaimed;
|
||||
}
|
||||
|
||||
bool HeapRegionRemSet::claim_iter() {
|
||||
if (_iter_state != Unclaimed) return false;
|
||||
jint res = Atomic::cmpxchg(Claimed, (jint*)(&_iter_state), Unclaimed);
|
||||
|
@ -1119,7 +1116,6 @@ bool HeapRegionRemSet::iter_is_complete() {
|
|||
return _iter_state == Complete;
|
||||
}
|
||||
|
||||
|
||||
void HeapRegionRemSet::init_iterator(HeapRegionRemSetIterator* iter) const {
|
||||
iter->initialize(this);
|
||||
}
|
||||
|
@ -1132,7 +1128,7 @@ void HeapRegionRemSet::print() const {
|
|||
while (iter.has_next(card_index)) {
|
||||
HeapWord* card_start =
|
||||
G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index);
|
||||
gclog_or_tty->print_cr(" Card " PTR_FORMAT ".", card_start);
|
||||
gclog_or_tty->print_cr(" Card " PTR_FORMAT, card_start);
|
||||
}
|
||||
// XXX
|
||||
if (iter.n_yielded() != occupied()) {
|
||||
|
@ -1159,6 +1155,14 @@ void HeapRegionRemSet::par_cleanup() {
|
|||
void HeapRegionRemSet::clear() {
|
||||
_other_regions.clear();
|
||||
assert(occupied() == 0, "Should be clear.");
|
||||
reset_for_par_iteration();
|
||||
}
|
||||
|
||||
void HeapRegionRemSet::reset_for_par_iteration() {
|
||||
_iter_state = Unclaimed;
|
||||
_iter_claimed = 0;
|
||||
// It's good to check this to make sure that the two methods are in sync.
|
||||
assert(verify_ready_for_par_iteration(), "post-condition");
|
||||
}
|
||||
|
||||
void HeapRegionRemSet::scrub(CardTableModRefBS* ctbs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue