On Wed, 28 Jan 2026 12:08:57 GMT, Paul Hübner <[email protected]> wrote:

>> src/hotspot/share/classfile/classFileParser.cpp line 6298:
>> 
>>> 6296:           if (klass != nullptr) {
>>> 6297:             if (klass->is_inline_klass()) {
>>> 6298:               set_inline_layout_info_klass(fieldinfo.index(), klass, 
>>> CHECK);
>> 
>> I think this is a property already precent in the code but this change made 
>> me reflect on this. 
>> 
>> What are the expected interactions for pre-loaded classes if we fail to load 
>> parse the class file which contains them. For example here if we have just 
>> resolved the pre-loaded class, and then get metaspace out of memory and stop 
>> loading this class file. 
>> 
>> Is this the correct (specification wise) interaction for partially failed 
>> class file parsing?
>
> There's nothing from the specification point of view that enforces that a 
> class and its pre-loaded (via `LoadableDescriptor`) classes must be 
> all-or-nothing. 
>> Classes and interfaces mentioned by LoadableDescriptors may optionally be 
>> loaded when the referencing class is derived and created 
>> ([5.3.5](https://cr.openjdk.org/~dlsmith/jep401/jep401-20250926/specs/value-objects-jvms.html#jvms-5.3.5)),
>>  or during early stages of linking 
>> ([5.4](https://cr.openjdk.org/~dlsmith/jep401/jep401-20250926/specs/value-objects-jvms.html#jvms-5.4)).

This is the same situation as when the JVM is loading a class A, and during the 
loading of A, it successfully loads A's super-class B, but then encounter an 
issue while continuing the loading of A (OOM in Metaspace, or B is an 
interface, or B is final etc.). The loading of A fails, but class B remains in 
the system dictionary, until its class loader is unloaded.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1966#discussion_r2743530911

Reply via email to