JDK-8366093 : [lworld] Add preview mode to C++ classloader
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-08-25
  • Updated: 2025-10-24
  • Resolved: 2025-10-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaFixed
Related Reports
Relates :  
Description
As part of supporting preview mode throughout the JDK, the C++ classloader needs to be aware of it and load alternate versions of classes and resources from the runtime jimage file.

The changes submitted as part of this task will be to provide the new logic in the C++ classloader, but not supply preview resources (this will come later).
So initially this code will have no visible effect, and should behave identically to the existing version of the code.

This will follow the same layout as for other preview aware code interrogating the jimage file, so specifically:
1. Preview resources will exist per module.
2. Preview resources for /modules/<module>/<path> will be in /modules/<module>/META-INF/preview/<path>
3. When preview mode is enabled, preview resources will overlay non-preview resources (by path matching).
4. (IMPORTANT) Non preview resources, will still be returned EVEN IF they were originally related to replaced resource (e.g. nested/inner class defined by a non-preview class, but no longer defined by the preview version).

Note that (4) could be resolved by checking for preview versions of the implied owning class, but this is more work and still cannot address resource files, where "ownership" cannot be inferred.
Comments
A pull request was submitted for review. Branch: lworld URL: https://git.openjdk.org/valhalla/pull/1618 Date: 2025-09-23 19:11:41 +0000
23-09-2025

A pull request was submitted for review. Branch: lworld URL: https://git.openjdk.org/valhalla/pull/1609 Date: 2025-09-22 22:21:25 +0000
23-09-2025