8379148: [lworld] Wrapper class caches should not be used when --enable-preview#2249
8379148: [lworld] Wrapper class caches should not be used when --enable-preview#2249Arraying wants to merge 3 commits intoopenjdk:lworldfrom
Conversation
|
/contributor add @xmas92 |
|
👋 Welcome back phubner! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@Arraying |
|
What does this really solve? This doesn't identify the sites that incorrectly initialized these caches. This doesn't remove the C2 recognition of special wrapper arrays. Why do we need this? |
|
Thanks for your comments @liach.
The purpose of this PR is to clean up the remaining box cache changes that are necessary. Once the scope of this task is finalized and the PR goes out of draft, I will update the description to be more representative.
There are likely other usage sites that I have not overhauled. This is still a draft.
We cannot remove C2's recognition of these arrays. The box caches are VM symbols, we can only restrict their usages from the VM's side by ensuring control flow does not use them and verifying this through assertions. One prominent usage is during deoptimization. Axel has already changed the VM code for this in JDK-8378531. We still had underlying test failures, for instance JDK-8379863, which was a missing piece for this PR. Now that this has been integrated, things will look a lot clearer.
When it comes to boxed caches, we should not initialize from (nor write to) the CDS archives. |
| } | ||
|
|
||
| static boolean isEnabled() { | ||
| return cache != unused; |
There was a problem hiding this comment.
Overall it looks good to me, but is it possible to do this:
static boolean isEnabled() {
return cache != null;
That way you don't need the unused anymore.
matias9927
left a comment
There was a problem hiding this comment.
So far, the design makes sense to me! The caches will still exist in the CDS archive because they will be in the default classlist, but minimizing their use in preview mode will help transition to its deprecation.
| assert cache.length == size; | ||
| } else { | ||
| cache = unused; | ||
| assert !isEnabled(); |
There was a problem hiding this comment.
I would assert that archivedCache is null here so we know it does not get loaded by CDS at all.
Hi all,
This contributes @xmas92's previously disregarded patch to disable the boxed primitive cache entirely when using preview mode.
Testing: tiers 1-4, Oracle tiers 5-7 with
--enable-previewonly.Progress
Issue
Contributors
<aboldtch@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2249/head:pull/2249$ git checkout pull/2249Update a local copy of the PR:
$ git checkout pull/2249$ git pull https://git.openjdk.org/valhalla.git pull/2249/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2249View PR using the GUI difftool:
$ git pr show -t 2249Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2249.diff