RFR: 8329096: G1: Change the type of G1BlockOffsetTable::_offset_base to uint8_t*
Thomas Schatzl
tschatzl at openjdk.org
Wed Mar 27 08:52:22 UTC 2024
On Tue, 26 Mar 2024 22:13:42 GMT, Guoxiong Li <gli at openjdk.org> wrote:
> Hi all,
>
> This patch changes the type of `G1BlockOffsetTable::_offset_base` to `uint8_t*`, just like `SerialBlockOffsetSharedArray::_offset_base` and `ObjectStartArray::_offset_base`. The tests `make test-tier1_gc` passed locally.
>
> Thanks for taking the time to review.
>
> Best Regards,
> -- Guoxiong
lgtm. Maybe fix the minor pre-existing issues.
src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp line 111:
> 109: "Offset card has an unexpected value");
> 110: uint8_t* start_card_for_region = start_card;
> 111: uint8_t offset = max_jubyte;
Pre-existing: That should probably be `UINT8_MAX` from stdint/cstdint.h (should already be included).
src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp line 93:
> 91: assert(_reserved.contains(p),
> 92: "out of bounds access to block offset table");
> 93: uint8_t* result = const_cast<uint8_t *>(&_offset_base[uintptr_t(p) >> CardTable::card_shift()]);
Pre-existing:
Suggestion:
uint8_t* result = const_cast<uint8_t*>(&_offset_base[uintptr_t(p) >> CardTable::card_shift()]);
-------------
Marked as reviewed by tschatzl (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18502#pullrequestreview-1962657138
PR Review Comment: https://git.openjdk.org/jdk/pull/18502#discussion_r1540687585
PR Review Comment: https://git.openjdk.org/jdk/pull/18502#discussion_r1540689115
More information about the hotspot-gc-dev
mailing list