8382490: RISC-V: Clean up redundant restore_locals() in TemplateTable::invokeinterface#30814
8382490: RISC-V: Clean up redundant restore_locals() in TemplateTable::invokeinterface#30814zifeihan wants to merge 1 commit intoopenjdk:masterfrom
Conversation
…::invokeinterface
|
👋 Welcome back gcao! A progress list of the required criteria for merging this PR into |
|
@zifeihan 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 33 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@RealFYang, @DingliZhang) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
You appear to have used a generative AI tool to create this PR. This violates the OpenJDK AI Policy (https://openjdk.org/legal/ai). Please close this PR and open a new PR that does not contain any AI-generated content. |
Summary
Remove redundant
restore_locals()calls inTemplateTable::invokeinterface()on AArch64 and RISC-V architectures. On x86, this call is necessary because the implementation explicitly usesrlocals(r14) as a temporary register throughout the invokeinterface handler, modifying it in multiple code paths. However, on AArch64 and RISC-V, the locals register (rlocals/xlocals) remains untouched throughout the entire invokeinterface execution, making the restore call redundant.Problem
In
templateTable_riscv.cpp, theinvokeinterface()bytecode handler contains arestore_locals()call at the
notVFinallabel that is never needed because no preceding code path modifies the locals register.Code Flow Analysis
Testing
tier1 tests on SOPHON SG2042 (fastdebug)
I confirm that I make this contribution in accordance with the OpenJDK Interim AI Policy.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30814/head:pull/30814$ git checkout pull/30814Update a local copy of the PR:
$ git checkout pull/30814$ git pull https://git.openjdk.org/jdk.git pull/30814/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30814View PR using the GUI difftool:
$ git pr show -t 30814Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30814.diff
Using Webrev
Link to Webrev Comment