annotate graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java @ 5814:d241f8b2e6f9

Adapt the coloring filter for binary dumped graphs Update no framestate filter to also remove virtual nodes Improve binary serialization of fields and methods Made sure xml serialzer still works for dumping arrays in properties Added some nameTemplates Improved Name templates to optionaly use a short version of the elements Factored away elementType between NewPrimitiveArrayNode and NewObjectArrayNode into NewArrayNode restored Begin/End nodes shortNames
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 11 Jul 2012 14:13:38 +0200
parents 6a725f3c4bb0
children 272f9da7ce78
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.printer;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.io.*;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26 import java.util.*;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27 import java.util.Map.Entry;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5061
diff changeset
29 import com.oracle.graal.api.meta.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
30 import com.oracle.graal.compiler.schedule.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
31 import com.oracle.graal.graph.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
32 import com.oracle.graal.graph.Node.Verbosity;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
33 import com.oracle.graal.graph.NodeClass.NodeClassIterator;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
34 import com.oracle.graal.graph.NodeClass.Position;
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5568
diff changeset
35 import com.oracle.graal.java.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
36 import com.oracle.graal.lir.cfg.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
37 import com.oracle.graal.nodes.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 * href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 */
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
43 class IdealGraphPrinter extends BasicIdealGraphPrinter {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 * Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 public IdealGraphPrinter(OutputStream stream) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
48 super(stream);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 * Starts a new group of graphs with the given name, short name and method byte code index (BCI) as properties.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 */
5541
b4c406861c33 More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
54 public void beginGroup(String name, String shortName, ResolvedJavaMethod method, int bci) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
55 beginGroup();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
56 beginProperties();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
57 printProperty("name", name);
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
58 endProperties();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
59 beginMethod(name, shortName, bci);
5763
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5568
diff changeset
60 if (method != null && method.code() != null) {
a3d71693e0ce removed bytecode disassembly from CodeCacheRuntime into separate BytecodeDisassembler class
Doug Simon <doug.simon@oracle.com>
parents: 5568
diff changeset
61 printBytecodes(new BytecodeDisassembler(false).disassemble(method));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
63 endMethod();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
66 public void print(Graph graph, String title) {
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
67 print(graph, title, null);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 * Prints an entire {@link Graph} with the specified title, optionally using short names for nodes.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 */
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
73 public void print(Graph graph, String title, SchedulePhase predefinedSchedule) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
74 beginGraph(title);
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
75 Set<Node> noBlockNodes = new HashSet<>();
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
76 SchedulePhase schedule = predefinedSchedule;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 if (schedule == null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 try {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
79 schedule = new SchedulePhase();
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
80 schedule.apply((StructuredGraph) graph);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 } catch (Throwable t) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 }
5810
bc237d8b6f99 Add binary graph dumping to compiler (-G:+PrintBinaryGraphs)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5568
diff changeset
84 ControlFlowGraph cfg = schedule == null ? null : schedule.getCFG();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
86 beginNodes();
5810
bc237d8b6f99 Add binary graph dumping to compiler (-G:+PrintBinaryGraphs)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5568
diff changeset
87 List<Edge> edges = printNodes(graph, cfg == null ? null : cfg.getNodeToBlock(), noBlockNodes);
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
88 endNodes();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
90 beginEdges();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 for (Edge edge : edges) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
92 printEdge(edge);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
94 endEdges();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95
5810
bc237d8b6f99 Add binary graph dumping to compiler (-G:+PrintBinaryGraphs)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5568
diff changeset
96 if (cfg != null && cfg.getBlocks() != null) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
97 beginControlFlow();
5810
bc237d8b6f99 Add binary graph dumping to compiler (-G:+PrintBinaryGraphs)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5568
diff changeset
98 for (Block block : cfg.getBlocks()) {
bc237d8b6f99 Add binary graph dumping to compiler (-G:+PrintBinaryGraphs)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5568
diff changeset
99 printBlock(graph, block, cfg.getNodeToBlock());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
100 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
101 printNoBlock(noBlockNodes);
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
102 endControlFlow();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
103 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
104
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
105 endGraph();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
106 flush();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
107 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
108
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
109 private List<Edge> printNodes(Graph graph, NodeMap<Block> nodeToBlock, Set<Node> noBlockNodes) {
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
110 ArrayList<Edge> edges = new ArrayList<>();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
111
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 NodeMap<Set<Entry<String, Integer>>> colors = graph.createNodeMap();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
113 NodeMap<Set<Entry<String, String>>> colorsToString = graph.createNodeMap();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
114 NodeMap<Set<String>> bits = graph.createNodeMap();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
115
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116 for (Node node : graph.getNodes()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
117
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
118 beginNode(node.toString(Verbosity.Id));
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
119 beginProperties();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
120 printProperty("idx", node.toString(Verbosity.Id));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
121
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122 Map<Object, Object> props = node.getDebugProperties();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
123 if (!props.containsKey("name") || props.get("name").toString().trim().length() == 0) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
124 String name = node.toString(Verbosity.Name);
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
125 printProperty("name", name);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
126 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
127 printProperty("class", node.getClass().getSimpleName());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 Block block = nodeToBlock == null ? null : nodeToBlock.get(node);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 if (block != null) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
130 printProperty("block", Integer.toString(block.getId()));
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
131 // if (!(node instanceof PhiNode || node instanceof FrameState || node instanceof LocalNode) && !block.nodes().contains(node)) {
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
132 // printProperty("notInOwnBlock", "true");
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
133 // }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
134 } else {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
135 printProperty("block", "noBlock");
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 noBlockNodes.add(node);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139 Set<Entry<String, Integer>> nodeColors = colors.get(node);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 if (nodeColors != null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141 for (Entry<String, Integer> color : nodeColors) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 String name = color.getKey();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 Integer value = color.getValue();
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
144 printProperty(name, Integer.toString(value));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
145 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
146 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147 Set<Entry<String, String>> nodeColorStrings = colorsToString.get(node);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
148 if (nodeColorStrings != null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
149 for (Entry<String, String> color : nodeColorStrings) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
150 String name = color.getKey();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151 String value = color.getValue();
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
152 printProperty(name, value);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
154 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
155 Set<String> nodeBits = bits.get(node);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
156 if (nodeBits != null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157 for (String bit : nodeBits) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
158 printProperty(bit, "true");
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
159 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160 }
5814
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
161 if (node.getClass() == BeginNode.class) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
162 printProperty("shortName", "B");
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
163 } else if (node.getClass() == EndNode.class) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
164 printProperty("shortName", "E");
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
165 }
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
166 if (node.predecessor() != null) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
167 printProperty("hasPredecessor", "true");
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
168 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
170 for (Entry<Object, Object> entry : props.entrySet()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
171 String key = entry.getKey().toString();
5814
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
172 Object value = entry.getValue();
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
173 String valueString;
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
174 if (value == null) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
175 valueString = "null";
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
176 } else {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
177 Class<?> type = value.getClass();
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
178 if (type.isArray()) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
179 if (!type.getComponentType().isPrimitive()) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
180 valueString = Arrays.toString((Object[]) value);
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
181 } else if (type.getComponentType() == Integer.TYPE) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
182 valueString = Arrays.toString((int[]) value);
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
183 } else if (type.getComponentType() == Double.TYPE) {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
184 valueString = Arrays.toString((double[]) value);
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
185 } else {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
186 valueString = toString();
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
187 }
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
188 } else {
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
189 valueString = value.toString();
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
190 }
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
191 }
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5811
diff changeset
192 printProperty(key, valueString);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
193 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
194
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
195 endProperties();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
196 endNode();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
197
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
198 // successors
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
199 int fromIndex = 0;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
200 NodeClassIterator succIter = node.successors().iterator();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
201 while (succIter.hasNext()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
202 Position position = succIter.nextPosition();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
203 Node successor = node.getNodeClass().get(node, position);
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
204 if (successor != null) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 edges.add(new Edge(node.toString(Verbosity.Id), fromIndex, successor.toString(Verbosity.Id), 0, node.getNodeClass().getName(position)));
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207 fromIndex++;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
208 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210 // inputs
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 int toIndex = 1;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 NodeClassIterator inputIter = node.inputs().iterator();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213 while (inputIter.hasNext()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
214 Position position = inputIter.nextPosition();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215 Node input = node.getNodeClass().get(node, position);
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
216 if (input != null) {
4411
cd2b68ef8e23 cleanup around filter and predicates :
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4327
diff changeset
217 edges.add(new Edge(input.toString(Verbosity.Id), input.successors().count(), node.toString(Verbosity.Id), toIndex, node.getNodeClass().getName(position)));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
218 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
219 toIndex++;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
221 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
222
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
223 return edges;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
224 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226 private void printBlock(Graph graph, Block block, NodeMap<Block> nodeToBlock) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
227 beginBlock(Integer.toString(block.getId()));
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
228 beginSuccessors();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
229 for (Block sux : block.getSuccessors()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
230 if (sux != null) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
231 printSuccessor(Integer.toString(sux.getId()));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
232 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
233 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
234 endSuccessors();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
235 beginBlockNodes();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
236
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
237 Set<Node> nodes = new HashSet<>();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
238
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
239 if (nodeToBlock != null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
240 for (Node n : graph.getNodes()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
241 Block blk = nodeToBlock.get(n);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
242 if (blk == block) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
243 nodes.add(n);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
244 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
245 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
246 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
247
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
248 if (nodes.size() > 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
249 // if this is the first block: add all locals to this block
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
250 if (block.getBeginNode() == ((StructuredGraph) graph).start()) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
251 for (Node node : graph.getNodes()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
252 if (node instanceof LocalNode) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
253 nodes.add(node);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
254 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
255 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
256 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
257
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
258 Set<Node> snapshot = new HashSet<>(nodes);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
259 // add all framestates and phis to their blocks
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4414
diff changeset
260 for (Node node : snapshot) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
261 if (node instanceof StateSplit && ((StateSplit) node).stateAfter() != null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
262 nodes.add(((StateSplit) node).stateAfter());
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
263 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
264 if (node instanceof MergeNode) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
265 for (PhiNode phi : ((MergeNode) node).phis()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
266 nodes.add(phi);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
267 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
268 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
269 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
270
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
271 for (Node node : nodes) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
272 printBlockNode(node.toString(Verbosity.Id));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
273 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
274 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
275 endBlockNodes();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
276 endBlock();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
277 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
278
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
279 private void printNoBlock(Set<Node> noBlockNodes) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
280 if (!noBlockNodes.isEmpty()) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
281 beginBlock("noBlock");
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
282 beginBlockNodes();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
283 for (Node node : noBlockNodes) {
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
284 printBlockNode(node.toString(Verbosity.Id));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
285 }
4414
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
286 endBlockNodes();
bae1b1f29984 fix merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4413
diff changeset
287 endBlock();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
288 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
289 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
290 }