-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8266609: AArch64: include FP/LR space in LIR_Assembler::initial_frame_size_in_bytes() #3898
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
…_size_in_bytes() LIR_Assembler::initial_frame_size_in_bytes() returns the frame size without the additional 2*wordSize needed to store FP/LR (i.e. just the space required for the C1 locals). When we pass this value to MacroAssembler build_frame and remove_frame we need to remember to add back the 2*wordSize. This patch changes initial_frame_size_in_bytes() to return the full frame size including the space for FP/LR. The PPC and S390 ports already do this, and it also matches the behaviour of C->output()->frame_size_in_bytes() in C2. This change may seem a bit trivial in mainline but the Valhalla lworld branch makes more calls to build_frame/remove_frame in C1 and keeping track of whether "framesize" is with or without FP/LR quickly becomes confusing. Tested tier1 on AArch64. The only use of this function is as input to C1_MacroAssembler build_frame() and remove_frame() so seems safe.
|
👋 Welcome back ngasson! A progress list of the required criteria for merging this PR into |
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.
This calculation is the same as x86. Can you explain why it has to be changed on AArch64, but should not be changed on x86?
|
|
||
| // subtract two words to account for return address and link | ||
| return (frame_map()->framesize() - (2*VMRegImpl::slots_per_word)) * VMRegImpl::stack_slot_size; | ||
| return in_bytes(frame_map()->framesize_in_bytes()); |
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.
Umm, really? framesize_in_bytes() returns a value that has to be converted to bytes?
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.
framesize_in_bytes() returns a struct ByteSize that needs to be converted to an int with in_bytes(). The extra _in_bytes seems a bit redundant but it's not my name :-)
On AArch64 |
OK, makes snse. |
|
@nick-arm 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 |
|
/integrate |
|
@nick-arm Since your change was applied there have been 20 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 71b8ad4. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
LIR_Assembler::initial_frame_size_in_bytes() returns the frame size
without the additional 2*wordSize needed to store FP/LR (i.e. just the
space required for the C1 locals). When we pass this value to
MacroAssembler build_frame and remove_frame we need to remember to add
back the 2*wordSize. This patch changes initial_frame_size_in_bytes()
to return the full frame size including the space for FP/LR. The PPC
and S390 ports already do this, and it also matches the behaviour of
C->output()->frame_size_in_bytes() in C2.
This change may seem a bit trivial in mainline but the Valhalla lworld
branch makes more calls to build_frame/remove_frame in C1 and keeping
track of whether "framesize" is with or without FP/LR quickly becomes
confusing.
Tested tier1 on AArch64. The only use of this function is as input to
C1_MacroAssembler build_frame() and remove_frame() so seems safe.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3898/head:pull/3898$ git checkout pull/3898Update a local copy of the PR:
$ git checkout pull/3898$ git pull https://git.openjdk.java.net/jdk pull/3898/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3898View PR using the GUI difftool:
$ git pr show -t 3898Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3898.diff