8213373: Bulk MarkBitMap clearing methods

Reviewed-by: rkennke, zgu
This commit is contained in:
Aleksey Shipilev 2018-11-15 21:05:47 +01:00
parent cc8ee84d59
commit c8ebf4da3b
2 changed files with 16 additions and 4 deletions

View File

@ -44,14 +44,19 @@ void MarkBitMap::initialize(MemRegion heap, MemRegion storage) {
_bm = BitMapView((BitMap::bm_word_t*) storage.start(), _covered.word_size() >> _shifter);
}
void MarkBitMap::clear_range(MemRegion mr) {
void MarkBitMap::do_clear(MemRegion mr, bool large) {
MemRegion intersection = mr.intersection(_covered);
assert(!intersection.is_empty(),
"Given range from " PTR_FORMAT " to " PTR_FORMAT " is completely outside the heap",
p2i(mr.start()), p2i(mr.end()));
// convert address range into offset range
_bm.at_put_range(addr_to_offset(intersection.start()),
addr_to_offset(intersection.end()), false);
size_t beg = addr_to_offset(intersection.start());
size_t end = addr_to_offset(intersection.end());
if (large) {
_bm.clear_large_range(beg, end);
} else {
_bm.clear_range(beg, end);
}
}
#ifdef ASSERT

View File

@ -49,6 +49,10 @@ protected:
size_t addr_to_offset(const HeapWord* addr) const {
return pointer_delta(addr, _covered.start()) >> _shifter;
}
// Clear bitmap range
void do_clear(MemRegion mr, bool large);
public:
static size_t compute_size(size_t heap_size);
// Returns the amount of bytes on the heap between two marks in the bitmap.
@ -88,7 +92,10 @@ public:
inline bool par_mark(HeapWord* addr);
inline bool par_mark(oop obj);
void clear_range(MemRegion mr);
// Clear bitmap.
void clear() { do_clear(_covered, true); }
void clear_range(MemRegion mr) { do_clear(mr, false); }
void clear_range_large(MemRegion mr) { do_clear(mr, true); }
};
#endif // SHARE_VM_GC_SHARED_MARKBITMAP_HPP