RFR: 8353225: Add a way to iterate Klass inside the loaded CDS archive

Ioi Lam iklam at openjdk.org
Tue Apr 1 18:09:09 UTC 2025


On Tue, 1 Apr 2025 18:03:16 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> This PR only moves code around, at least here. I am unsure why this code uses next_link. My understanding from reading the code and from Ioi's explanation is that LambdaProxyClassDictionary re-uses the next_link linking mechanism for linking CDS proxy classes together before they are loaded; so they are not yet part of the CLDG and this use does not conflict with the use of next_link in the CLDG. 
>> 
>> I may be wrong though and am happy to be corrected.
>
> If we want this PR to proceed we should restructure the CDS code to use a different mechanism to iterate over the unloaded proxy classes.

However, I still don't understand why this API is necessary for "KLUT" -- why do you need to look at all the classes in the CDS archive, including those that are not yet loaded?

Not all classes in the CDS archive are destined to be loaded. So of them are never referenced by the app so they are not loaded. Others can be substituted by JVMTI ClassFileLoadHook. So if you see some of these unloaded classes, what can you do with them?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24311#discussion_r2023445400


More information about the hotspot-runtime-dev mailing list