On Mon, 22 Jun 2026 13:31:26 GMT, Jorn Vernee <[email protected]> wrote:

>> David Simms has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 2822 commits:
>> 
>>  - Merge branch '8317277' into jep401_sub_review_8317279
>>  - Merge remote-tracking branch 'valhalla/lworld' into 8317277
>>  - 8386690: [lworld] cherry-pick JDK-8386124 Test 
>> serviceability/sa/TestG1HeapRegion.java failed: Address of G1HeapRegion does 
>> not match
>>    
>>    Reviewed-by: liach
>>  - 8385743: [lworld] investigate and address build related comments in the 
>> Valhalla PR
>>    
>>    Reviewed-by: liach, erikj
>>  - 8376346: [lworld] Basic Shenandoah support
>>    
>>    Reviewed-by: qamai
>>  - 8386598: [lworld] C1 acmp profiling fix and minor cleanup
>>    
>>    Reviewed-by: mchevalier
>>  - 8386618: [lworld] Remove unused entry_guard_Relocation
>>    
>>    Reviewed-by: chagedorn, jsjolen, jsikstro
>>  - Merge
>>    
>>    Merge jdk-28+2
>>  - 8386623: [lworld] Cleanup module support for system modules in JDK 
>> exploded build with preview resources
>>    
>>    Reviewed-by: liach
>>  - 8386316: [lworld] Replace Valhalla since version with 28
>>    
>>    Reviewed-by: darcy
>>  - ... and 2812 more: https://git.openjdk.org/jdk/compare/6def7d55...426cc065
>
> src/java.base/share/classes/java/lang/invoke/ArrayVarHandle.java line 147:
> 
>> 145:             int aoffset = (int) UNSAFE.arrayInstanceBaseOffset(array);
>> 146:             int ascale = UNSAFE.arrayInstanceIndexScale(array);
>> 147:             int ashift = 31 - Integer.numberOfLeadingZeros(ascale);
> 
> Why not use `numberOfTrailingZeroes` here as well? (Just like for 
> `REFERENCE_SHIFT`)
> Suggestion:
> 
>             int ashift = Integer.numberOfTrailingZeros(ascale);

I think this is some old code that doesn't assume the scale has exactly one bit 
set?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3455472829

Reply via email to