Mercurial > hg > truffle
diff 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 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java Thu May 19 13:14:02 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java Thu May 19 13:21:31 2011 +0200 @@ -246,10 +246,8 @@ Instruction inst = block; ArrayList<BlockBegin> excBlocks = new ArrayList<BlockBegin>(); while (inst != null) { - if (inst instanceof Invoke) { - excBlocks.add(((Invoke) inst).exceptionEdge()); - } else if (inst instanceof Throw) { - excBlocks.add(((Throw) inst).exceptionEdge()); + if (inst instanceof ExceptionEdgeInstruction) { + excBlocks.add(((ExceptionEdgeInstruction) inst).exceptionEdge()); } inst = inst.next(); } @@ -703,10 +701,8 @@ } } for (Instruction x = next(); x != null; x = x.next()) { - if (x instanceof Invoke && ((Invoke) x).exceptionEdge() != null) { - closure.apply(((Invoke) x).exceptionEdge()); - } else if (x instanceof Throw && ((Throw) x).exceptionEdge() != null) { - closure.apply(((Throw) x).exceptionEdge()); + if (x instanceof ExceptionEdgeInstruction && ((ExceptionEdgeInstruction) x).exceptionEdge() != null) { + closure.apply(((ExceptionEdgeInstruction) x).exceptionEdge()); } } }