RFR: 8328573: Add ASSERT macro and not use 'CardTable::card_shift_in_words' in 'G1BlockOffsetTable::check_index'
Guoxiong Li
gli at openjdk.org
Wed Mar 20 08:54:26 UTC 2024
On Wed, 20 Mar 2024 08:40:05 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Hi all,
>>
>> This patch adds the ASSERT macro to the declaration and usages of the method `G1BlockOffsetTable::check_index`. And the `CardTable::card_shift_in_words` is changed to `CardTable::card_shift` in order to prepare [JDK-8328508](https://bugs.openjdk.org/browse/JDK-8328508).
>>
>> Thanks for taking the time to review.
>>
>> Best Regards,
>> -- Guoxiong
>
> src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp line 54:
>
>> 52: assert((index) < (_reserved.byte_size() >> CardTable::card_shift()),
>> 53: "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT,
>> 54: msg, (index), (_reserved.byte_size() >> CardTable::card_shift()));
>
> I do not think these two changes are in any way related to the other assert changes. One may move this change to the mentioned [JDK-8328508](https://bugs.openjdk.org/browse/JDK-8328508).
You are right. I will move them to JDK-8328508.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18391#discussion_r1531698265
More information about the hotspot-gc-dev
mailing list