On Tue, 7 Jul 2026 23:45:45 GMT, Dean Long <[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 2900 commits:
>> 
>>  - Merge branch '8317277' into jep401_sub_review_8317278
>>  - Merge remote-tracking branch 'valhalla/lworld' into 8317277
>>  - Merge
>>    
>>    Merge jdk-28+5
>>  - 8386602: [lworld] C2: assert(n != top() || r->in(pnum) == top()) failed: 
>> live value must not be garbage
>>    
>>    Reviewed-by: thartmann
>>  - 8386499: [lworld] java/util/Arrays/ArraysEqCmpTest.java fails with 
>> unexpected layoutKind 5
>>    
>>    Reviewed-by: chagedorn
>>  - 8387629: [lworld] Don't use apiNote for some recent JDI spec updates
>>    
>>    Reviewed-by: sspitsyn
>>  - 8387682: [lworld] Mention preview API in description of 
>> can_support_value_objects capability
>>    
>>    Reviewed-by: cjplummer
>>  - 8387657: [lworld] Object Tags section of JVMTI spec should make it clear 
>> that ObjectFree event is not sent for value objects
>>    
>>    Reviewed-by: sspitsyn, cjplummer
>>  - 8382226: [lworld] C2: Fix _copyOf/_copyOfRange intrinsic for flat 
>> abstract value class arrays
>>    
>>    Reviewed-by: qamai, thartmann
>>  - 8387612: [lworld] C2: assert(array_type->is_flat() || 
>> ideal.ctrl()->in(0)->as_If()->is_flat_array_check(&_gvn)) failed: Should be 
>> found
>>    
>>    Co-authored-by: Marc Chevalier <[email protected]>
>>    Reviewed-by: thartmann
>>  - ... and 2890 more: https://git.openjdk.org/jdk/compare/db987b1e...f1f6d35d
>
> src/hotspot/share/ci/ciObjArrayKlass.cpp line 203:
> 
>> 201: ciKlass* ciObjArrayKlass::exact_klass() {
>> 202:   // This cannot be an exact klass because the refined types subtype it
>> 203:   return nullptr;
> 
> This seems overly conservative.  Shouldn't we at least allow the old code 
> when Valhalla --enable-preview features are turned off?  Even when Valhalla 
> features are turned on, I suspect that there are situations where we can do 
> better than always returning nullptr.

That's indeed conservative. For the non-Valhalla/non-preview case, we could 
return

ciObjArrayKlass::make(element_klass(), true /* refined_type */);

where we returned `this` in the old code (we cannot return `this` since we also 
use the new metadata hierarchy without `--enable-preview`).

For the Valhalla/enable-preview case, we could probably also do better. I filed 
[JDK-8388014](https://bugs.openjdk.org/browse/JDK-8388014) to address that 
separately.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31122#discussion_r3551283662

Reply via email to