Mercurial > hg > graal-compiler
changeset 15133:f9c9eedef118
Merge.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Wed, 16 Apr 2014 14:27:18 +0200 |
parents | 844cfee4041a (current diff) 118a3e438150 (diff) |
children | f0fc09c0845e 370cb412d027 |
files | |
diffstat | 2 files changed, 27 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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