Mercurial > hg > graal-jvmci-8
changeset 15744:4f42ea8df6dd
[inlining-2] make returned value explicit
author | Miguel Garcia <miguel.m.garcia@oracle.com> |
---|---|
date | Sun, 18 May 2014 16:10:45 +0200 |
parents | f7d839024344 |
children | ff0d19700e31 |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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);