RFR: 8368954: G1: Document why G1 uses TLS storage for the current card table reference

Thomas Schatzl tschatzl at openjdk.org
Tue Sep 30 16:00:26 UTC 2025


On Tue, 30 Sep 2025 15:46:55 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1ThreadLocalData.hpp line 46:
>> 
>>> 44:   // way for fast access to this value in the barrier.
>>> 45:   // E.g. embedding an address to that value directly into the code stream similar
>>> 46:   // to Serial/Parallel and then loading from that was found to be slower at least
>> 
>> Not sure if I misunderstood this text or not, but Serial/Parallel doesn't embed the "address" into the code stream -- they embed the actual value in the code stream, since the value (card-tabe-base) is constant. G1 can't/doesn't do that, since card-table-base is not constant.
>
> But G1 can embed the address of the value in the code stream, similar to Serial/Parallel (which embed the actual base address). The emphasis should be on the embedding, not what is embedded.

maybe just remove the "an address" to avoid the confusion?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27573#discussion_r2392110354


More information about the hotspot-gc-dev mailing list