RFR: 8328364: Remove redundant fields in 'BOTConstants'

Guoxiong Li gli at openjdk.org
Tue Mar 19 08:47:24 UTC 2024


On Tue, 19 Mar 2024 08:22:24 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Hi all,
>> 
>> The class `BOTConstants` has several redundant fields. This patch removes the redundant fields and adds a new field `CardTable::_card_shift_in_words` like `BOTConstants::_log_card_size_in_words`.
>> 
>> Thanks for taking the time to review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> src/hotspot/share/gc/shared/cardTable.hpp line 186:
> 
>> 184:   }
>> 185: 
>> 186:   static uint card_shift_in_words() {
> 
> Seems that this new API is used only for Serial and G1. I wonder if they can be changed to sth like to what Parallel does to drop the dependency on this method.

Parallel doesn't need the method `card_shift_in_words` because the parameter type of its method `ObjectStartArray::addr_for_entry` is different from the `SerialBlockOffsetSharedArray::address_for_index` and `G1BlockOffsetTable::address_for_index`.

If you don't want to add this API, I suggest using `CardTable::card_shift() - LogHeapWordSize` to replace `CardTable::card_shift_in_words` in the code. What do you think?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18371#discussion_r1529949793


More information about the hotspot-gc-dev mailing list