[lworld] RFR: 8366200: Modify existing use of jimage fields to make space for preview mode flags [v2]

David Beaumont duke at openjdk.org
Wed Aug 27 13:39:17 UTC 2025


> Changes jimage creation to sort any non-empty packages first in the list of package entries.
> 
> Changes imageFile.cpp to read only the lowest bit in the flag word so that other bits can later be used for preview mode.
> 
> Reviewer notes:
> ----
> Unfortunately I cannot be 100% sure that this change has covered all the cases where the flag word is read. I only found imageFile.cpp looking at it, and all the other jimage tools I know about, such as ImageReader, ignore it completely.
> 
> The PR is "safe" in the sense that the value being written to the flag word is unchanged, and the response in imageFile.cpp to a value is unchanged. However getting this PR in does not guarantee there is no more code that does a zero/non-zero test on the flag word.
> 
> To check this as best as I can heuristically, I ran a version of the code through CI where the flag value was OR'ed with 0x80000000, meaning it was never zero. If other code were doing a simple zero/non-zero test on the flag it is hoped the this would catch it out.
> 
> I have also left any code which iterates the package entries alone (for now) because they might be given older jimage files. In order to usefully process the knowledge that "if there's a non-empty package it's listed first", it might be necessary to make a minor bump to the version number of the file jimage file so this feature can be detected.
> 
> ---------
> ### Progress
> - [x] Change must not contain extraneous whitespace
> 
> ### Error
>  ⚠️ The pull request body must not be empty.
> 
> 
> 
> ### Reviewing
> <details><summary>Using <code>git</code></summary>
> 
> Checkout this PR locally: \
> `$ git fetch https://git.openjdk.org/valhalla.git pull/1534/head:pull/1534` \
> `$ git checkout pull/1534`
> 
> Update a local copy of the PR: \
> `$ git checkout pull/1534` \
> `$ git pull https://git.openjdk.org/valhalla.git pull/1534/head`
> 
> </details>
> <details><summary>Using Skara CLI tools</summary>
> 
> Checkout this PR locally: \
> `$ git pr checkout 1534`
> 
> View PR using the GUI difftool: \
> `$ git pr show -t 1534`
> 
> </details>
> <details><summary>Using diff file</summary>
> 
> Download this PR as a diff file: \
> <a href="https://git.openjdk.org/valhalla/pull/1534.diff">https://git.openjdk.org/valhalla/pull/1534.diff</a>
> 
> </details>

David Beaumont has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision:

 - 8366200: Modify existing use of jimage fields to make space for preview mode flags
 - remove dead code

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1534/files
  - new: https://git.openjdk.org/valhalla/pull/1534/files/6cd28426..5ad3d879

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1534&range=01
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1534&range=00-01

  Stats: 148 lines in 4 files changed: 0 ins; 144 del; 4 mod
  Patch: https://git.openjdk.org/valhalla/pull/1534.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1534/head:pull/1534

PR: https://git.openjdk.org/valhalla/pull/1534


More information about the valhalla-dev mailing list