On Mon, 1 Jun 2026 19:34:34 GMT, Matias Saavedra Silva <[email protected]> 
wrote:

>> Classes can be excluded from the CDS archive for a variety of different 
>> reasons, such as having old classfile versions or being stored in a signed 
>> jar. These exclusions can extend to other classes that depend on an excluded 
>> class such as supers or interfaces.
>> 
>> Flat and null-restricted fields have layouts that are calculated when a 
>> classfile is parsed and they rely on the klass of the field being consistent 
>> between dumptime and runtime, thus adding a new dependency. This patch adds 
>> inline flat and null-restricted fields as new dependencies that may lead to 
>> the holding class being excluded from the CDS archive. Verified with a new 
>> test and tier 1-5 tests.
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Matias Saavedra Silva has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fred and Dan comments

src/hotspot/share/classfile/systemDictionaryShared.cpp line 307:

> 305:     if (k->has_inlined_fields()) {
> 306:       for (AllFieldStream fs(k); !fs.done(); fs.next()) {
> 307:         if (fs.access_flags().is_static() && 
> !fs.field_flags().is_null_free_inline_type()) continue;

Same here. I think we're probably better off removing this clause and letting 
the general case handle it

src/hotspot/share/classfile/systemDictionaryShared.cpp line 543:

> 541:     for (AllFieldStream fs(k); !fs.done(); fs.next()) {
> 542:       if (fs.access_flags().is_static() && 
> !fs.field_flags().is_null_free_inline_type()) continue;
> 543: 

I think we can remove this check entirely.  It used to be a fast path to skip 
static fields but now we end up repeating a check we do below.  The fast path 
is now half the work of the normal path.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2464#discussion_r3336673702
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2464#discussion_r3336670371

Reply via email to