RFR: JDK-8302335: IGV: Bytecode not showing

Tobias Holenstein tholenstein at openjdk.org
Mon Feb 13 15:40:14 UTC 2023


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 file

<bytecodes>
<![CDATA[
   0 iconst_3
   1 istore_1
   2 bipush 9
   4 istore_2
   5 iload_2
   6 ifle 34
  0   bci: 6    BranchData          taken(0) displacement(112) not taken(0)
   9 iconst_2
  10 istore_3
  11 iload_3
  12 iload_2
  13 if_icmpge 28
  32  bci: 13   BranchData          taken(0) displacement(56)  not taken(0)
  16 iload_1
  17 istore_1
  18 iconst_1
  19 iload_3
  20 irem
  21 istore_1
  22 iinc #3 1
  25 goto 11
  64  bci: 25   JumpData            taken(0) displacement(-32)
  28 iinc #2 -1
  31 goto 5
  88  bci: 31   JumpData            taken(0) displacement(-88)
  34 return
]]>
</bytecodes>

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

<img width="283" alt="bytecode" src="https://user-images.githubusercontent.com/71546117/218495199-2b02a79c-3065-404c-af57-3f8a603ac499.png">

-------------

Commit messages:
 - show the bytecode in window

Changes: https://git.openjdk.org/jdk/pull/12537/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12537&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302335
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/12537.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12537/head:pull/12537

PR: https://git.openjdk.org/jdk/pull/12537


More information about the hotspot-compiler-dev mailing list