diff a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp --- a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp @@ -1,7 +1,7 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. @@ -71,11 +71,11 @@ Atomic::release_store(&_hr, hr); } template void OtherRegionsTable::iterate(Closure& cl) { - if (_n_coarse_entries > 0) { + if (Atomic::load(&_has_coarse_entries)) { BitMap::idx_t cur = _coarse_map.get_next_one_offset(0); while (cur != _coarse_map.size()) { cl.next_coarse_prt((uint)cur); cur = _coarse_map.get_next_one_offset(cur + 1); }