-
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
8264732: Clean up LinkResolver::vtable_index_of_interface_method() #3346
8264732: Clean up LinkResolver::vtable_index_of_interface_method() #3346
Conversation
👋 Welcome back vlivanov! A progress list of the required criteria for merging this PR into |
@iwanowww |
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.
Looks good to me.
Lois
@iwanowww 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 18 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 |
@@ -728,7 +728,7 @@ C2V_END | |||
|
|||
C2V_VMENTRY_0(jint, getVtableIndexForInterfaceMethod, (JNIEnv* env, jobject, jobject jvmci_type, jobject jvmci_method)) | |||
Klass* klass = JVMCIENV->asKlass(jvmci_type); | |||
methodHandle method(THREAD, JVMCIENV->asMethod(jvmci_method)); | |||
Method* method = JVMCIENV->asMethod(jvmci_method); |
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.
The reason that resolved_method was a methodHandle is in case of redefinition, we need to know if code is referring to this version of the method so that it's not deallocated. It's enough for one of the callers to create a methodHandle but passing the methodHandle will guarantee it. I'm not sure why you needed to make this change.
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 refactored getVtableIndexForInterfaceMethod
and kept the handle in place while dereferencing it when passing into vtable_index_of_interface_method
. Does it look better now?
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.
Ok, this is fine. Be careful if you have new callers for this function.
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.
Seems quite reasonable - though unsure of the motivation.
Do we need a NoSafepointVerifier in LinkResolver::vtable_index_of_interface_method to ensure the raw Method* remains valid?
Thanks,
David
@iwanowww this pull request can not be integrated into git checkout 8264732.vtable_index_of_interface_method
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
Thinking more about it, What do you think about leaving |
|
||
// First check in default method array | ||
if (!intf_method->is_abstract() && this->default_methods() != NULL) { | ||
int index = InstanceKlass::find_method_index(this->default_methods(), |
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.
Yes, please, this looks a lot better! Then linkResolver can deal with methodHandle consistently so it doesn't go away with redefinition, and this function is nice here with the other like functions.
It doesn't need InstanceKlass:: before find_method_index, or the this->'s.
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.
It doesn't need InstanceKlass:: before find_method_index, or the this->'s.
Fixed. It looked clearer to me to explicitly refer to this
.
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.
Refactoring looks good.
I second Coleen's comment about unnecessary classname qualification and use of this->
Thanks,
David
Thanks for the reviews, Lois, Coleen, and David. |
/integrate |
@iwanowww Since your change was applied there have been 28 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 33fa855. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Turn
resolved_method
parameter into rawMethod*
.Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3346/head:pull/3346
$ git checkout pull/3346
Update a local copy of the PR:
$ git checkout pull/3346
$ git pull https://git.openjdk.java.net/jdk pull/3346/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3346
View PR using the GUI difftool:
$ git pr show -t 3346
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3346.diff