Mercurial > hg > truffle
comparison graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java @ 5763:a3d71693e0ce
removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
removed VM call for doing bytecode disassembly
added support for explicitly excluding classes from JaCoCo (put '// JaCoCo Exclude' somewhere in the source file)
added node intrinsics to MaterializeNode
added snippets for the UnsignedMath classes
each file opened by CFGPrinter now includes a unique id in its name to avoid a race of multiple threads writing to the same file
the IdealGraphPrinter uses the new BytecodeDisassembler mechanism
teh UnsignedMath class is exclude from JaCoCo processing as it is used in snippets
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 04 Jul 2012 21:57:49 +0200 |
parents | fdf19fa15ce4 |
children | 6a725f3c4bb0 |
comparison
equal
deleted
inserted
replaced
5762:b30cced39597 | 5763:a3d71693e0ce |
---|---|
25 import java.io.*; | 25 import java.io.*; |
26 import java.util.*; | 26 import java.util.*; |
27 import java.util.Map.Entry; | 27 import java.util.Map.Entry; |
28 | 28 |
29 import com.oracle.graal.api.meta.*; | 29 import com.oracle.graal.api.meta.*; |
30 import com.oracle.graal.bytecode.*; | |
31 import com.oracle.graal.compiler.schedule.*; | 30 import com.oracle.graal.compiler.schedule.*; |
32 import com.oracle.graal.graph.*; | 31 import com.oracle.graal.graph.*; |
33 import com.oracle.graal.graph.Node.Verbosity; | 32 import com.oracle.graal.graph.Node.Verbosity; |
34 import com.oracle.graal.graph.NodeClass.NodeClassIterator; | 33 import com.oracle.graal.graph.NodeClass.NodeClassIterator; |
35 import com.oracle.graal.graph.NodeClass.Position; | 34 import com.oracle.graal.graph.NodeClass.Position; |
35 import com.oracle.graal.java.*; | |
36 import com.oracle.graal.lir.cfg.*; | 36 import com.oracle.graal.lir.cfg.*; |
37 import com.oracle.graal.nodes.*; | 37 import com.oracle.graal.nodes.*; |
38 | 38 |
39 /** | 39 /** |
40 * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a | 40 * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a |
55 beginGroup(); | 55 beginGroup(); |
56 beginProperties(); | 56 beginProperties(); |
57 printProperty("name", name); | 57 printProperty("name", name); |
58 endProperties(); | 58 endProperties(); |
59 beginMethod(name, shortName, bci); | 59 beginMethod(name, shortName, bci); |
60 if (method != null) { | 60 if (method != null && method.code() != null) { |
61 beginBytecodes(); | 61 printBytecodes(new BytecodeDisassembler(false).disassemble(method)); |
62 BytecodeStream bytecodes = new BytecodeStream(method.code()); | |
63 while (bytecodes.currentBC() != Bytecodes.END) { | |
64 int startBCI = bytecodes.currentBCI(); | |
65 String mnemonic = Bytecodes.nameOf(bytecodes.currentBC()); | |
66 int[] extra = null; | |
67 if (bytecodes.nextBCI() > startBCI + 1) { | |
68 extra = new int[bytecodes.nextBCI() - (startBCI + 1)]; | |
69 for (int i = 0; i < extra.length; i++) { | |
70 extra[i] = bytecodes.readUByte(startBCI + 1 + i); | |
71 } | |
72 } | |
73 printBytecode(startBCI, mnemonic, extra); | |
74 bytecodes.next(); | |
75 } | |
76 endBytecodes(); | |
77 } | 62 } |
78 endMethod(); | 63 endMethod(); |
79 } | 64 } |
80 | 65 |
81 public void print(Graph graph, String title) { | 66 public void print(Graph graph, String title) { |