< prev index next >
src/hotspot/share/gc/g1/g1RemSet.cpp
Print this page
*** 177,187 ****
return;
}
bool marked_as_dirty = Atomic::cmpxchg(true, &_contains[region], false) == false;
if (marked_as_dirty) {
! uint allocated = Atomic::add(1u, &_cur_idx) - 1;
_buffer[allocated] = region;
}
}
// Creates the union of this and the other G1DirtyRegions.
--- 177,187 ----
return;
}
bool marked_as_dirty = Atomic::cmpxchg(true, &_contains[region], false) == false;
if (marked_as_dirty) {
! uint allocated = Atomic::add(&_cur_idx, 1u) - 1;
_buffer[allocated] = region;
}
}
// Creates the union of this and the other G1DirtyRegions.
*** 253,263 ****
static uint chunk_size() { return M; }
void work(uint worker_id) {
while (_cur_dirty_regions < _regions->size()) {
! uint next = Atomic::add(_chunk_length, &_cur_dirty_regions) - _chunk_length;
uint max = MIN2(next + _chunk_length, _regions->size());
for (uint i = next; i < max; i++) {
HeapRegion* r = _g1h->region_at(_regions->at(i));
if (!r->is_survivor()) {
--- 253,263 ----
static uint chunk_size() { return M; }
void work(uint worker_id) {
while (_cur_dirty_regions < _regions->size()) {
! uint next = Atomic::add(&_cur_dirty_regions, _chunk_length) - _chunk_length;
uint max = MIN2(next + _chunk_length, _regions->size());
for (uint i = next; i < max; i++) {
HeapRegion* r = _g1h->region_at(_regions->at(i));
if (!r->is_survivor()) {
*** 445,455 ****
return _card_table_scan_state[region] < HeapRegion::CardsPerRegion;
}
uint claim_cards_to_scan(uint region, uint increment) {
assert(region < _max_regions, "Tried to access invalid region %u", region);
! return Atomic::add(increment, &_card_table_scan_state[region]) - increment;
}
void add_dirty_region(uint const region) {
#ifdef ASSERT
HeapRegion* hr = G1CollectedHeap::heap()->region_at(region);
--- 445,455 ----
return _card_table_scan_state[region] < HeapRegion::CardsPerRegion;
}
uint claim_cards_to_scan(uint region, uint increment) {
assert(region < _max_regions, "Tried to access invalid region %u", region);
! return Atomic::add(&_card_table_scan_state[region], increment) - increment;
}
void add_dirty_region(uint const region) {
#ifdef ASSERT
HeapRegion* hr = G1CollectedHeap::heap()->region_at(region);
< prev index next >