Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2716:c1a9bf38da28
Removed bci from the Instruction class.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Thu, 19 May 2011 13:59:55 +0200 |
parents | a0dd2b907806 |
children | c1ce2a53d6c3 |
comparison
equal
deleted
inserted
replaced
2715:3ac3dd97d8df | 2716:c1a9bf38da28 |
---|---|
153 * @param source the source of the edge | 153 * @param source the source of the edge |
154 * @param target the successor before which to insert a block | 154 * @param target the successor before which to insert a block |
155 * @return the new block inserted | 155 * @return the new block inserted |
156 */ | 156 */ |
157 public BlockBegin splitEdge(BlockBegin source, BlockBegin target) { | 157 public BlockBegin splitEdge(BlockBegin source, BlockBegin target) { |
158 int bci; | 158 int bci = -2; |
159 if (target.blockPredecessors().size() == 1) { | |
160 bci = target.bci(); | |
161 } else { | |
162 bci = source.end().bci(); | |
163 } | |
164 | 159 |
165 int backEdgeIndex = target.predecessors().indexOf(source.end()); | 160 int backEdgeIndex = target.predecessors().indexOf(source.end()); |
166 | 161 |
167 // create new successor and mark it for special block order treatment | 162 // create new successor and mark it for special block order treatment |
168 BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), compilation.graph); | 163 BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), compilation.graph); |
169 | 164 |
170 // This goto is not a safepoint. | 165 // This goto is not a safepoint. |
171 Goto e = new Goto(target, null, compilation.graph); | 166 Goto e = new Goto(target, null, compilation.graph); |
172 newSucc.appendNext(e, bci); | 167 newSucc.appendNext(e); |
173 newSucc.setEnd(e); | 168 newSucc.setEnd(e); |
174 e.reorderSuccessor(0, backEdgeIndex); | 169 e.reorderSuccessor(0, backEdgeIndex); |
175 // setup states | 170 // setup states |
176 FrameState s = source.end().stateAfter(); | 171 FrameState s = source.end().stateAfter(); |
177 newSucc.setStateBefore(s); | 172 newSucc.setStateBefore(s); |