Skip to content

Commit

Permalink
8330362: G1: Inline offset array element accessor in G1BlockOffsetTable
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, tschatzl
  • Loading branch information
lgxbslgx committed Apr 23, 2024
1 parent b6518a5 commit b07e153
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st
p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end()));
}

void G1BlockOffsetTable::set_offset_array_raw(uint8_t* addr, uint8_t offset) {
Atomic::store(addr, offset);
}

void G1BlockOffsetTable::set_offset_array(uint8_t* addr, uint8_t offset) {
check_address(addr, "Block offset table address out of range");
set_offset_array_raw(addr, offset);
Atomic::store(addr, offset);
}

void G1BlockOffsetTable::set_offset_array(uint8_t* addr, HeapWord* high, HeapWord* low) {
check_address(addr, "Block offset table address out of range");
assert(high >= low, "addresses out of order");
size_t offset = pointer_delta(high, low);
check_offset(offset, "offset too large");
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class G1BlockOffsetTable: public CHeapObj<mtGC> {
// For performance these have to devolve to array accesses in product builds.
inline uint8_t offset_array(uint8_t* addr) const;

inline void set_offset_array_raw(uint8_t* addr, uint8_t offset);
inline void set_offset_array(uint8_t* addr, uint8_t offset);

inline void set_offset_array(uint8_t* addr, HeapWord* high, HeapWord* low);
Expand Down

1 comment on commit b07e153

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.