@@ -1889,16 +1889,16 @@ HeapRegion* G1ConcurrentMark::claim_region(uint worker_id) {
1889
1889
while (finger < _heap.end ()) {
1890
1890
assert (_g1h->is_in_reserved (finger), " invariant" );
1891
1891
1892
- HeapRegion* curr_region = _g1h->heap_region_containing (finger);
1892
+ HeapRegion* curr_region = _g1h->heap_region_containing_or_null (finger);
1893
1893
// Make sure that the reads below do not float before loading curr_region.
1894
1894
OrderAccess::loadload ();
1895
1895
// Above heap_region_containing may return NULL as we always scan claim
1896
1896
// until the end of the heap. In this case, just jump to the next region.
1897
- HeapWord* end = curr_region != NULL ? curr_region->end () : finger + HeapRegion::GrainWords;
1897
+ HeapWord* end = curr_region != nullptr ? curr_region->end () : finger + HeapRegion::GrainWords;
1898
1898
1899
1899
// Is the gap between reading the finger and doing the CAS too long?
1900
1900
HeapWord* res = Atomic::cmpxchg (&_finger, finger, end);
1901
- if (res == finger && curr_region != NULL ) {
1901
+ if (res == finger && curr_region != nullptr ) {
1902
1902
// we succeeded
1903
1903
HeapWord* bottom = curr_region->bottom ();
1904
1904
HeapWord* limit = curr_region->top_at_mark_start ();
@@ -1915,7 +1915,7 @@ HeapRegion* G1ConcurrentMark::claim_region(uint worker_id) {
1915
1915
" the region limit should be at bottom" );
1916
1916
// we return NULL and the caller should try calling
1917
1917
// claim_region() again.
1918
- return NULL ;
1918
+ return nullptr ;
1919
1919
}
1920
1920
} else {
1921
1921
assert (_finger > finger, " the finger should have moved forward" );
@@ -1924,7 +1924,7 @@ HeapRegion* G1ConcurrentMark::claim_region(uint worker_id) {
1924
1924
}
1925
1925
}
1926
1926
1927
- return NULL ;
1927
+ return nullptr ;
1928
1928
}
1929
1929
1930
1930
#ifndef PRODUCT
@@ -1972,11 +1972,11 @@ void G1ConcurrentMark::verify_no_collection_set_oops() {
1972
1972
1973
1973
// Verify the global finger
1974
1974
HeapWord* global_finger = finger ();
1975
- if (global_finger != NULL && global_finger < _heap.end ()) {
1976
- // Since we always iterate over all regions, we might get a NULL HeapRegion
1975
+ if (global_finger != nullptr && global_finger < _heap.end ()) {
1976
+ // Since we always iterate over all regions, we might get a nullptr HeapRegion
1977
1977
// here.
1978
- HeapRegion* global_hr = _g1h->heap_region_containing (global_finger);
1979
- guarantee (global_hr == NULL || global_finger == global_hr->bottom (),
1978
+ HeapRegion* global_hr = _g1h->heap_region_containing_or_null (global_finger);
1979
+ guarantee (global_hr == nullptr || global_finger == global_hr->bottom (),
1980
1980
" global finger: " PTR_FORMAT " region: " HR_FORMAT,
1981
1981
p2i (global_finger), HR_FORMAT_PARAMS (global_hr));
1982
1982
}
@@ -1986,10 +1986,10 @@ void G1ConcurrentMark::verify_no_collection_set_oops() {
1986
1986
for (uint i = 0 ; i < _num_concurrent_workers; ++i) {
1987
1987
G1CMTask* task = _tasks[i];
1988
1988
HeapWord* task_finger = task->finger ();
1989
- if (task_finger != NULL && task_finger < _heap.end ()) {
1989
+ if (task_finger != nullptr && task_finger < _heap.end ()) {
1990
1990
// See above note on the global finger verification.
1991
- HeapRegion* r = _g1h->heap_region_containing (task_finger);
1992
- guarantee (r == NULL || task_finger == r->bottom () ||
1991
+ HeapRegion* r = _g1h->heap_region_containing_or_null (task_finger);
1992
+ guarantee (r == nullptr || task_finger == r->bottom () ||
1993
1993
!r->in_collection_set () || !r->has_index_in_opt_cset (),
1994
1994
" task finger: " PTR_FORMAT " region: " HR_FORMAT,
1995
1995
p2i (task_finger), HR_FORMAT_PARAMS (r));
0 commit comments