On Mon, 22 Dec 2025 14:44:11 GMT, Roger Riggs <[email protected]> wrote:

>> Preview mode support for exploded build.
>> 
>> This is an alternate approach from 
>> https://github.com/openjdk/valhalla/pull/1845 which I think is actually 
>> cleaner and more robust.
>
> src/hotspot/share/classfile/classLoader.cpp line 276:
> 
>> 274: 
>> 275: // Returns the access mode for an initialized JImage file (reflects 
>> --enable-preview).
>> 276: static bool is_preview_enabled() {
> 
> Previously, the preview related names were associated with jimage mode, 
> expanding that to the exploded image raises a question about the name and the 
> name set_preview_mode ; there may be some ambiguity in this 
> is_preview_enabled() and the vm wide method(s) indicating --enable-preview 
> across all HotSpot functions.
> It would be good if this name could reflect the mode of loading classes.
> Maybe...
> is_class_loading_mode_preview() based on class_loading_mode.

I mean it is the "class loader", so to me the question "is preview enabled?" in 
this class would mean (implicitly) "for class loading". I guess 
"should_load_preview_classes()" and "set_preview_class_loading()" are more 
descriptive, but then again the flag controlling this is "--enable-preview", so 
"is preview enabled" ties back very nicely.

I'd vote to not change it in this PR and we can discuss the finer points of 
this after Xmas.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1854#discussion_r2640918126

Reply via email to