Skip to content

Commit

Permalink
JDK-8330339
Browse files Browse the repository at this point in the history
  • Loading branch information
lgxbslgx committed Apr 16, 2024
1 parent 8a5b86c commit 2b04aee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class G1BlockOffsetTable: public CHeapObj<mtGC> {

inline void set_offset_array(uint8_t* left, uint8_t* right, uint8_t offset);

// Mapping from address to object start array entry
uint8_t* entry_for_addr(const void* const p) const;

// Mapping from object start array entry to address of first word
HeapWord* addr_for_entry(const uint8_t* const p) const;

void check_address(uint8_t* addr, const char* msg) const NOT_DEBUG_RETURN;

// Sets the entries corresponding to the cards starting at "start" and ending
Expand All @@ -77,6 +83,9 @@ class G1BlockOffsetTable: public CHeapObj<mtGC> {

void check_all_cards(uint8_t* left_card, uint8_t* right_card) const NOT_DEBUG_RETURN;

void verify_offset(uint8_t* card_index, uint8_t upper) const NOT_DEBUG_RETURN;
void verify_for_block(HeapWord* blk_start, HeapWord* blk_end) const NOT_DEBUG_RETURN;

static HeapWord* align_up_by_card_size(HeapWord* const addr) {
return align_up(addr, CardTable::card_size());
}
Expand All @@ -99,22 +108,13 @@ class G1BlockOffsetTable: public CHeapObj<mtGC> {
// in the heap parameter.
G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage);

// Mapping from address to object start array entry
uint8_t* entry_for_addr(const void* const p) const;

// Mapping from object start array entry to address of first word
HeapWord* addr_for_entry(const uint8_t* const p) const;

static bool is_crossing_card_boundary(HeapWord* const obj_start,
HeapWord* const obj_end) {
HeapWord* cur_card_boundary = align_up_by_card_size(obj_start);
// strictly greater-than
return obj_end > cur_card_boundary;
}

void verify_offset(uint8_t* card_index, uint8_t upper) const NOT_DEBUG_RETURN;
void verify_for_block(HeapWord* blk_start, HeapWord* blk_end) const NOT_DEBUG_RETURN;

// Returns the address of the start of the block reaching into the card containing
// "addr".
inline HeapWord* block_start_reaching_into_card(const void* addr) const;
Expand Down

0 comments on commit 2b04aee

Please sign in to comment.