#ifdef ASSERT
HeapRegion* hr = _g1h->region_at_or_null(region_idx);
assert(hr == NULL || hr->is_in_reserved(card_start),
"Card start " PTR_FORMAT " to scan outside of region %u", p2i(card_start), _g1h->region_at(region_idx)->hrm_index());
#endif
In this context, we already know the region must not be null and these dirty cards belong to that region, so this assertion is not really useful.
HeapRegion* hr = _g1h->region_at_or_null(region_idx);
assert(hr == NULL || hr->is_in_reserved(card_start),
"Card start " PTR_FORMAT " to scan outside of region %u", p2i(card_start), _g1h->region_at(region_idx)->hrm_index());
#endif
In this context, we already know the region must not be null and these dirty cards belong to that region, so this assertion is not really useful.