Skip to content

Conversation

@robcasloz
Copy link
Contributor

@robcasloz robcasloz commented Oct 24, 2025

This changeset makes it easier to trace C2's individual bytecode parsing steps to the input class files and the output of type flow analysis, by:

  1. dumping the map node (holding the JVM state), basic block (reverse post-order index), and method name as properties of the graph that C2 dumps after each parsed bytecode at IGV dump level 6;

  2. appending this information to the graph name (hence generalizing JDK-8356779); and

  3. making the graph name suffix configurable via Options -> Graph Name Suffix. By default, it appends (map: [map], block #[block] at [method]) to the names of graphs containing these properties (bytecode parsing dumps), and nothing otherwise.

Here are the Outline and Properties windows for

$ java -Xbatch -XX:CompileOnly=java.lang.String::charAt -XX:PrintIdealGraphLevel=6

before (left) and after (right) the changeset:

before-after

Please let me know if there are other bytecode parsing graph properties that could be useful to dump, and whether you think the default graph name suffix contains the right amount of information.

Testing

  • tier1.
  • Tested automatically that dumping thousands of graphs does not trigger any assertion failure on HotSpot or IGV.

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-8370569: IGV: dump more graph properties at bytecode parsing (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27975

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 24, 2025

👋 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 Oct 24, 2025

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

8370569: IGV: dump more graph properties at bytecode parsing

Reviewed-by: chagedorn, snatarajan

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

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 hotspot-compiler hotspot-compiler-dev@openjdk.org label Oct 24, 2025
@openjdk
Copy link

openjdk bot commented Oct 24, 2025

@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.

@robcasloz robcasloz marked this pull request as ready for review October 24, 2025 12:29
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 24, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 24, 2025

Webrevs

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.

Nice improvement! I tried your patch out and I sometimes see a missing index for map. That might be expected but when looking at it, it rather suggests that something is off. If there is no map, maybe we can use "none" or completely remove the "map" entry for that graph.

Image

Comment on lines 166 to 168
private void graphNameSuffixFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_graphNameSuffixFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_graphNameSuffixFieldActionPerformed
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain why this nop-action is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. It is not needed, just the result of some spurious clicking on the NetBeans form editor that resulted in that code being auto-generated. I removed the action declaration and other GUI properties of the new text field to align the generated code with that of the other text fields in the Options form (commit 4123bb0).

Copy link
Member

Choose a reason for hiding this comment

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

Can this method then be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, sorry, removed now (commit 8da5897). I was expecting that NetBeans would detect it as dead and remove it automagically when re-generating ViewPanel.java from ViewPanel.form, but forgot to check.

Copy link
Member

Choose a reason for hiding this comment

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

No worries! Thanks for cleaning it up, it looks good to me now 👍

@robcasloz
Copy link
Contributor Author

I tried your patch out and I sometimes see a missing index for map. That might be expected but when looking at it, it rather suggests that something is off. If there is no map, maybe we can use "none" or completely remove the "map" entry for that graph.

It is expected, but I agree that the presentation could be improved. I went with printing - if there is no map, for compactness (commit 050fe0d), but I am OK with changing it to none if you think that is better.

@robcasloz
Copy link
Contributor Author

Thanks for the review, Christian! I just addressed your comments, please let me know what you think about the new version.

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.

Looks good, thanks!

Comment on lines 166 to 168
private void graphNameSuffixFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_graphNameSuffixFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_graphNameSuffixFieldActionPerformed
Copy link
Member

Choose a reason for hiding this comment

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

Can this method then be removed?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 27, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 27, 2025
@robcasloz robcasloz requested a review from chhagedorn October 27, 2025 15:51
Copy link
Contributor

@sarannat sarannat left a comment

Choose a reason for hiding this comment

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

Thank you for the improvement. I have tested some random programs and the changes look good.

@robcasloz
Copy link
Contributor Author

Thank you for the improvement. I have tested some random programs and the changes look good.

Thanks for reviewing, Saranya! @chhagedorn I removed the dead code you referred to, are you happy with the current version?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 28, 2025
@robcasloz
Copy link
Contributor Author

Thanks for reviewing, Christian!

@robcasloz
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 28, 2025

Going to push as commit 5c5367c.
Since your change was applied there have been 174 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 28, 2025

@robcasloz Pushed as commit 5c5367c.

💡 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.

3 participants