-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8314078: HotSpotConstantPool.lookupField() asserts due to field changes in ConstantPool.cpp #15237
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
8314078: HotSpotConstantPool.lookupField() asserts due to field changes in ConstantPool.cpp #15237
Conversation
…es in ConstantPool.cpp
…nges in this PR are consistent
|
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
|
/label add hotspot-runtime |
|
@iklam |
Webrevs
|
|
Thanks for doing this Ioi. In this PR or the follow-up renaming RFE, could you please add a "decoder ring" comment to the javadoc for ConstantPool. An incomplete example: |
|
@iklam 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 27 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 |
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 looks good. I don't know how we missed it so thank you for fixing this. Thank you for fixing the variable names, which could have been part of the confusion.
Hi Doug, thanks for the review. I added the comments into ConstantPool.java. I omitted cpci as it's not part of the API. I hope to add more details in the comments when fixing the other incorrectly named variables in JDK-8314172 |
|
Going to push as commit 911d1db.
Your commit was automatically rebased without conflicts. |
| final int index = rawIndexToConstantPoolCacheIndex(cpi, opcode); | ||
| final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index, opcode); | ||
| public JavaField lookupField(int rawIndex, ResolvedJavaMethod method, int opcode) { | ||
| final int cpi = compilerToVM().decodeFieldIndexToCPIndex(this, rawIndex); |
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 have the new warning here: cpi is not used. I guess it is correct, seeing how methods are accepting rawIndex now, right?
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.
You're right. cpi is not used, as the next line uses rawIndex to obtain information about the field bytecode.
final int nameAndTypeIndex = getNameAndTypeRefIndexAt(rawIndex, opcode);
I'll remove the cpi line in my next JVMCI cleanup PR.
This PR updates Java code in JVMCI to match the C code changes in JDK-8301996 that modified the constant pool layout. Essentially, the indices after a getfield/putfield/getstatic/putstatic bytecode is no longer a CpCacheIndex, but an index for
ConstantPool::resolved_field_entry_at(int field_index).The assertion (and subsequent crash) happen only in debug builds. Out of pure luck, in product build JVMCI produces the correct output even after JDK-8301996, although the code was doing the wrong thing.
This PR has (so far) two commits:
rawIndexthat follows a field bytecode.cpineeds to be changed torawIndexto reflect the correct type of the index.To help reviewing, I am limiting the renaming to just those affected by the field changes (without the renames, it's hard to validate that I am actually doing the right thing).
There are still some cases of
cpithat need to be changed torawIndex. I will fix those in a separate RFE. E.g. in ConstantPool.java:Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15237/head:pull/15237$ git checkout pull/15237Update a local copy of the PR:
$ git checkout pull/15237$ git pull https://git.openjdk.org/jdk.git pull/15237/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15237View PR using the GUI difftool:
$ git pr show -t 15237Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15237.diff
Webrev
Link to Webrev Comment