comparison graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2616:3558ca7088c0

FrameState and Graphviz changes: * removed popx, pushx methods from GraphBuilder * FrameState subclass of Value * added String shortName() to Node * added GraphvizPrinter option to use short names * small hack in GraphvizPrinter: omit FrameState->Local connections * added GraalGraphviz to implicit classpatch (read from GRAAL env var)
author Lukas Stadler <lukas.stadler@jku.at>
date Mon, 09 May 2011 17:00:25 +0200
parents 0c6564c254af
children 7c8ad40c1f88
comparison
equal deleted inserted replaced
2615:5768534fd4e5 2616:3558ca7088c0
22 */ 22 */
23 package com.sun.c1x.graph; 23 package com.sun.c1x.graph;
24 24
25 import java.util.*; 25 import java.util.*;
26 26
27 import com.oracle.graal.graph.*;
28 import com.sun.c1x.*; 27 import com.sun.c1x.*;
29 import com.sun.c1x.debug.*; 28 import com.sun.c1x.debug.*;
30 import com.sun.c1x.ir.*; 29 import com.sun.c1x.ir.*;
31 import com.sun.c1x.observer.*; 30 import com.sun.c1x.observer.*;
32 import com.sun.c1x.value.*; 31 import com.sun.c1x.value.*;
60 /** 59 /**
61 * The linear-scan ordered list of blocks. 60 * The linear-scan ordered list of blocks.
62 */ 61 */
63 private List<BlockBegin> orderedBlocks; 62 private List<BlockBegin> orderedBlocks;
64 63
65 private final Graph graph = new Graph();
66
67 /** 64 /**
68 * Creates a new IR instance for the specified compilation. 65 * Creates a new IR instance for the specified compilation.
69 * @param compilation the compilation 66 * @param compilation the compilation
70 */ 67 */
71 public IR(C1XCompilation compilation) { 68 public IR(C1XCompilation compilation) {
94 } 91 }
95 } 92 }
96 93
97 private void buildGraph() { 94 private void buildGraph() {
98 // Graph builder must set the startBlock and the osrEntryBlock 95 // Graph builder must set the startBlock and the osrEntryBlock
99 new GraphBuilder(compilation, this, graph).build(); 96 new GraphBuilder(compilation, this, compilation.graph).build();
100 assert startBlock != null; 97 assert startBlock != null;
101 verifyAndPrint("After graph building"); 98 verifyAndPrint("After graph building");
102 99
103 if (C1XOptions.PrintCompilation) { 100 if (C1XOptions.PrintCompilation) {
104 TTY.print(String.format("%3d blocks | ", this.numberOfBlocks())); 101 TTY.print(String.format("%3d blocks | ", this.numberOfBlocks()));
174 } else { 171 } else {
175 bci = source.end().bci(); 172 bci = source.end().bci();
176 } 173 }
177 174
178 // create new successor and mark it for special block order treatment 175 // create new successor and mark it for special block order treatment
179 BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), graph); 176 BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), compilation.graph);
180 177
181 newSucc.setCriticalEdgeSplit(true); 178 newSucc.setCriticalEdgeSplit(true);
182 179
183 // This goto is not a safepoint. 180 // This goto is not a safepoint.
184 Goto e = new Goto(target, null, false, graph); 181 Goto e = new Goto(target, null, false, compilation.graph);
185 newSucc.appendNext(e, bci); 182 newSucc.appendNext(e, bci);
186 newSucc.setEnd(e); 183 newSucc.setEnd(e);
187 // setup states 184 // setup states
188 FrameState s = source.end().stateAfter(); 185 FrameState s = source.end().stateAfter();
189 newSucc.setStateBefore(s); 186 newSucc.setStateBefore(s);
274 * @return the number of locks 271 * @return the number of locks
275 */ 272 */
276 public final int maxLocks() { 273 public final int maxLocks() {
277 return maxLocks; 274 return maxLocks;
278 } 275 }
279
280 public Graph graph() {
281 return graph;
282 }
283 } 276 }