-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8357568: IGV: Show NULL and numbers up to 4 characters in "Condense graph" filter #25393
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 chagedorn! A progress list of the required criteria for merging this PR into |
@chhagedorn 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 80 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 |
@chhagedorn The following label will be automatically applied to this pull request:
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. |
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.
That is a nice convenience. Thank you for the improvement.
It looks good to me 🙂
Thanks Manuel for your review! As suggested, I also removed the limit for parameters which cannot exceed 255 which is more than 4 characters (e.g. |
@@ -676,7 +672,11 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) { | |||
} else if (t->base() == Type::Return_Address) { | |||
print_prop(short_name, "RA"); | |||
} else if (t->base() == Type::AnyPtr) { | |||
print_prop(short_name, "P"); | |||
if (t->is_ptr()->ptr() == TypePtr::Null) { | |||
print_prop(short_name, "NULL"); |
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'm surprised this doesn't trip over sources/TestNoNULL.java.
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.
Actually it does, see failures in github actions testing:
Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Test found 1 usages of 'NULL' in source files. See errors above.
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.
Interesting! You're right. I haven't checked the testing results, yet. Should we just change to Null
or make an exclusion in TestNoNULL
?
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 don't think this should be given an exclusion in TestNoNULL.
If the printed name is supposed to be related to the compiler object TypePtr::Null
then I suggest it should
be "Null". If it's supposed to be related to the Java null value, then "null" seems appropriate. And in the
diagram in the PR intro I see things printed as "NotNull" which might argue for "Null".
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 guess Null
is fine then. I only chose NULL
to be in line with the other capitalized letters shown in IGV in the condensed view.
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 otherwise.
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 like it.
// max. 2 chars allowed | ||
if (value >= -9 && value <= 99) { | ||
// Only use up to 4 chars and fall back to a generic "L" to keep it short. | ||
if (value >= -999 && value <= 9999) { |
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.
Just for the sake of saying something, can we somewhat factor this test? And ideally, it could be marginally nicer, if I want to see 6 chars, to just replace a 4 into a 6 and it'd work magically. But I don't really see a way beside length(to_string(value)) <= max_length, and it's not really efficient so... If you have a brilliant idea, good. Otherwise, feel free to ignore: changing it as it is now is easy too.
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 point! I think we can directly check how many chars are written with snprintf_checked
and use that as an indicator. I pushed an update.
Pushed an update to use "Null", an update to count the number of chars written as suggested by @marc-chevalier, and also added a missing case when we just have
somewhere and having narrow oops. We currently miss this because we would have |
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.
Thanks @mhaessig, @marc-chevalier and @TobiHartmann for your reviews! |
/integrate |
Going to push as commit 99f33b4.
Your commit was automatically rebased without conflicts. |
@chhagedorn Pushed as commit 99f33b4. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
When using the "Condense graph" filter in IGV, it would be useful to show
NULL
and numbers wider than 2 characters instead ofP
andI/L
(fallback for larger numbers), respectively. There is a comment inidealGrapPrinter.cpp
which says that maximally 2 chars are allowed for numbers:jdk/src/hotspot/share/opto/idealGraphPrinter.cpp
Line 646 in 428d33e
But we already allow larger entries today:

I there propose to use
NULL
and allow up to 4 characters for numbers which could be a good trade-off between shortness and expressiveness. This allows us to quickly see null checks and larger constants.Without patch:

With patch:

Thanks,
Christian
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25393/head:pull/25393
$ git checkout pull/25393
Update a local copy of the PR:
$ git checkout pull/25393
$ git pull https://git.openjdk.org/jdk.git pull/25393/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25393
View PR using the GUI difftool:
$ git pr show -t 25393
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25393.diff
Using Webrev
Link to Webrev Comment