Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2715:3ac3dd97d8df
Added ExceptionEdgeInstruction interface.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Thu, 19 May 2011 13:21:31 +0200 |
parents | 4272b7af2d17 |
children | c1a9bf38da28 |
comparison
equal
deleted
inserted
replaced
2714:e235eb9e7b54 | 2715:3ac3dd97d8df |
---|---|
244 closure.apply(block); | 244 closure.apply(block); |
245 | 245 |
246 Instruction inst = block; | 246 Instruction inst = block; |
247 ArrayList<BlockBegin> excBlocks = new ArrayList<BlockBegin>(); | 247 ArrayList<BlockBegin> excBlocks = new ArrayList<BlockBegin>(); |
248 while (inst != null) { | 248 while (inst != null) { |
249 if (inst instanceof Invoke) { | 249 if (inst instanceof ExceptionEdgeInstruction) { |
250 excBlocks.add(((Invoke) inst).exceptionEdge()); | 250 excBlocks.add(((ExceptionEdgeInstruction) inst).exceptionEdge()); |
251 } else if (inst instanceof Throw) { | |
252 excBlocks.add(((Throw) inst).exceptionEdge()); | |
253 } | 251 } |
254 inst = inst.next(); | 252 inst = inst.next(); |
255 } | 253 } |
256 while (excBlocks.remove(null)) { | 254 while (excBlocks.remove(null)) { |
257 // nothing | 255 // nothing |
701 for (int i = 0; i < numberOfSux(); i++) { | 699 for (int i = 0; i < numberOfSux(); i++) { |
702 closure.apply(suxAt(i)); | 700 closure.apply(suxAt(i)); |
703 } | 701 } |
704 } | 702 } |
705 for (Instruction x = next(); x != null; x = x.next()) { | 703 for (Instruction x = next(); x != null; x = x.next()) { |
706 if (x instanceof Invoke && ((Invoke) x).exceptionEdge() != null) { | 704 if (x instanceof ExceptionEdgeInstruction && ((ExceptionEdgeInstruction) x).exceptionEdge() != null) { |
707 closure.apply(((Invoke) x).exceptionEdge()); | 705 closure.apply(((ExceptionEdgeInstruction) x).exceptionEdge()); |
708 } else if (x instanceof Throw && ((Throw) x).exceptionEdge() != null) { | |
709 closure.apply(((Throw) x).exceptionEdge()); | |
710 } | 706 } |
711 } | 707 } |
712 } | 708 } |
713 | 709 |
714 public void verifyPredecessors() { | 710 public void verifyPredecessors() { |