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
8299730: Add trivial call linker option #771
8299730: Add trivial call linker option #771
Conversation
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
3855992
to
638f710
Compare
638f710
to
83e759e
Compare
Webrevs
|
Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore@users.noreply.github.com>
@JornVernee 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 118 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 |
Forgot to add the benchmarks before. Added them now. Some numbers on my machine:
The difference seems to be very minimal on my machine, but others have reported more significant improvements. This could still be improved by intrinsifying in C2 maybe, but not sure by how much, and if that's worth the complexity. |
Nice! |
The new test that tests that we can't do an upcall when a function is trivial was failing on the |
I agree - trivial should be best effort - perhaps something worth a note in the javadoc (e.g. that some linker implementation might reserve a right to refuse? Or even throw UOE when creating the unsupported option?) |
Note that the current javadoc already hints that the implementation may (or may not) apply additional optimizations:
I don't think throwing a UOE is necessary in this case. (Though in general I think a particular linker implementation refusing a linker option is something that we want to allow, if only just in case) |
/integrate |
Going to push as commit 200a116.
Your commit was automatically rebased without conflicts. |
@JornVernee Pushed as commit 200a116. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Add a trivial call linker option. This option acts as a hint to the runtime which indicates that a downcall is extremely short live (comparable to calling an empty function), and does not call back into Java.
Some implementations (like ours) might use this information to apply additional optimizations that are only applicable to trivial functions (dropping thread state transitions).
Note that the VM code diff looks kind of messy, but I essentially just put 3
if
statements around the code that deals with the thread state transitions before and after the call. This also required moving the declarations of theLabel
s around though (so they are accessible from both ifs on the return path), which is probably messing up the diff view.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/panama-foreign pull/771/head:pull/771
$ git checkout pull/771
Update a local copy of the PR:
$ git checkout pull/771
$ git pull https://git.openjdk.org/panama-foreign pull/771/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 771
View PR using the GUI difftool:
$ git pr show -t 771
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/panama-foreign/pull/771.diff