# HG changeset patch # User Roland Schatz # Date 1397651238 -7200 # Node ID f9c9eedef118921e00a7ddfc207563b3a662530e # Parent 844cfee4041a26bdae38833b2faeb942178eadf3# Parent 118a3e4381504a99d2fbaea6f1496356054f873a Merge. diff -r 844cfee4041a -r f9c9eedef118 graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java --- a/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java Wed Apr 16 14:02:52 2014 +0200 +++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java Wed Apr 16 14:27:18 2014 +0200 @@ -57,7 +57,7 @@ private LocalLiveness liveness; private BciBlockBitMap blockVisited; - private class BciBlockBitMap { + private static class BciBlockBitMap { BitSet bitSet; public BciBlockBitMap(BciBlockMapping blockMap) { @@ -663,30 +663,31 @@ Debug.log("moveConstantsToVariables: framestate after: %s", frameState); } - private void adaptValues(Value dst, Value src) { + private static void adaptValues(Value dst, Value src, PhiResolver resolver) { if (dst == null) { return; } assert src != null : "Source is null but Destination is not!"; if (!dst.equals(src)) { - assert dst instanceof AllocatableValue : "Not an AllocatableValue: " + dst; - gen.emitMove((AllocatableValue) dst, src); + resolver.move(dst, src); } } private void adaptFramestate(LIRFrameStateBuilder other) { assert frameState.isCompatibleWith(other) : "framestates not compatible!"; + PhiResolver resolver = new PhiResolver(gen); for (int i = 0; i < frameState.stackSize(); i++) { Value src = frameState.stackAt(i); Value dst = other.stackAt(i); - adaptValues(dst, src); + adaptValues(dst, src, resolver); } for (int i = 0; i < frameState.localsSize(); i++) { Value src = frameState.localAt(i); Value dst = other.localAt(i); - adaptValues(dst, src); + adaptValues(dst, src, resolver); } + resolver.dispose(); } @Override @@ -716,6 +717,14 @@ assert block.getPredecessorCount() > 0; } + if (block.isLoopHeader) { + /* + * We need to preserve the frame state builder of the loop header so that we can merge + * values for phi functions, so make a copy of it. + */ + block.entryState = frameState.copy(); + + } int endBCI = stream.endBCI(); stream.setBCI(block.startBci); diff -r 844cfee4041a -r f9c9eedef118 test/baseline_whitelist.txt --- a/test/baseline_whitelist.txt Wed Apr 16 14:02:52 2014 +0200 +++ b/test/baseline_whitelist.txt Wed Apr 16 14:27:18 2014 +0200 @@ -1,7 +1,19 @@ com.oracle.graal.jtt.loop.Loop03 +com.oracle.graal.jtt.loop.Loop04 +com.oracle.graal.jtt.loop.Loop08 +com.oracle.graal.jtt.loop.Loop11 com.oracle.graal.jtt.bytecode.BC_iadd com.oracle.graal.jtt.bytecode.BC_iadd2 com.oracle.graal.jtt.bytecode.BC_iadd3 com.oracle.graal.jtt.bytecode.BC_ifeq_2 com.oracle.graal.jtt.bytecode.BC_ifeq_3 com.oracle.graal.jtt.bytecode.BC_ifeq +com.oracle.graal.jtt.bytecode.BC_aload_3 +com.oracle.graal.jtt.bytecode.BC_aload_2 +com.oracle.graal.jtt.bytecode.BC_aload_1 +com.oracle.graal.jtt.bytecode.BC_aload_0 +com.oracle.graal.jtt.bytecode.BC_areturn +com.oracle.graal.jtt.bytecode.BC_freturn +com.oracle.graal.jtt.bytecode.BC_iconst +com.oracle.graal.jtt.bytecode.BC_ireturn +com.oracle.graal.jtt.bytecode.BC_lreturn