RFR: 8327571: Parallel: Remove redundant operation in PSParallelCompact::clear_data_covering_space

Guoxiong Li gli at openjdk.org
Thu Mar 7 15:19:54 UTC 2024


On Thu, 7 Mar 2024 13:50:32 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 901:
>> 
>>> 899: 
>>> 900:   const idx_t beg_bit = _mark_bitmap.addr_to_bit(bot);
>>> 901:   const idx_t end_bit = _mark_bitmap.addr_to_bit(top);
>> 
>> The method `addr_to_bit` invokes the method `words_to_bits`, so the result is always aligned. Is my understanding right?
>
> Don't think so. The alignment is about `#bits % BitsPerWord == 0`. `clear_range` does not require alignment. (You can try `assert(_mark_bitmap.align_range_end(end_bit) == end_bit, "inv");`, and that should fail.)

Got it. Thanks for your answer.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18152#discussion_r1516341758


More information about the hotspot-gc-dev mailing list