-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8302335: IGV: Bytecode not showing #12537
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 tholenstein! A progress list of the required criteria for merging this PR into |
@tobiasholenstein 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.
Good catch! The issue with the more liberal matching of bytecodes proposed in this PR is that bytecode attributes are now also matched and treated as bytecodes, see e.g. the second last line in this screenshot:
Somewhere between JDK 20 b17 and JDK 20 b25 (most likely with the integration of JDK-8292699), the indentation in bytecode dumps produced by BytecodeTracer::print_method_codes()
changed. The change introduced indentation for the bytecodes but did not update the indentation of their attributes, which I guess was unintended. Here is an example:
Before:
0 nofast_aload_0
1 invokevirtual 478 <java/lang/String.isLatin1()Z>
0 bci: 1 VirtualCallData count(5119) nonprofiled_count(0) entries(0)
After:
0 nofast_aload_0
1 invokevirtual 478 <java/lang/String.isLatin1()Z>
0 bci: 1 VirtualCallData count(5119) nonprofiled_count(0) entries(0)
I am not sure about what is the best solution to this, but ideally we would want to support the old and current indentation, and probably also fix and support the proper indentation of bytecode attributes in BytecodeTracer::print_method_codes()
.
A possible solution from IGV side is to rule out attribute lines, e.g. likes starting with a number then the bci
keyword such as
56 bci: 4 BranchData taken(0) displacement(48)
or lines starting with non-digits such as
not taken(5119)
And so on. Another possible solution is to actually parse these attributes and display them somehow (e.g. as bytecode sub-items), since they actually convey useful information. What do you think?
You are right. I changed it such that we now support the old and new format. Now we just skip lines with the |
Those are methoddata. Should we add a leading character such as '#' to distinct them from real bytecode? I believe that would simplify matching logic in IGV. |
This would require a VM change for a printing flag. E.g. |
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 otherwise!
String[] strings = text.split("\n"); | ||
int oldBci = -1; | ||
for (String s : strings) { | ||
if (s.startsWith(" ")) { | ||
if (isInfo.matcher(s).matches()) { | ||
// indented lines are extra textual information |
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.
Maybe update this comment?
@tobiasholenstein 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 493 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 |
Thanks for catching that! |
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!
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.
LGTM. I am not a reviewer.
thanks @robcasloz , @TobiHartmann and @navyxliu for the reviews! /integrate |
Going to push as commit 57c9bc3.
Your commit was automatically rebased without conflicts. |
@tobiasholenstein Pushed as commit 57c9bc3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Currently, IGV does not show the bytecode of a graph in the "Bytecode" window although the bytecode is present in the XML file.
Solution
Following is the
<bytecodes>
block of the XML fileThe problem was that during paring IGV skipped all lines that started with an empty space: This just skipped all bytecodes. We only want to skip bytecode like
0 bci: 6 BranchData taken(0) displacement(112) not taken(0)
. Meaning: whitespace - number - exactly two white spaces - and then arbitrary text.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12537/head:pull/12537
$ git checkout pull/12537
Update a local copy of the PR:
$ git checkout pull/12537
$ git pull https://git.openjdk.org/jdk pull/12537/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12537
View PR using the GUI difftool:
$ git pr show -t 12537
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12537.diff