RFR: 8324649: Shenandoah: replace implementation of free set [v53]

Kelvin Nilsen kdnilsen at openjdk.org
Tue May 7 05:56:09 UTC 2024


On Fri, 3 May 2024 16:22:55 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 114 commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into restructure-free-set
>>  - Merge branch 'openjdk:master' into master
>>  - Merge branch 'openjdk:master' into master
>>  - Remove unnecessary call to update_watermark
>>  - Assert progress on find_next and find_prev
>>  - Simplify partition_membership_name by code reuse
>>  - Simplify by combining implemnetations of shrink_interval functions
>>  - Fix NumPartition type
>>    
>>    Beautify the code by changing type of NumPartitions and adding Int and
>>    UInt forms of NumPartitions.
>>  - Refinements to support zero-build compiles
>>  - Fix whitespace
>>  - ... and 104 more: https://git.openjdk.org/jdk/compare/a863ef5d...d6e3546c
>
> src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp line 167:
> 
>> 165:       return beg;
>> 166:     } else {
>> 167:       // There is at least one non-zero bit within the masked element_bits.  Find it.
> 
> I think you meant to say 'There is at least one zero bit...' ?

The if clause handles the case when element_bits == 0.  The fact that we didn't take the if branch tells us there is at least one non-zero bit.  The else-if clause handles the case that the desired number of consecutive one bits are found at offset beg.  At this point, we know there is at least one non-zero bit and we know that we don't have num_bits consecutive one bits starting at beg.

I'm adding a comment to the code to explain how this works.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17561#discussion_r1591847964


More information about the shenandoah-dev mailing list