--- a/src/hotspot/share/gc/g1/g1RemSet.cpp Mon Nov 25 12:30:24 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp Mon Nov 25 12:31:39 2019 +0100
@@ -179,7 +179,7 @@
bool marked_as_dirty = Atomic::cmpxchg(true, &_contains[region], false) == false;
if (marked_as_dirty) {
- uint allocated = Atomic::add(1u, &_cur_idx) - 1;
+ uint allocated = Atomic::add(&_cur_idx, 1u) - 1;
_buffer[allocated] = region;
}
}
@@ -255,7 +255,7 @@
void work(uint worker_id) {
while (_cur_dirty_regions < _regions->size()) {
- uint next = Atomic::add(_chunk_length, &_cur_dirty_regions) - _chunk_length;
+ 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++) {
@@ -447,7 +447,7 @@
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;
+ return Atomic::add(&_card_table_scan_state[region], increment) - increment;
}
void add_dirty_region(uint const region) {