# HG changeset patch # User Miguel Garcia # Date 1400422245 -7200 # Node ID 4f42ea8df6dd9dbe69a9693b3dee28e2e89a569a # Parent f7d839024344c2b02a55c208db2a27ea2a745db8 [inlining-2] make returned value explicit diff -r f7d839024344 -r 4f42ea8df6dd 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 Sun May 18 16:08:15 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Sun May 18 16:10:45 2014 +0200 @@ -177,8 +177,8 @@ return false; } - private static InlineInfo logNotInlined(Invoke invoke, int inliningDepth, ResolvedJavaMethod method, String msg) { - return logNotInlinedMethodAndReturnNull(invoke, inliningDepth, method, msg, new Object[0]); + private static void logNotInlined(Invoke invoke, int inliningDepth, ResolvedJavaMethod method, String msg) { + logNotInlinedMethodAndReturnNull(invoke, inliningDepth, method, msg, new Object[0]); } private static InlineInfo logNotInlinedMethodAndReturnNull(Invoke invoke, int inliningDepth, ResolvedJavaMethod method, String msg, Object... args) { @@ -338,18 +338,21 @@ TypeProfileProxyNode typeProfileProxyNode = (TypeProfileProxyNode) receiver; typeProfile = typeProfileProxyNode.getProfile(); } else { - return logNotInlined(invoke, data.inliningDepth(), targetMethod, "no type profile exists"); + logNotInlined(invoke, data.inliningDepth(), targetMethod, "no type profile exists"); + return null; } ProfiledType[] ptypes = typeProfile.getTypes(); if (ptypes == null || ptypes.length <= 0) { - return logNotInlined(invoke, data.inliningDepth(), targetMethod, "no types in profile"); + logNotInlined(invoke, data.inliningDepth(), targetMethod, "no types in profile"); + return null; } ResolvedJavaType contextType = invoke.getContextType(); double notRecordedTypeProbability = typeProfile.getNotRecordedProbability(); if (ptypes.length == 1 && notRecordedTypeProbability == 0) { if (!optimisticOpts.inlineMonomorphicCalls()) { - return logNotInlined(invoke, data.inliningDepth(), targetMethod, "inlining monomorphic calls is disabled"); + logNotInlined(invoke, data.inliningDepth(), targetMethod, "inlining monomorphic calls is disabled"); + return null; } ResolvedJavaType type = ptypes[0].getType(); @@ -378,7 +381,8 @@ for (int i = 0; i < ptypes.length; i++) { ResolvedJavaMethod concrete = ptypes[i].getType().resolveMethod(targetMethod, contextType); if (concrete == null) { - return logNotInlined(invoke, data.inliningDepth(), targetMethod, "could not resolve method"); + logNotInlined(invoke, data.inliningDepth(), targetMethod, "could not resolve method"); + return null; } int index = concreteMethods.indexOf(concrete); double curProbability = ptypes[i].getProbability(); @@ -438,7 +442,8 @@ for (ResolvedJavaMethod concrete : concreteMethods) { if (!checkTargetConditions(data, replacements, invoke, concrete, optimisticOpts)) { - return logNotInlined(invoke, data.inliningDepth(), targetMethod, "it is a polymorphic method call and at least one invoked method cannot be inlined"); + logNotInlined(invoke, data.inliningDepth(), targetMethod, "it is a polymorphic method call and at least one invoked method cannot be inlined"); + return null; } } return new MultiTypeGuardInlineInfo(invoke, concreteMethods, concreteMethodsProbabilities, usedTypes, typesToConcretes, notRecordedTypeProbability);