On Thu, 7 May 2026 23:02:27 GMT, Chen Liang <[email protected]> wrote:

>> Hi everyone,
>> 
>> This change removes the remaining mandatory preloading path for 
>> null-restricted instance fields when loading classes from CDS. 
>> [JDK-8380053](https://bugs.openjdk.org/browse/JDK-8380053) already changed 
>> normal class loading so null-restricted field types are no longer loaded 
>> just because the field is null-restriced. Instead, the preloading is 
>> speculative and driven by the `LoadableDescriptor` attribute. The CDS path 
>> still had the older special case in 
>> `SystemDictionary::preload_from_null_free_field`, which could force loading 
>> of null-restricted field types.
>> 
>> This fix removes that CDS-only preload helper and routes non-static field 
>> signatures through the existing `LoadableDescriptor` path instead. This 
>> makes loading follow the same model as in 
>> `ClassFileParser::fetch_field_classes()` with speculative loading.
>> 
>> Testing:
>> - Tier 1-3
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> src/hotspot/share/classfile/systemDictionary.cpp line 1210:
> 
>> 1208:         bool check = preload_from_null_free_field(ik, class_loader, 
>> sig, field_index, CHECK_NULL);
>> 1209:         if (!check) {
>> 1210:           ik->set_shared_loading_failed();
> 
> Can we safely drop this failure marking?

It's used for regular shared class loading so I don't think we can drop this 
shared_loading_failed marker.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2409#discussion_r3211399648

Reply via email to