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

8297284: ResolutionErrorTable's key is wrong #11244

Closed
wants to merge 3 commits into from

Conversation

coleenp
Copy link
Contributor

@coleenp coleenp commented Nov 18, 2022

The resolution error table had a trick for the lookup key of adding constant pool index into constant pool address because that key was assumed to be in the range of the constant pool, so unique. For failed indy resolution, we also use the resolution error table and the index is not relative to the constant pool, so the key is potentially not unique. Created a Key class for the table and moved the cpool and index into that. Now the ResolutionErrorEntry just has the messages.

Tested tier1-4.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11244/head:pull/11244
$ git checkout pull/11244

Update a local copy of the PR:
$ git checkout pull/11244
$ git pull https://git.openjdk.org/jdk pull/11244/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11244

View PR using the GUI difftool:
$ git pr show -t 11244

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11244.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 18, 2022

👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into master 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 bot commented Nov 18, 2022

@coleenp The following label will be automatically applied to this pull request:

  • hotspot-runtime

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.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Nov 18, 2022
@coleenp coleenp changed the title ResolutionErrorTable key not right for indy 8297284: ResolutionErrorTable's key is wrong for indy Nov 18, 2022
@coleenp coleenp marked this pull request as ready for review November 21, 2022 13:43
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 21, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 21, 2022

Webrevs

}

static bool equals(const ResolutionErrorKey& l, const ResolutionErrorKey& r) {
return l._cpool == r._cpool && l._index == r._index;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work correctly, but maybe use parentheses here for readability?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok!

Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@coleenp
Copy link
Contributor Author

coleenp commented Nov 21, 2022

Thanks Matias!

@coleenp coleenp changed the title 8297284: ResolutionErrorTable's key is wrong for indy 8297284: ResolutionErrorTable's key is wrong Nov 28, 2022
// This prevents issues where the cpCache index is the same as the constant pool
// index of another entry in the table.
static const int CPCACHE_INDEX_MANGLE_VALUE = 1000000;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need CPCACHE_INDEX_MANGLE_VALUE and encode_cpcache_index(int index)? The comment around that function says that index is negative, so it shouldn't be confused with regular cp indices which are non-negative.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to leave that in so that there's an assert that it's negative first. The whole cpCache index thing is something that @matias9927 is trying to rationalize with his ResolvedIndyInfo array - should we continue to use negative indexes in the bytecode stream or not? We think not so he'll clean this part up, and if we do we'll need some encoding like what's in CPCACHE_INDEX_MANGLE_VALUE. Maybe the mangle value should be negative and he can change his positive indexes to negative to distinguish them from constant pool indexes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to leave that in so that there's an assert that it's negative first. The whole cpCache index thing is something that @matias9927 is trying to rationalize with his ResolvedIndyInfo array - should we continue to use negative indexes in the bytecode stream or not? We think not so he'll clean this part up, and if we do we'll need some encoding like what's in CPCACHE_INDEX_MANGLE_VALUE. Maybe the mangle value should be negative and he can change his positive indexes to negative to distinguish them from constant pool indexes.

OK, we can revisit this later.

@openjdk
Copy link

openjdk bot commented Nov 29, 2022

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

8297284: ResolutionErrorTable's key is wrong

Reviewed-by: matsaave, iklam

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 161 new commits pushed to the master branch:

  • e2d71c0: 8297481: Create a regression test for JDK-4424517
  • f4063a3: 8297210: Add a @sealedGraph tag to selected java.desktop classes
  • 2084451: 8078471: Backspace does not work in JFileChooser with GTK L&F
  • 7af6b4b: 8296012: jshell crashes on mismatched record pattern
  • ae5b1f7: 8297685: Typo in NullPointerException description specified by Locale.lookup
  • 3ce0042: 8297780: Problem list java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java
  • b778cd5: 8295010: Reduce if required in EC limbs operations
  • 54e6d6a: 8293488: Add EOR3 backend rule for aarch64 SHA3 extension
  • 69ede5b: 8293177: Verify version numbers in legal files
  • cd6bebb: 8247645: ChaCha20 intrinsics
  • ... and 151 more: https://git.openjdk.org/jdk/compare/373e52c0ab0d4fd3c6b18e67e0c46d1d1f0ac91e...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 29, 2022
@coleenp
Copy link
Contributor Author

coleenp commented Nov 30, 2022

Thank you Matias and Ioi!
/integrate

@openjdk
Copy link

openjdk bot commented Nov 30, 2022

Going to push as commit 301cf52.
Since your change was applied there have been 180 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 30, 2022
@openjdk openjdk bot closed this Nov 30, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 30, 2022
@openjdk
Copy link

openjdk bot commented Nov 30, 2022

@coleenp Pushed as commit 301cf52.

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

@coleenp coleenp deleted the resolution-table branch November 30, 2022 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants