Mercurial > hg > truffle
changeset 4307:a21979dc80be
small fixes: don't cascade GraalInternalErrors, convert useless ifs to gotos
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 17 Jan 2012 15:26:59 +0100 |
parents | ff0ac17dc0aa |
children | cbed6f7e2d10 |
files | graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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); }
--- 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; }