On Fri, 13 Mar 2026 10:11:47 GMT, David Beaumont <[email protected]> wrote:

>> src/hotspot/share/classfile/classLoader.cpp line 277:
>> 
>>> 275: // jimage_is_preview_enabled() can be called to correctly determine 
>>> the access mode.
>>> 276: static bool jimage_is_initialized() {
>>> 277:   return jimage_exists() && Preview_mode != PREVIEW_MODE_UNINITIALIZED;
>> 
>> If  the JImage doesn't exist then presumably the Preview_mode will never 
>> change from PREVIEW_MODE_UNINITIALIZED, so that is all we need to check here.
>
> True ... I think. I'll double check and change it if so (maybe with a 
> comment).

Ahh, I've remembered. It *used* to be true that you only needed to test the 
flag, but the changes in the 2nd PR (adding exploded image support) mean that 
the flag is now also used for that too, and needs to be usable when no jimage 
is opened, but this function is purely about whether the both the jimage and 
the flag are present and usable.

This is why I changed the flag status names from "JIMAGE_XXX" to 
"PREVIEW_MODE_XXX" because the flag isn't limited to jimage use now, but the 
function stays as "jimage_is_initialized" not "preview_mode_is_initialized".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29414#discussion_r2930425854

Reply via email to