Skip to content
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

8228634: [lworld] ciField::will_link() returns incorrect result for the withfield bytecode #301

Closed
wants to merge 2 commits into from

Conversation

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Dec 11, 2020

In GraphBuilder::withfield, ciField::will_link() can return false even if the holder klass is loaded (see bug comments). In that case we should not deoptimize but patch the store instruction that writes the new field value. That is required even if the field offset is known because the field could not be accessible/available and we would need to throw an exception during patching. The load/store instructions emitted by copy_inline_content to initialize the fields of the new inline type buffer copy should never require patching: We know their offsets (because the holder is loaded) and we don't need to check access restrictions.

Unrelated changes:

  • Array loads should not be delayed if the subsequent getfield requires patching (see changes to GraphBuilder::load_indexed)
  • Replaced the WithField and DefaultValue IR nodes by a Deoptimize node
  • Refactoring and removal of dead code

Thanks,
Tobias


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8228634: [lworld] ciField::will_link() returns incorrect result for the withfield bytecode

Reviewers

Download

$ git fetch https://git.openjdk.java.net/valhalla pull/301/head:pull/301
$ git checkout pull/301

@TobiHartmann TobiHartmann marked this pull request as draft Dec 11, 2020
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 11, 2020

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 11, 2020

@TobiHartmann 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:

8228634: [lworld] ciField::will_link() returns incorrect result for the withfield bytecode

Reviewed-by: fparain

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 1 new commit pushed to the lworld branch:

  • 1d85945: 8258026: [lworld] Endless deoptimization at defaultvalue due to unresolved klass

Please see this link for an up-to-date comparison between the source branch of this pull request and the lworld branch.
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 lworld branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Dec 11, 2020
@TobiHartmann TobiHartmann marked this pull request as ready for review Dec 11, 2020
@openjdk openjdk bot added the rfr label Dec 11, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 11, 2020

Webrevs

Copy link
Collaborator

@fparain fparain left a comment

Hi Tobias,

With the discussion we had off-line about nestmates, changes look good to me.

Suggestion for a future improvement: the Deoptimize node in the HIR is a very nice improvement. However, if it looks like a general purpose node in the HIR, the LIRGenerator has a hard coded deopt reason for it: "Reason_unloaded". It would be nice to have a more flexible Deoptmize node where the reason could be specified at the HIR level.

Thank you,

Fred

@TobiHartmann
Copy link
Member Author

@TobiHartmann TobiHartmann commented Dec 14, 2020

Thanks for the review Fred!

Yes, I agree that the Deoptimize node should be more generic. As we've discussed off-thread, we can address this once more reasons for deoptimization need to be supported (probably with the restricted fields prototype).

Thanks,
Tobias

@TobiHartmann
Copy link
Member Author

@TobiHartmann TobiHartmann commented Dec 14, 2020

/integrate

@openjdk openjdk bot closed this Dec 14, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 14, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 14, 2020

@TobiHartmann Since your change was applied there has been 1 commit pushed to the lworld branch:

  • 1d85945: 8258026: [lworld] Endless deoptimization at defaultvalue due to unresolved klass

Your commit was automatically rebased without conflicts.

Pushed as commit 67f86bd.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants