changeset 15757:ce5b2557396a

[inlining-3] readability of checkInvokeConditions() part 1 of 2
author Miguel Garcia <miguel.m.garcia@oracle.com>
date Mon, 19 May 2014 14:51:44 +0200
parents 05826e450e3e
children c4f012d2b58b
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java	Mon May 19 13:58:16 2014 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java	Mon May 19 14:51:44 2014 +0200
@@ -466,21 +466,25 @@
     private static String checkInvokeConditions(Invoke invoke) {
         if (invoke.predecessor() == null || !invoke.asNode().isAlive()) {
             return "the invoke is dead code";
-        } else if (!(invoke.callTarget() instanceof MethodCallTargetNode)) {
+        }
+        if (!(invoke.callTarget() instanceof MethodCallTargetNode)) {
             return "the invoke has already been lowered, or has been created as a low-level node";
-        } else if (((MethodCallTargetNode) invoke.callTarget()).targetMethod() == null) {
+        }
+        if (((MethodCallTargetNode) invoke.callTarget()).targetMethod() == null) {
             return "target method is null";
-        } else if (invoke.stateAfter() == null) {
+        }
+        if (invoke.stateAfter() == null) {
             // TODO (chaeubl): why should an invoke not have a state after?
             return "the invoke has no after state";
-        } else if (!invoke.useForInlining()) {
+        }
+        if (!invoke.useForInlining()) {
             return "the invoke is marked to be not used for inlining";
-        } else if (((MethodCallTargetNode) invoke.callTarget()).receiver() != null && ((MethodCallTargetNode) invoke.callTarget()).receiver().isConstant() &&
+        }
+        if (((MethodCallTargetNode) invoke.callTarget()).receiver() != null && ((MethodCallTargetNode) invoke.callTarget()).receiver().isConstant() &&
                         ((MethodCallTargetNode) invoke.callTarget()).receiver().asConstant().isNull()) {
             return "receiver is null";
-        } else {
-            return null;
         }
+        return null;
     }
 
     private static boolean checkTargetConditions(InliningData data, Replacements replacements, Invoke invoke, ResolvedJavaMethod method, OptimisticOptimizations optimisticOpts) {