-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371178: Preserve fast version of getfield and putfield in AOTCache #28121
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
8371178: Preserve fast version of getfield and putfield in AOTCache #28121
Conversation
Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
|
👋 Welcome back asmehra! A progress list of the required criteria for merging this PR into |
|
@ashu-mehra 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 219 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 |
|
@ashu-mehra 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
|
|
For the record, I tried to preserve |
| switch(rfe->tos_state()) { | ||
| case btos: | ||
| // fallthrough | ||
| case ztos: | ||
| new_code = Bytecodes::_fast_bgetfield; | ||
| break; |
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.
Why is this switch block necessary? Is it possible for new_code to be different than *bcs.bcp()? If not, it might be easier to initialize new_code to Bytecodes::_illegal and then do the rewriting only if new_code has been updated.
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.
Why is this switch block necessary? Is it possible for new_code to be different than *bcs.bcp()?
During preimage dumping all the fast bytecodes will be converted to nofast version because the CP entries are not resolved. So in the assembly phase *bcs.bcp() would be nofast version. If the CP entry is resolved, we can convert it to fast version. And we determine the type of the fast version using tos_state of the resolved field entry. So the new_code will be different than the *bcs.bcp() in the assembly phase.
They may be same when dumping dynamic archives, but not when dumping static archive or the final AOTCache.
Does that help?
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.
I see. Could you add a comment? Maybe the code should be reformatted like this to make it easier to navigate?
case ftos: new_code = Bytecodes::_fast_fgetfield; break;
case dtos: new_code = Bytecodes::_fast_dgetfield; break;
default: ShouldNotReachHere();
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.
Done
| case Bytecodes::_aload_0: | ||
| new_code = Bytecodes::_nofast_aload_0; |
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.
Maybe add a comment here that _fast_Xaccess_0 bytecodes will be reverted?
| switch(rfe->tos_state()) { | ||
| case btos: | ||
| // fallthrough | ||
| case ztos: | ||
| new_code = Bytecodes::_fast_bgetfield; | ||
| break; |
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.
I see. Could you add a comment? Maybe the code should be reformatted like this to make it easier to navigate?
case ftos: new_code = Bytecodes::_fast_fgetfield; break;
case dtos: new_code = Bytecodes::_fast_dgetfield; break;
default: ShouldNotReachHere();
| #ifdef ASSERT | ||
| if (CDSConfig::is_dumping_preimage_static_archive()) { | ||
| assert(!is_resolved, "preimage should not have resolved field references"); | ||
| } | ||
| #endif // ASSERT | ||
| if (is_resolved) { |
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.
I think the above can be simplified:
if (is_resolved) {
assert(!CDSConfig::is_dumping_preimage_static_archive(), "preimage should not have resolved field references");
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.
Done
Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
|
@iklam addressed the review comments in the new commit. I also updated function names to remove "nofast" to better reflect the updates to their functionality. |
|
@adinn thanks for the review. |
iklam
left a comment
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.
LGTM
|
@iklam thanks for the review. |
|
/integrate |
|
Going to push as commit 1357be9.
Your commit was automatically rebased without conflicts. |
|
@ashu-mehra Pushed as commit 1357be9. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Preserve the "fast" version of
getfieldandputfieldbytecodes in the AOTCache during the assembly phase if the constant pool entry referred by the bytecodes is stored in resolved state in the AOTCache.Testing:
Testing with JTREG="AOT_JDK=true" TEST=hotspot_runtime_no_cds passed on x86-64
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28121/head:pull/28121$ git checkout pull/28121Update a local copy of the PR:
$ git checkout pull/28121$ git pull https://git.openjdk.org/jdk.git pull/28121/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28121View PR using the GUI difftool:
$ git pr show -t 28121Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28121.diff
Using Webrev
Link to Webrev Comment