# HG changeset patch # User Lukas Stadler # Date 1341500040 -7200 # Node ID 5967805da8f5fe1a955fb9b4dbf903e9a1a5cc47 # Parent 1bbbd61bf7e4018f3c9f2c6a5a31c89359828068 fix bug in BciBlockMapping that leads to bailouts on methods with more than 32 loops diff -r 1bbbd61bf7e4 -r 5967805da8f5 graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java Mon Jul 02 16:51:33 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java Thu Jul 05 16:54:00 2012 +0200 @@ -527,7 +527,7 @@ // There is a path from a loop end to the method entry that does not pass the loop header. // Therefore, the loop is non reducible (has more than one entry). // We don't want to compile such methods because the IR only supports structured loops. - throw new BailoutException("Non-reducible loop"); + throw new BailoutException("Non-reducible loop: %016x", loop); } } while (loopChanges); } @@ -629,7 +629,7 @@ } assert block.loops == 0; - block.loops = (long) 1 << (long) nextLoop; + block.loops = 1L << nextLoop; Debug.log("makeLoopHeader(%s) -> %x", block, block.loops); loopHeaders[nextLoop] = block; block.loopId = nextLoop; @@ -660,7 +660,7 @@ block.visited = true; block.active = true; - int loops = 0; + long loops = 0; for (Block successor : block.successors) { // Recursively process successors. loops |= computeBlockOrder(successor); diff -r 1bbbd61bf7e4 -r 5967805da8f5 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon Jul 02 16:51:33 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Thu Jul 05 16:54:00 2012 +0200 @@ -1140,7 +1140,7 @@ int pos = 0; ArrayList exitLoops = new ArrayList<>(Long.bitCount(exits)); do { - int lMask = 1 << pos; + long lMask = 1L << pos; if ((exits & lMask) != 0) { exitLoops.add(loopHeaders[pos]); exits &= ~lMask;