RFR: 8343468: GenShen: Enable relocation of remembered set card tables [v6]

Cesar Soares Lucas cslucas at openjdk.org
Thu Mar 6 18:24:34 UTC 2025


On Wed, 5 Mar 2025 17:32:30 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Cesar Soares Lucas has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address PR feedback: formatting.
>
> src/hotspot/share/gc/shenandoah/shenandoahCardTable.cpp line 57:
> 
>> 55:   _byte_map = (CardValue*) write_space.base();
>> 56:   _byte_map_base = _byte_map - (uintptr_t(low_bound) >> _card_shift);
>> 57: 
> 
> It is a bit sad to see these asserts go. Is this because `_byte_map` is now mutable? May I suggest doing something like:
> 
> 
>   _write_byte_map = (CardValue*) write_space.base();
>   _write_byte_map_base = _byte_map - (uintptr_t(low_bound) >> _card_shift);
>   ...later...
>   _read_byte_map = (CardValue*) read_space.base();
>   _read_byte_map_base = _byte_map - (uintptr_t(low_bound) >> _card_shift);
>   ...later...
> 
>   // Set up current byte map
>   _byte_map = _write_byte_map;
>   _byte_map_base = _write_byte_map_base;
> 
>   // Check one side is good
>   assert(byte_for(low_bound) == &_byte_map[0], "Checking start of map");
>   assert(byte_for(high_bound-1) <= &_byte_map[last_valid_index()], "Checking end of map");
>   swap_read_and_write_tables();
> 
>   // Check another side is good
>   assert(byte_for(low_bound) == &_byte_map[0], "Checking start of map");
>   assert(byte_for(high_bound-1) <= &_byte_map[last_valid_index()], "Checking end of map");
>   swap_read_and_write_tables();

@shipilev - I did some tests and the conclusion is that we can put the asserts back. Thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23170#discussion_r1983847384


More information about the shenandoah-dev mailing list