-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8305895: Implement JEP 450: Compact Object Headers (Experimental) #20677
Conversation
👋 Welcome back rkennke! A progress list of the required criteria for merging this PR into |
@rkennke 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 20 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@rkennke The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
96ec3c2
to
ad7e13b
Compare
/label remove core-libs |
/jep JEP-450 |
@rkennke |
@rkennke |
@rkennke |
ad7e13b
to
dfe36bd
Compare
dfe36bd
to
ed03217
Compare
Ok, I think we can live with that for now. As said elsewhere, we are currently working on 4-byte-headers, which would make that problem go away. The tests need fixing, though. |
@merykitty the object base is always at least @rkennke yes, working on fixing the tests :) |
@eme64 Please correct me if I'm wrong but the issue is you need the base to be aligned at 32 bytes on AVX2 machines for any alignment for vector instruction to be meaningful, so I don't see the value of vector alignment at all. |
Ah. So we would eventually have not a |
First: without |
@eme64 You will need the alignment for the whole vector (which means 32 bytes for a |
@merykitty I don't think I understand. When and for what do I need the full 32-byte alignment? |
@merykitty In |
@eme64 If you load a 32-byte (256-bit) vector, then the load is aligned if the address is divisible by 32, otherwise the load is misaligned. That's why As a result, I don't see how you can align a vector load/store if the object base is only guaranteed to align at 8-byte boundaries. I mean there is no use trying to align an access if you cannot align it at the access size, the access is going to be misaligned anyway. |
I am not sure if and when this is going to happen. When I presented the idea at JVMLS, I got some resistance. I am also not sure if we first leave experimental status for UCOH, and then introduce 4-byte headers under a new flag (or no flag?), or if we first do 4-byte headers and only leave experimental status once that is done. The latter sounds more reasonable to me. |
@merykitty I guess we can always use vmovdqu. And in fact that is exactly what we do:
|
@eme64 What I mean here is that |
@merykitty FYI:
The relevant code:
We can see that only PPC and ARM32 have such strict alignment requirements. And it turns out that PPC only needs 4-byte alignment, and ARM32 is fine with 8-byte alignment. So all of our platforms do not necessarily need full vector-width alignment. |
Ah there are some exceptions: x86:
So I suppose some older platforms may be affected, though I have not seen one yet. They would have to be missing the unaligned aarch64:
and
and
and
So yes, some platforms are affected. But they seem to be the exception. |
And again: we have only had |
@rkennke Filed a bug to track this (we may close it as NotAnIssue, but this way people are aware / can find the analysis): |
Thanks! |
All AArch64 implementations work with unaligned vectors – that's in the architecture spec – but some designs thaht were made years ago performed badly. It's not a problem with new designs. |
…xperimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…xperimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…xperimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
…rimental) Fixes: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Fixes: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Follow-up: 44ec501 ("8305895: Implement JEP 450: Compact Object Headers (Experimental)") Follow-up: ff12ff5 ("8340453: C2: Improve encoding of LoadNKlass for compact headers") Link: openjdk#20677 Link: openjdk#22203 Signed-off-by: Bingwu Zhang <[email protected]>
This is the main body of the JEP 450: Compact Object Headers (Experimental).
It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing.
Main changes:
Testing:
(+UseCompactObjectHeaders tests are run with the flag hard-patched into the build, to also catch @flagless tests.)
The below testing has been run many times, but not with this exact base version of the JDK. I want to hold off the full testing until we also have the Tiny Class-Pointers PR lined-up, and test with that.
Progress
Issues
Reviewers
Contributors
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677
$ git checkout pull/20677
Update a local copy of the PR:
$ git checkout pull/20677
$ git pull https://git.openjdk.org/jdk.git pull/20677/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20677
View PR using the GUI difftool:
$ git pr show -t 20677
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20677.diff
Using Webrev
Link to Webrev Comment