Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java @ 2778:2ac7b30b7290
Enabled new block finding algorithm.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Tue, 24 May 2011 21:39:45 +0200 |
parents | 3e4d992fd312 |
children | 93ec3f067420 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java Tue May 24 14:40:47 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java Tue May 24 21:39:45 2011 +0200 @@ -29,7 +29,6 @@ import com.sun.c1x.debug.*; import com.sun.c1x.ir.*; import com.sun.c1x.util.*; -import com.sun.c1x.value.*; import com.sun.cri.ci.*; /** @@ -43,7 +42,7 @@ private List<Instruction> instructions = new ArrayList<Instruction>(4); private List<LIRBlock> predecessors = new ArrayList<LIRBlock>(4); private List<LIRBlock> successors = new ArrayList<LIRBlock>(4); - private List<Phi> phis = new ArrayList<Phi>(4); + private List<LIRBlock> exceptionHandlerSuccessors = new ArrayList<LIRBlock>(4); /** * Bit map specifying which {@linkplain OperandPool operands} are live upon entry to this block. @@ -78,6 +77,10 @@ private int lastLirInstructionID; public int blockEntryPco; + public List<LIRBlock> getExceptionHandlerSuccessors() { + return exceptionHandlerSuccessors; + } + public LIRBlock(int blockID) { this.blockID = blockID; loopIndex = -1; @@ -105,7 +108,6 @@ } public int loopDepth; - public int loopIndex; public LIRList lir() { return lir; @@ -151,6 +153,11 @@ return successors; } + @Override + public String toString() { + return "B" + blockID(); + } + public List<LIRBlock> blockPredecessors() { return predecessors; } @@ -161,10 +168,19 @@ } public int loopIndex() { - // TODO(tw): Set correct loop index. - return -1; + return loopIndex; + } + + public void setLoopIndex(int v) { + loopIndex = v; } + public void setLoopDepth(int v) { + this.loopDepth = v; + } + + private int loopIndex; + public Label label() { return label; } @@ -172,7 +188,25 @@ private int linearScanNumber = -1; private boolean linearScanLoopEnd; private boolean linearScanLoopHeader; - private FrameState stateBefore; + private boolean exceptionEntry; + private boolean backwardBranchTarget; + + + public void setExceptionEntry(boolean b) { + this.exceptionEntry = b; + } + + public boolean isExceptionEntry() { + return exceptionEntry; + } + + public void setBackwardBranchTarget(boolean b) { + this.backwardBranchTarget = b; + } + + public boolean backwardBranchTarget() { + return backwardBranchTarget; + } public void setLinearScanNumber(int v) { linearScanNumber = v; @@ -198,14 +232,6 @@ return linearScanLoopHeader; } - public void setStateBefore(FrameState stateBefore) { - this.stateBefore = stateBefore; - } - - public FrameState stateBefore() { - return stateBefore; - } - public void replaceWith(LIRBlock other) { for (LIRBlock pred : predecessors) { Util.replaceAllInList(this, other, pred.successors);