comparison graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2840:75e0d39833a0

new CompilerGraph, create only one Return and one Unwind per CompilerGraph
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 31 May 2011 16:53:19 +0200
parents c1c8a0291771
children 633e66de40fe
comparison
equal deleted inserted replaced
2837:7b5831f0e913 2840:75e0d39833a0
30 import com.sun.c1x.debug.*; 30 import com.sun.c1x.debug.*;
31 import com.sun.c1x.gen.*; 31 import com.sun.c1x.gen.*;
32 import com.sun.c1x.ir.*; 32 import com.sun.c1x.ir.*;
33 import com.sun.c1x.lir.*; 33 import com.sun.c1x.lir.*;
34 import com.sun.c1x.observer.*; 34 import com.sun.c1x.observer.*;
35 import com.sun.c1x.value.*;
35 36
36 /** 37 /**
37 * This class implements the overall container for the HIR (high-level IR) graph 38 * This class implements the overall container for the HIR (high-level IR) graph
38 * and directs its construction, optimization, and finalization. 39 * and directs its construction, optimization, and finalization.
39 */ 40 */
46 47
47 /** 48 /**
48 * The start block of this IR. 49 * The start block of this IR.
49 */ 50 */
50 public LIRBlock startBlock; 51 public LIRBlock startBlock;
51
52 private int maxLocks;
53 52
54 /** 53 /**
55 * The linear-scan ordered list of blocks. 54 * The linear-scan ordered list of blocks.
56 */ 55 */
57 private List<LIRBlock> orderedBlocks; 56 private List<LIRBlock> orderedBlocks;
208 public int numLoops() { 207 public int numLoops() {
209 return compilation.stats.loopCount; 208 return compilation.stats.loopCount;
210 } 209 }
211 210
212 /** 211 /**
213 * Updates the maximum number of locks held at any one time. 212 * Gets the maximum number of locks in the graph's frame states.
214 *
215 * @param locks a lock count that will replace the current {@linkplain #maxLocks() max locks} if it is greater
216 */
217 public void updateMaxLocks(int locks) {
218 if (locks > maxLocks) {
219 maxLocks = locks;
220 }
221 }
222
223 /**
224 * Gets the number of locks.
225 * @return the number of locks
226 */ 213 */
227 public final int maxLocks() { 214 public final int maxLocks() {
215 int maxLocks = 0;
216 for (Node node : compilation.graph.getNodes()) {
217 if (node instanceof FrameState) {
218 int lockCount = ((FrameState) node).locksSize();
219 if (lockCount > maxLocks) {
220 maxLocks = lockCount;
221 }
222 }
223 }
228 return maxLocks; 224 return maxLocks;
229 } 225 }
230 226
231 public Instruction getHIRStartBlock() { 227 public Instruction getHIRStartBlock() {
232 return (Instruction) compilation.graph.start().successors().get(0); 228 return (Instruction) compilation.graph.start().successors().get(0);