# HG changeset patch # User Lukas Stadler # Date 1326810419 -3600 # Node ID a21979dc80bec6cf300fe22038e9b7f3a205b11e # Parent ff0ac17dc0aae7d97e34fde2fd26d6ef4ee8fe22 small fixes: don't cascade GraalInternalErrors, convert useless ifs to gotos diff -r ff0ac17dc0aa -r a21979dc80be graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java Tue Jan 17 12:14:32 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java Tue Jan 17 15:26:59 2012 +0100 @@ -110,8 +110,8 @@ if (GraalOptions.Meter) { context.metrics.BytecodesCompiled += method.codeSize(); } - } catch (CiBailout bailout) { - throw bailout; + } catch (CiBailout | GraalInternalError exception) { + throw exception; } catch (Throwable t) { throw new GraalInternalError(t); } diff -r ff0ac17dc0aa -r a21979dc80be graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Tue Jan 17 12:14:32 2012 +0100 +++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Tue Jan 17 15:26:59 2012 +0100 @@ -611,9 +611,14 @@ probability = 0.5; } + CompareNode condition = currentGraph.unique(new CompareNode(x, cond, y)); FixedNode trueSuccessor = createTarget(currentBlock.successors.get(0), frameState); FixedNode falseSuccessor = createTarget(currentBlock.successors.get(1), frameState); - append(currentGraph.add(new IfNode(currentGraph.unique(new CompareNode(x, cond, y)), trueSuccessor, falseSuccessor, probability))); + if (trueSuccessor == falseSuccessor) { + appendGoto(trueSuccessor); + } else { + append(currentGraph.add(new IfNode(condition, trueSuccessor, falseSuccessor, probability))); + } assert currentBlock.normalSuccessors == 2 : currentBlock.normalSuccessors; }