Mercurial > hg > graal-jvmci-8
changeset 15797:8e4bedbbb6d8
[inlining-5] separate check code (fewer args, pure, concise) from logging code
author | Miguel Garcia <miguel.m.garcia@oracle.com> |
---|---|
date | Mon, 19 May 2014 21:39:49 +0200 |
parents | ab2858ab79e9 |
children | 8c5bcddb4320 |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java |
diffstat | 1 files changed, 14 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Mon May 19 21:30:07 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Mon May 19 21:39:49 2014 +0200 @@ -90,23 +90,28 @@ pushGraph(rootGraph, 1.0, 1.0); } - private boolean checkTargetConditions(Invoke invoke, ResolvedJavaMethod method) { - String failureMessage = null; + private String checkTargetConditionsHelper(ResolvedJavaMethod method) { if (method == null) { - failureMessage = "the method is not resolved"; + return "the method is not resolved"; } else if (method.isNative() && (!Intrinsify.getValue() || !InliningUtil.canIntrinsify(context.getReplacements(), method))) { - failureMessage = "it is a non-intrinsic native method"; + return "it is a non-intrinsic native method"; } else if (method.isAbstract()) { - failureMessage = "it is an abstract method"; + return "it is an abstract method"; } else if (!method.getDeclaringClass().isInitialized()) { - failureMessage = "the method's class is not initialized"; + return "the method's class is not initialized"; } else if (!method.canBeInlined()) { - failureMessage = "it is marked non-inlinable"; + return "it is marked non-inlinable"; } else if (countRecursiveInlining(method) > MaximumRecursiveInlining.getValue()) { - failureMessage = "it exceeds the maximum recursive inlining depth"; + return "it exceeds the maximum recursive inlining depth"; } else if (new OptimisticOptimizations(method.getProfilingInfo()).lessOptimisticThan(context.getOptimisticOptimizations())) { - failureMessage = "the callee uses less optimistic optimizations than caller"; + return "the callee uses less optimistic optimizations than caller"; + } else { + return null; } + } + + private boolean checkTargetConditions(Invoke invoke, ResolvedJavaMethod method) { + final String failureMessage = checkTargetConditionsHelper(method); if (failureMessage == null) { return true; } else {