Skip to content

Commit a3a367e

Browse files
committed
8332871: Parallel: Remove public bits APIs in ParMarkBitMap
Reviewed-by: tschatzl
1 parent 61db2f5 commit a3a367e

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

src/hotspot/share/gc/parallel/parMarkBitMap.hpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131

3232
class PSVirtualSpace;
3333

34-
class ParMarkBitMap: public CHeapObj<mtGC>
35-
{
34+
class ParMarkBitMap: public CHeapObj<mtGC> {
3635
public:
3736
typedef BitMap::idx_t idx_t;
3837

@@ -46,9 +45,6 @@ class ParMarkBitMap: public CHeapObj<mtGC>
4645
inline bool mark_obj(HeapWord* addr);
4746
inline bool mark_obj(oop obj);
4847

49-
// Traditional interface for testing whether an object is marked or not (these
50-
// test only the begin bits).
51-
inline bool is_marked(idx_t bit) const;
5248
inline bool is_marked(HeapWord* addr) const;
5349
inline bool is_marked(oop obj) const;
5450

@@ -57,18 +53,13 @@ class ParMarkBitMap: public CHeapObj<mtGC>
5753

5854
size_t reserved_byte_size() const { return _reserved_byte_size; }
5955

60-
// Convert a heap address to/from a bit index.
61-
inline idx_t addr_to_bit(HeapWord* addr) const;
62-
inline HeapWord* bit_to_addr(idx_t bit) const;
63-
6456
inline HeapWord* find_obj_beg(HeapWord* beg, HeapWord* end) const;
6557

6658
// Return the address of the last obj-start in the range [beg, end). If no
6759
// object is found, return end.
6860
inline HeapWord* find_obj_beg_reverse(HeapWord* beg, HeapWord* end) const;
69-
// Clear a range of bits or the entire bitmap (both begin and end bits are
70-
// cleared).
71-
inline void clear_range(idx_t beg, idx_t end);
61+
// Clear a range of bits corresponding to heap address range [beg, end).
62+
inline void clear_range(HeapWord* beg, HeapWord* end);
7263

7364
void print_on_error(outputStream* st) const {
7465
st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, p2i(this));
@@ -111,6 +102,10 @@ class ParMarkBitMap: public CHeapObj<mtGC>
111102
inline size_t region_size() const;
112103
inline size_t size() const;
113104

105+
// Convert a heap address to/from a bit index.
106+
inline idx_t addr_to_bit(HeapWord* addr) const;
107+
inline HeapWord* bit_to_addr(idx_t bit) const;
108+
114109
#ifdef ASSERT
115110
inline void verify_bit(idx_t bit) const;
116111
inline void verify_addr(HeapWord* addr) const;

src/hotspot/share/gc/parallel/parMarkBitMap.inline.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ inline ParMarkBitMap::ParMarkBitMap():
3434
_region_start(nullptr), _region_size(0), _beg_bits(), _virtual_space(nullptr), _reserved_byte_size(0)
3535
{ }
3636

37-
inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end) {
38-
_beg_bits.clear_range(beg, end);
37+
inline void ParMarkBitMap::clear_range(HeapWord* beg, HeapWord* end) {
38+
const idx_t beg_bit = addr_to_bit(beg);
39+
const idx_t end_bit = addr_to_bit(end);
40+
_beg_bits.clear_range(beg_bit, end_bit);
3941
}
4042

4143
inline ParMarkBitMap::idx_t ParMarkBitMap::bits_required(size_t words) {
@@ -62,12 +64,8 @@ inline size_t ParMarkBitMap::size() const {
6264
return _beg_bits.size();
6365
}
6466

65-
inline bool ParMarkBitMap::is_marked(idx_t bit) const {
66-
return _beg_bits.at(bit);
67-
}
68-
6967
inline bool ParMarkBitMap::is_marked(HeapWord* addr) const {
70-
return is_marked(addr_to_bit(addr));
68+
return _beg_bits.at(addr_to_bit(addr));
7169
}
7270

7371
inline bool ParMarkBitMap::is_marked(oop obj) const {

src/hotspot/share/gc/parallel/psParallelCompact.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,7 @@ PSParallelCompact::clear_data_covering_space(SpaceId id)
826826
HeapWord* const top = space->top();
827827
HeapWord* const max_top = MAX2(top, _space_info[id].new_top());
828828

829-
const idx_t beg_bit = _mark_bitmap.addr_to_bit(bot);
830-
const idx_t end_bit = _mark_bitmap.addr_to_bit(top);
831-
_mark_bitmap.clear_range(beg_bit, end_bit);
829+
_mark_bitmap.clear_range(bot, top);
832830

833831
const size_t beg_region = _summary_data.addr_to_region_idx(bot);
834832
const size_t end_region =
@@ -1001,10 +999,9 @@ void PSParallelCompact::fill_dense_prefix_end(SpaceId id) {
1001999
return;
10021000
}
10031001
RegionData* const region_after_dense_prefix = _summary_data.addr_to_region_ptr(dense_prefix_end);
1004-
idx_t const dense_prefix_bit = _mark_bitmap.addr_to_bit(dense_prefix_end);
10051002

10061003
if (region_after_dense_prefix->partial_obj_size() != 0 ||
1007-
_mark_bitmap.is_marked(dense_prefix_bit)) {
1004+
_mark_bitmap.is_marked(dense_prefix_end)) {
10081005
// The region after the dense prefix starts with live bytes.
10091006
return;
10101007
}

0 commit comments

Comments
 (0)