On Thu, 4 Sep 2025 13:00:41 GMT, Paul Hübner <phub...@openjdk.org> wrote:

>> src/hotspot/share/classfile/classFileParser.cpp line 6234:
>> 
>>> 6232:           // Just poking the system dictionary to see if the class 
>>> has already be loaded. Looking for migrated classes
>>> 6233:           // used when --enable-preview when jdk isn't compiled with 
>>> --enable-preview so doesn't include LoadableDescriptors.
>>> 6234:           // This is temporary.
>> 
>> I was talking to Simms earlier and we think we should have a classfile check 
>> (i.e. ensure we are running whatever major + preview we are on at the 
>> moment), and then disable the whole loadabledescriptor functionality if the 
>> version doesn't match up. When we do this, we should probably consider that 
>> here as well. What do you think?
>
> Just to clarify, this PR is fine as-is but do you agree that we should 
> include this part of code if that classfile checking manifests itself?

It's under EnablePreview, like a lot of the code.  I'm hoping EnablePreview 
might check for classfile version?  Although it's a good question, maybe we do 
this speculative lookup only if classfile version is not preview.

This code unconditionally loads a bunch of classes in the bootclass loader, but 
doesn't add them to other class loaders as initiated classes unless 
EnablePreview is on.  I was thinking about how to load them only for 
EnablePreview as a separate change.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1544#discussion_r2322228555

Reply via email to