-
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
8291003: ARM32: constant_table.size assertion #9672
8291003: ARM32: constant_table.size assertion #9672
Conversation
👋 Welcome back bulasevich! A progress list of the required criteria for merging this PR into |
@bulasevich The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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 is equivalent to the following, right?
int consts_size = consts_section->align_at_start(consts_section->size(), CodeBuffer::SECT_INSTS);
In fact, we can make it better by doing e.g.:
diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad
index a99d8599cd3..c8e4b482778 100644
--- a/src/hotspot/cpu/arm/arm.ad
+++ b/src/hotspot/cpu/arm/arm.ad
@@ -236,7 +236,8 @@ void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
Register r = as_Register(ra_->get_encode(this));
CodeSection* consts_section = __ code()->consts();
- int consts_size = consts_section->align_at_start(consts_section->size());
+ // constants section size is aligned according to the align_at_start settings of the next section
+ int consts_size = CodeSection::align_at_start(consts_section->size(), CodeBuffer::SECT_INSTS);
assert(constant_table.size() == consts_size, "must be: %d == %d", constant_table.size(), consts_size);
// Materialize the constant table base.
diff --git a/src/hotspot/share/asm/codeBuffer.hpp b/src/hotspot/share/asm/codeBuffer.hpp
index e96f9c07e76..4cad3b4d30e 100644
--- a/src/hotspot/share/asm/codeBuffer.hpp
+++ b/src/hotspot/share/asm/codeBuffer.hpp
@@ -261,12 +261,12 @@ class CodeSection {
// Slop between sections, used only when allocating temporary BufferBlob buffers.
static csize_t end_slop() { return MAX2((int)sizeof(jdouble), (int)CodeEntryAlignment); }
- csize_t align_at_start(csize_t off, int section) const {
+ static csize_t align_at_start(csize_t off, int section) {
return (csize_t) align_up(off, alignment(section));
}
csize_t align_at_start(csize_t off) const {
- return (csize_t) align_up(off, alignment(_index));
+ return align_at_start(off, _index);
}
// Ensure there's enough space left in the current section.
Yes. I like your change in codeBuffer.hpp. Though your change in arm.ad brings a little bit too much details. And mine is shorter :) What do you think?
|
What confused me is calling |
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 is fine as well, but consider making it a bit cleaner, as discussed.
@bulasevich 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 292 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 |
I applied the changes to make it a bit cleaner. Thank you! |
/integrate |
Going to push as commit 18cd16d.
Your commit was automatically rebased without conflicts. |
@bulasevich Pushed as commit 18cd16d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
@@ -236,7 +236,8 @@ void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { | |||
|
|||
Register r = as_Register(ra_->get_encode(this)); | |||
CodeSection* consts_section = __ code()->consts(); | |||
int consts_size = consts_section->align_at_start(consts_section->size()); |
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.
-
int consts_size = consts_section->align_at_start(consts_section->size());
I have no idea what that means and:
- // constants section size is aligned according to the align_at_start settings of the next section
And it is: int consts_size = CodeSection::align_at_Start(consts_section->size(), CodeBuffer::SECT_INSTS);
Still no idea.
This change fixes assertion condition as per the recent JDK-8287373 change: the size of constants section is aligned up according to the settings of the next section (instructions section).
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9672/head:pull/9672
$ git checkout pull/9672
Update a local copy of the PR:
$ git checkout pull/9672
$ git pull https://git.openjdk.org/jdk pull/9672/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9672
View PR using the GUI difftool:
$ git pr show -t 9672
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9672.diff