RFR: 8264908: Investigate adding BOT range check in G1BlockOffsetTablePart::block_at_or_preceding [v3]

Albert Mingkun Yang ayang at openjdk.java.net
Wed Jul 14 14:42:09 UTC 2021


On Wed, 14 Jul 2021 14:19:51 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

>> 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.
>
> I can add the deferred change, instead of splitting it off into a separate PR.

> the caller (block_start) allows more than the callee (values < _hr->end())

That path should never be taken, so I am not worried about. I suggested putting that in another PR since those assertions are not obvious from the current ticket title. Anyway, this is subjective.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4775



More information about the hotspot-gc-dev mailing list