# HG changeset patch # User Miguel Garcia # Date 1400503904 -7200 # Node ID ce5b2557396afc8e8487872904e9a0af3482823b # Parent 05826e450e3eab87c607acd830d4fa255722f972 [inlining-3] readability of checkInvokeConditions() part 1 of 2 diff -r 05826e450e3e -r ce5b2557396a graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java --- 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) {