RFR: 8264908: Investigate adding BOT range check in G1BlockOffsetTablePart::block_at_or_preceding [v3]
tschatzl at openjdk.java.net
Wed Jul 14 14:17:18 UTC 2021
On Wed, 14 Jul 2021 12:58:37 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
>> Hi all,
>> Please review this cleanup change to add an assert to G1BlockOffsetTablePart::block_at_or_preceding. Additionally, remove code that attempts to read beyond the _next_offset_index threshold.
>> Testing: Tier 1-3
> Ivan Walulya has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp line 119:
> 117: size_t index = _bot->index_for(addr);
> 118: // We must make sure that the offset table entry we use is valid.
> 119: assert(index < _next_offset_index, "Precondition");
I feel a bit uneasy that the caller (`block_start`) allows more than the callee (values `< _hr->end()`), but this is probably the change that is supposed to be coming?
Looks good, but I would have preferred the original change or the upcoming change with some asserts included.
More information about the hotspot-gc-dev