changeset 22808:4e901bdcf656

Fix loop count should get reported also after the loop was OSR compiled.
author Christian Humer <christian.humer@oracle.com>
date Tue, 13 Oct 2015 19:50:06 +0200
parents b62242b9ddd7
children 039dc66badf5
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedOSRLoopNode.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
         }