On Tue, 16 Jun 2026 05:17:22 GMT, Jaikiran Pai <[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 2798 commits:
>> 
>>  - Merge remote-tracking branch 'valhalla/lworld' into 
>> jep401_sub_review_8317279
>>  - 8386239: [lworld] Update jdk/java/util/Arrays/ArraysEqCmpTest.java
>>    
>>    Reviewed-by: liach
>>  - 8386242: [lworld] Simplify and clarify StrictProcessor
>>    
>>    Reviewed-by: dsimms
>>  - 8386140: [lworld] FieldReflector using wrong Class argument
>>    
>>    Reviewed-by: alanb, dsimms
>>  - 8386216: [lworld] Rollback meaningless diff in EventClassBuilder
>>    
>>    Reviewed-by: dsimms
>>  - 8385170: [lworld] Serialization spec needs to allow abstract value 
>> classes like Number
>>    
>>    Reviewed-by: liach
>>  - 8385980: [lworld] Standardize pattern for preview value class generation
>>    
>>    Reviewed-by: liach
>>  - 8386086: [lworld] 
>> sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java should be 
>> removed from problem list
>>    
>>    Reviewed-by: liach, dcubed
>>  - Merge
>>    
>>    Merge jdk-28+1
>>  - 8386090: [lworld] Redundant test changes in lworld versus mainline
>>    
>>    Reviewed-by: vromero
>>  - ... and 2788 more: https://git.openjdk.org/jdk/compare/92298786...4d6d2888
>
> src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 652:
> 
>> 650:     // with an extra case added for checked references and value field 
>> access
>> 651:     static final int
>> 652:             FT_FIRST_REFERENCE = 8,
> 
> More out of curiosity - I see that there's a static block below which does:
> 
> assert FT_FIRST_REFERENCE == Wrapper.OBJECT.ordinal();
> 
> So why isn't the `FT_FIRST_REFERENCE` initialized as:
> 
> 
> FT_FIRST_REFERENCE = Wrapper.OBJECT.ordinal();
> 
> instead of using the magic `8`? More so because the comment a line above says 
> "Enumerate the different field kinds using Wrapper", but this change here 
> removes the reference to that `Wrapper` enum.

I used that because I don't think `Wrapper.OBJECT.ordinal()` is a constant 
expression according to JLS - I want the compiled class files to use the 
constants directly instead of loading these static final fields.

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

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

Reply via email to