RFR: 8328508: Unify the signatures of the methods address_for_index() and index_for() in BOT implementations [v2]

Thomas Schatzl tschatzl at openjdk.org
Tue Mar 26 12:17:24 UTC 2024


On Thu, 21 Mar 2024 00:40:33 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> 
>> This patch unifies the related methods of the block offset table in Serial, Parallel and GC. It mainly removes the methods `SerialBlockOffsetSharedArray::address_for_index`, `SerialBlockOffsetSharedArray::index_for`, `G1BlockOffsetTable::address_for_index` and `G1BlockOffsetTable::index_for` and adds the corresponding methods `addr_for_entry` and `entry_for_addr`. Their usages and the signatures of other methods are also adjusted.
>> 
>> I find some duplicated code of the block offset table in Serial and Parallel (and less in G1). Maybe, we should refactor the block offset table to reduce the duplicated code in the future.
>> 
>> Tier-1 is running locally.
>> 
>> Thanks for taking the time to review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> Guoxiong Li has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Revert ObjectStartArray::block_start_reaching_into_card
>  - Drop unnecessary type conversion.

Marked as reviewed by tschatzl (Reviewer).

src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp line 55:

> 53: 
> 54:   // Biased array-start of BOT array for fast BOT entry translation
> 55:   volatile u_char* _offset_base;

Maybe the type could be changed to `uint8_t` as well while we are changing this code but feel free to ignore at this point.

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

PR Review: https://git.openjdk.org/jdk/pull/18405#pullrequestreview-1960171723
PR Review Comment: https://git.openjdk.org/jdk/pull/18405#discussion_r1539100237


More information about the hotspot-gc-dev mailing list