changeset 22075:9aca6f6126ef

increase inlining bonus for candidate with constant arguments
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 23 Jun 2015 18:13:03 +0200
parents 312ecf78fb2d
children 65f36f248700
files graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InlineDuringParsingPlugin.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InlineDuringParsingPlugin.java	Tue Jun 23 18:10:30 2015 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InlineDuringParsingPlugin.java	Tue Jun 23 18:13:03 2015 +0200
@@ -39,8 +39,13 @@
         return null;
     }
 
-    private static boolean checkSize(ResolvedJavaMethod method, @SuppressWarnings("unused") ValueNode[] args) {
+    private static boolean checkSize(ResolvedJavaMethod method, ValueNode[] args) {
         int bonus = 1;
+        for (ValueNode v : args) {
+            if (v.isConstant()) {
+                bonus++;
+            }
+        }
         return method.getCode().length <= TrivialInliningSize.getValue() * bonus;
     }
 }