[lworld] RFR: 8366093: [lworld] Add preview mode to C++ classloader [v2]

Paul Hübner phubner at openjdk.org
Wed Oct 15 09:10:31 UTC 2025


On Tue, 14 Oct 2025 12:34:14 GMT, David Beaumont <duke at openjdk.org> wrote:

>> C++ changes for supporting preview mode when preview mode resources (with new location flags) are available.
>> 
>> At the moment, this code will operate on non-preview jimage files (1.0) and act as if no preview resources are available by virtue of the default value for missing attributes being zero (which matches location flags for "normal" entries).
>
> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reorganising to catch preview-only cases

Marked as reviewed by phubner (Author).

src/java.base/share/native/libjimage/jimage.cpp line 115:

> 113: 
> 114:     // TBD:   assert(module_name_len > 0 && "module name must be non-empty");
> 115:     assert(name_len > 0 && "name must non-empty");

Nitpick: `assert(expr, msg)` vs `assert(expr && msg)`.

src/java.base/share/native/libjimage/jimage.cpp line 190:

> 188:         index += preview_infix_len;
> 189:         // Check we copied up to the expected '/' separator.
> 190:         assert(name_buffer[index] == '/' && "bad string concatenation");

Here as well fwiw.

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

PR Review: https://git.openjdk.org/valhalla/pull/1618#pullrequestreview-3339245357
PR Review Comment: https://git.openjdk.org/valhalla/pull/1618#discussion_r2431752110
PR Review Comment: https://git.openjdk.org/valhalla/pull/1618#discussion_r2431754458


More information about the valhalla-dev mailing list