-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8272573: Redundant unique_concrete_method_4 dependencies #5141
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
Conversation
👋 Welcome back vlivanov! A progress list of the required criteria for merging this PR into |
Webrevs
|
if (note_dep_seen(dept, x0) && note_dep_seen(dept, x1)) { | ||
if (note_dep_seen(dept, x0)) { |
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.
Why x0
is special in all these cases?
Should we do ||
instead?
if (note_dep_seen(dept, x0) || note_dep_seen(dept, x1)) {
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's just a fast path approximate check which guards linear search over recorded dependencies.
note_dep_seen(dept, x0) == false
says that such a dependency argument hasn't been seen before, but note_dep_seen(dept, x0) == true
requires a search over recorded dependencies to prove the argument is in the right position.
Another way to fix it is to perform all the queries beforehand:
bool dep_seen_x0 = note_dep_seen(dept, x0);
bool dep_seen_x1 = note_dep_seen(dept, x1);
if (dep_seen_x0 && dep_seen_x1) {
...
}
It should dramatically reduce the rate of false positives.
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.
Pushed the implementation which checks all the arguments. Let me know what you prefer.
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, I like it.
@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 12 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 |
On second thought, I don't get how it fixes the issue. Can you explain why it reduce false positive? |
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.
Good catch! Looks good to me.
Yes, and that's the crucial difference which fixes the problem. The bug stems from the peculiarities of Consider the original code:
When a fresh assertion is added, it records only Unconditionally running
Checking both arguments filters out cases when second argument differs thus reducing the chances linear scan is performed. |
Perfect! Thank you for explanation. |
Thanks for the reviews, Vladimir and Tobias. /integrate |
Going to push as commit 96107e3.
Your commit was automatically rebased without conflicts. |
Equivalence checks in
Dependencies::assert_common_4()
are too strong which leads tounique_concrete_method_4
dependencies being repeatedly recorded and duplicating nmethod dependencies registered.The underlying problem is
note_dep_seen()
mutates internal bitmap, but the nested checks fail fast.So, multiple requests are required to populate the bit-map for all the arguments in order to make the detection of duplicate assertions work. And it leads to duplicate dependencies registered.
It turns out
call_site_target_value
is also affected in a similar manner (seeDependencies::assert_common_2
for dependencies without explicit context argument), so I fix it along the way.Testing: hs-tier1 - hs-tier6
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5141/head:pull/5141
$ git checkout pull/5141
Update a local copy of the PR:
$ git checkout pull/5141
$ git pull https://git.openjdk.java.net/jdk pull/5141/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5141
View PR using the GUI difftool:
$ git pr show -t 5141
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5141.diff