-
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
8264731: Introduce InstanceKlass::method_at_itable_or_null() #3344
8264731: Introduce InstanceKlass::method_at_itable_or_null() #3344
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.
This is a lot clearer than existing code. I don't see the caller other than mehod_at_itable() though.
} | ||
|
||
Method* InstanceKlass::method_at_itable_or_null(InstanceKlass* holder, int index, bool& itable_entry_found) { | ||
klassItable itable(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.
I think you need a ResourceMark before 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.
Can you elaborate, please, why you think so?
I don't see anything in klassItable
which may allocate in the resource arena.
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.
oh, never mind. Somebody fixed this a long time ago.
@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 51 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.
Hi Vladimir,
Seems okay in principle. I assume more callers of the new API are in the pipeline?
I have one suggested changed that would have made the code much much clearer to me.
Thanks,
David
|
||
for (int cnt = 0 ; ; cnt ++, ioe ++) { | ||
Method* InstanceKlass::method_at_itable(InstanceKlass* holder, int index, TRAPS) { | ||
bool itable_entry_found; // out parameter |
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 was very confused about the logic in this code until I realized that itable_entry_found is actually an indicator as to whether or not the current class implements the interface represented by holder, and not an indicator of whether or not a method was found. It would be much clearer to me if this variable were renamed something like implements_interface.
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.
Agree. Fixed.
Yes, the plan is to use it in CHA ( |
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.
Update looks good - thanks - but I'd like to see it extend a little further.
Thanks,
David
} | ||
} | ||
|
||
Method* InstanceKlass::method_at_itable_or_null(InstanceKlass* holder, int index, bool& itable_entry_found) { |
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 change to use implements_interface applies in here too. Thanks.
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.
Sure, fixed.
Thanks for the reviews, Coleen and David. |
/integrate |
@iwanowww Since your change was applied there have been 51 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 6e2b82a. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Introduce
InstanceKlass::method_at_itable_or_null()
- a non-throwing variant ofInstanceKlass::method_at_itable()
that implements interface method selection.As a cleanup, rewrite
InstanceKlass::method_at_itable()
on top ofInstanceKlass::method_at_itable_or_null()
.Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3344/head:pull/3344
$ git checkout pull/3344
Update a local copy of the PR:
$ git checkout pull/3344
$ git pull https://git.openjdk.java.net/jdk pull/3344/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3344
View PR using the GUI difftool:
$ git pr show -t 3344
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3344.diff