# HG changeset patch # User Christian Humer # Date 1444758606 -7200 # Node ID 4e901bdcf6569ec415cbdfad8bce37639c8c5670 # Parent b62242b9ddd79896cc69b8f660d0509f61d5519b Fix loop count should get reported also after the loop was OSR compiled. diff -r b62242b9ddd7 -r 4e901bdcf656 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedOSRLoopNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedOSRLoopNode.java Tue Oct 13 09:24:13 2015 -0700 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedOSRLoopNode.java Tue Oct 13 19:50:06 2015 +0200 @@ -35,6 +35,7 @@ public final class OptimizedOSRLoopNode extends LoopNode implements ReplaceObserver { private int interpreterLoopCount; + private int lastLoopCount; private OptimizedCallTarget compiledTarget; @Child private RepeatingNode repeatableNode; @@ -105,6 +106,7 @@ return false; } else if (target.isValid()) { Object result = target.callDirect(new Object[]{frame}); + iterations = lastLoopCount; if (result == Boolean.TRUE) { // loop is done. No further repetitions necessary. return true; @@ -157,6 +159,7 @@ private void reportLoopCount(int reportIterations) { if (reportIterations != 0) { + lastLoopCount = reportIterations; interpreterLoopCount += reportIterations; getRootNode().reportLoopCount(reportIterations); }