Mercurial > hg > truffle
changeset 5046:2eb3c0920cf1
Fix performance regression: When never executed code is not compiled, deoptimize before the branch so that interpreter updates profiling information.
author | Christian Wimmer <Christian.Wimmer@Oracle.com> |
---|---|
date | Wed, 07 Mar 2012 11:06:14 -0800 |
parents | e87460fbd2f1 |
children | 6bc165b0fdcd 7770a465fb73 |
files | graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Wed Mar 07 10:09:55 2012 -0800 +++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Wed Mar 07 11:06:14 2012 -0800 @@ -1264,14 +1264,12 @@ */ private BeginNode createBlockTarget(double probability, Block block, FrameStateBuilder stateAfter) { assert probability >= 0 && probability <= 1; - if (probability == 0) { - FrameStateBuilder state = stateAfter.copy(); - state.clearNonLiveLocals(block.localsLiveIn); - + if (probability == 0 && config.useBranchPrediction()) { BeginNode begin = currentGraph.add(new BeginNode()); DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile)); begin.setNext(deopt); - begin.setStateAfter(state.create(block.startBci)); + // Note: We are not allowed to set the stateAfter of the begin node, because we have to deoptimize to + // a bci _before_ the actual if, so that the interpreter can update the profiling information. return begin; }