-
Notifications
You must be signed in to change notification settings - Fork 18
JDK-8324523: Lilliput: if +UseCOH, always use the archive's encoding base and shift #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
x86 problem unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks ok.
Questions, though: what is the impact of this? Is it a bug? Does it improve or regress performance? Should it be backported?
@tstuefe This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
It is a bug, but I saw it only on Windows with my new class pointer patch. I could not reproduce it with the standard JVM, but I did not try very hard. Bug could lead to crashes. Performance impact is nil, since if we do actually run with an encoding scheme mismatch, we won't live very long. If we don't, it does not matter. |
@rkennke :
Okay, this bugged me, and I just had to know for sure. This bug is confirmed. In the traditional Lilliput VM this leads to early crashes in rare cases if a couple of conditions hold:
If all these conditions hold, we will generate the archive using precomputed narrow Klass IDs in prototype headers based on the assumption that the later encoding base is the Klass range start. But at runtime, we set the encoding base to zero, and now the narrow Klass IDs don't match up, and we get a crash right away:
Neither. If the bug hits, we crash. If it does not, we already do the right thing today, nothing changes with this patch. Another answer is that it can improve performance, since it makes +UseCOH able to run with CDS archive, so it improves startup.
Yes, but this is based upon the big classspace rework patch from last summer (JDK-8312018) and a bunch of other patches. If they had been backported too, this should be backported as well. |
Ok, thank you very much for the clarification, this is very useful! Patch is good to go! |
x86 error unrelated (and I think already fixed upstream). Thanks @rkennke /integrate |
Going to push as commit e735376. |
We have two ways to initialize narrow Klass encoding: either we let the JVM choose base and shift freely, or we dictate base and shift. The former gives the JVM more leeway, e.g. to go with unscaled encoding. The latter, however, is required if we load a CDS archive and that archive contains precomputed narrow Klass IDs.
In the Legacy VM, this can only happen if the archive contains heap objects. In Lilliput, the markword carries the nKlass, and therefore the prototype baked into archived Klass structures carries it also. Therefore, we must always choose the strict initialization when +UseCOH.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/lilliput.git pull/124/head:pull/124
$ git checkout pull/124
Update a local copy of the PR:
$ git checkout pull/124
$ git pull https://git.openjdk.org/lilliput.git pull/124/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 124
View PR using the GUI difftool:
$ git pr show -t 124
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/lilliput/pull/124.diff
Webrev
Link to Webrev Comment