Skip to content
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

8315604: IGV: dump and visualize node bottom and phase types #15881

Closed
wants to merge 12 commits into from

Conversation

robcasloz
Copy link
Contributor

@robcasloz robcasloz commented Sep 22, 2023

This changeset dumps node type information in IGV graphs. Type information includes node bottom types (Node::bottom_type()) and node phase types (GVN, IGVN, CCP) as IGV node properties bottom_type and phase_type. It also adds a filter (Show types) to display type information in the node labels:

igv-with-types-v3

The filter presents a concise version of the complete type information (for example, removing long interface lists from reference types). It shows the phase type of each node, followed by the bottom type (prefixed with B:) if it differs from the phase type (see, for example, node 124 AddI in the picture above) or is the only type available.

On the HotSpot side, the size of the stringStream buffer used to extract type information (and other properties such as dump_spec) is increased from 128 to 512 characters to prevent truncations. The additional type information and the buffer size change increase the size of the dumped graphs by around 10% on average.

Thanks to Christian Hagedorn and Toby Holenstein for providing feedback on earlier versions of the changeset.

Testing

  • tier1-3 (windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64; release and debug mode)
  • tested that thousands of graphs are correctly opened and visualized with IGV using different filter configurations
  • tested that graphs dumped interactively from GDB are correctly opened and visualized
  • tested that graphs dumped from earlier JVM versions are correctly handled by the new filter

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8315604: IGV: dump and visualize node bottom and phase types (Enhancement - P4)

Reviewers

Contributors

  • Tobias Holenstein <tholenstein@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15881/head:pull/15881
$ git checkout pull/15881

Update a local copy of the PR:
$ git checkout pull/15881
$ git pull https://git.openjdk.org/jdk.git pull/15881/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15881

View PR using the GUI difftool:
$ git pr show -t 15881

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15881.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 22, 2023

👋 Welcome back rcastanedalo! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 22, 2023

@robcasloz The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 22, 2023
@robcasloz robcasloz marked this pull request as ready for review September 22, 2023 08:51
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 22, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 22, 2023

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very nice improvement! The VM changes look good to me.

@openjdk
Copy link

openjdk bot commented Sep 25, 2023

@robcasloz 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:

8315604: IGV: dump and visualize node bottom and phase types

Co-authored-by: Tobias Holenstein <tholenstein@openjdk.org>
Reviewed-by: thartmann, chagedorn, tholenstein

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 340 new commits pushed to the master branch:

  • bd918f4: 8316401: sun/tools/jhsdb/JStackStressTest.java failed with "InternalError: We should have found a thread that owns the anonymous lock"
  • c45308a: 8301327: convert assert to guarantee in Handle_IDiv_Exception
  • bd7bb67: 8317257: RISC-V: llvm build broken
  • 0259da9: 8301686: TLS 1.3 handshake fails if server_name doesn't match resuming session
  • 355811a: 8316559: Refactor some util/Calendar tests to JUnit
  • ecb5e8a: 8317264: Pattern.Bound has static fields that should be static final.
  • f2c221d: 8317119: Remove unused imports in the java.util.stream package
  • 09dad0e: 8313810: BoxLayout uses
    instead of list for layout options
  • 73a47f0: 4622866: javax.swing.text.Document.remove(int, int) has a misleading picture
  • cfcbfc6: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163
  • ... and 330 more: https://git.openjdk.org/jdk/compare/024133b089d911dcc3ea70dfdaa6b150b14a9eb4...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 25, 2023
Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice improvement! Cannot say much about the filter code - maybe someone else should have a look at that as well.

src/hotspot/share/opto/idealGraphPrinter.cpp Outdated Show resolved Hide resolved
@robcasloz
Copy link
Contributor Author

This is a very nice improvement! The VM changes look good to me.

Thanks for reviewing, Tobias!

@tobiasholenstein
Copy link
Member

Thanks for working on this @robcasloz . That’s a feature I was always missing!

Suggestion: I would find it better for the mind to process if the second line has a different font from the first line in a widget. (e.g. different color, like dark gray or italic) What do you think?

E.g. adding the following code in FigureWidget.java

for (int i=1; i<labelWidgets.size(); i++) {
    labelWidgets.get(i).setFont(Diagram.FONT.deriveFont(Font.ITALIC));
    labelWidgets.get(i).setForeground(Color.DARK_GRAY);
}

1_480

@robcasloz
Copy link
Contributor Author

Thanks for working on this @robcasloz . That’s a feature I was always missing!

Suggestion: I would find it better for the mind to process if the second line has a different font from the first line in a widget. (e.g. different color, like dark gray or italic) What do you think?

E.g. adding the following code in FigureWidget.java

for (int i=1; i<labelWidgets.size(); i++) {
    labelWidgets.get(i).setFont(Diagram.FONT.deriveFont(Font.ITALIC));
    labelWidgets.get(i).setForeground(Color.DARK_GRAY);
}

1_480

Great suggestion, done, thanks!

@robcasloz
Copy link
Contributor Author

/contributor add @tobiasholenstein

@openjdk
Copy link

openjdk bot commented Sep 26, 2023

@robcasloz
Contributor Tobias Holenstein <tholenstein@openjdk.org> successfully added.

@robcasloz
Copy link
Contributor Author

The latest commits change the order and syntax used when displaying both types (when they are available and differ from each other) after offline feedback from @chhagedorn and @tobiasholenstein. See the updated pull request description for details. They also improve the display of tuple types and pretty-print inequalities.

@tobiasholenstein could you please review the IGV parts of this change?

Copy link
Member

@tobiasholenstein tobiasholenstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @robcasloz . The code looks good to me!

@robcasloz
Copy link
Contributor Author

Thanks Toby, Christian, and Tobias for reviewing!

@robcasloz
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 2, 2023

Going to push as commit 207819a.
Since your change was applied there have been 352 commits pushed to the master branch:

  • 8fcf70e: 5066247: Refine the spec of equals() and hashCode() for j.text.Format classes
  • 93f662f: 8317335: Build on windows fails after 8316645
  • b8fa6c2: 8316186: RISC-V: Remove PlatformCmpxchg<4>
  • fb055e7: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b
  • 009f5e1: 8317141: Remove unused validIndex method from URLClassPath$JarLoader
  • 47569a2: 8295919: java.security.MessageDigest.isEqual does not adhere to @implNote
  • 5a6aa56: 8303959: tools/jpackage/share/RuntimePackageTest.java fails with java.lang.AssertionError missing files
  • 014c95a: 8317126: Redundant entries in Windows tzmappings file
  • fa0697a: 8316998: Remove redundant type arguments in the java.util.stream package
  • 49376e4: 8316000: File.setExecutable silently fails if file does not exist
  • ... and 342 more: https://git.openjdk.org/jdk/compare/024133b089d911dcc3ea70dfdaa6b150b14a9eb4...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 2, 2023
@openjdk openjdk bot closed this Oct 2, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 2, 2023
@openjdk
Copy link

openjdk bot commented Oct 2, 2023

@robcasloz Pushed as commit 207819a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants