RFR: 8276229: Stop allowing implicit updates in G1BlockOffsetTable

Thomas Schatzl tschatzl at openjdk.java.net
Wed Nov 10 13:48:33 UTC 2021


On Wed, 10 Nov 2021 13:22:25 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> You're missing the case where `addr` is not covered by the first object ("block") in the card. So when asking for `block_at_or_preciding(addr)` we get an object that is stretching into the card same card as `addr` map to, but it is not certain that it is the object containing `addr`.
>
> My initial thought was also that this should not be needed, but the code proved me wrong. It might be possible to refactor the code even further to avoid this case.

Okay, understood. I have been too fixated on the case with remembered sets to disregard other cases, looking at the code I even found interesting ones :)

           card1       card2
   -----+----------+----------+---------
       A|AAABBBCCCD|DDD       |
   -----+----------+----------+---------
       ^    ^  ^
       q    n  addr
```   
Something like this: we get asked by `addr` somewhere in card card1, `block_preceeding_addr(addr)` is `q` and `n` is the end of the block.

Agree, then the code (and the comment) is correct.

Maybe it is really worth to optimize the card scanning case.

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

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



More information about the hotspot-gc-dev mailing list