changeset 4530:6c6cb7be1324

bugfix
author Christian Haeubl <christian.haeubl@oracle.com>
date Wed, 08 Feb 2012 21:13:35 -0800
parents fc78ad20ec38
children 3a309467fc8e
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java	Wed Feb 08 20:30:47 2012 -0800
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java	Wed Feb 08 21:13:35 2012 -0800
@@ -542,7 +542,7 @@
                     if (GraalOptions.InlineMonomorphicCalls) {
                         RiResolvedType type = types[0];
                         RiResolvedMethod concrete = type.resolveMethodImpl(callTarget.targetMethod());
-                        if (concrete != null && checkTargetConditions(concrete)) {
+                        if (checkTargetConditions(concrete)) {
                             double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
                             return new TypeGuardInlineInfo(invoke, weight, level, concrete, type);
                         }
@@ -580,7 +580,7 @@
                         double totalWeight = 0;
                         boolean canInline = true;
                         for (RiResolvedMethod concrete: concreteMethods) {
-                            if (concrete == null || !checkTargetConditions(concrete)) {
+                            if (!checkTargetConditions(concrete)) {
                                 canInline = false;
                                 break;
                             }
@@ -637,6 +637,10 @@
     }
 
     private static boolean checkTargetConditions(RiMethod method) {
+        if (method == null) {
+            Debug.log("method not resolved");
+            return false;
+        }
         if (!(method instanceof RiResolvedMethod)) {
             Debug.log("not inlining %s because it is unresolved", method.toString());
             return false;