changeset 17253:b8611b23c4f8

Truffle: Fixed forced inlining decisions could exceed the maximum total node count.
author Christian Humer <christian.humer@gmail.com>
date Mon, 29 Sep 2014 18:39:05 +0200
parents 1680a4ddc2a7
children 11db1a51607c
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/DefaultInliningPolicy.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/DefaultInliningPolicy.java	Mon Sep 29 18:39:05 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/DefaultInliningPolicy.java	Mon Sep 29 18:39:05 2014 +0200
@@ -40,15 +40,15 @@
             return false;
         }
 
-        if (profile.isForced()) {
-            return true;
-        }
-
         if (currentNodeCount + profile.getDeepNodeCount() > TruffleInliningMaxCallerSize.getValue()) {
             profile.setFailedReason(REASON_MAXIMUM_TOTAL_NODE_COUNT);
             return false;
         }
 
+        if (profile.isForced()) {
+            return true;
+        }
+
         int cappedCallSites = Math.min(Math.max(profile.getCallSites(), 1), 10);
         if (profile.getDeepNodeCount() * cappedCallSites > TruffleInliningMaxCallerSize.getValue()) {
             profile.setFailedReason(REASON_MAXIMUM_NODE_COUNT);