[lworld] RFR: 8368475: [lworld] Add preview classes to jimage at make time [v2]

Roger Riggs rriggs at openjdk.org
Mon Nov 17 22:14:05 UTC 2025


On Fri, 14 Nov 2025 12:10:33 GMT, David Beaumont <duke at openjdk.org> wrote:

>> Copies valuetype classes for each module into corresponding "/META-INF/preview/..." sub-directories to be pulled into jimage files and processed by the new preview mode handling code.
>> 
>> There might be a better way to do this in terms of Makefile semantics, but this seems to work well enough and doesn't prevent the value-class JAR files being generated for patching (which is still how everyone will get value classes until the rest of the work is plumbed in).
>> 
>> To enable the new preview mode work, set the "DISABLE_PREVIEW_PATCHING" system property to "true".
>
> David Beaumont has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - rename marker, tweak comments
>  - Merge branch 'lworld' into jdk_8368475_makefile/squashed
>  - Copy value classes into preview directories for inclusion in jimage

This does the job, but its hard to confirm the results.

There should be a log message indicating that jimage is using preview classes.
Perhaps per-class logging, as is done for CDS archive or JAR file or..., indicating where the class is loaded from. That would give good visibility into class loading problems, if any.

There is an existing message in arguments.cpp for patched value classes that could be revised for enabling preview classes from jimage.

    log_info(class)("--enable-preview appending value classes for module %s: %s", module_name, entry->d_name);

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

Marked as reviewed by rriggs (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/1727#pullrequestreview-3474743483
PR Comment: https://git.openjdk.org/valhalla/pull/1727#issuecomment-3544053237


More information about the valhalla-dev mailing list