Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java @ 7388:599ea4fcdb6d
added flag AlwaysInlineIntrinsics
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Mon, 07 Jan 2013 08:38:40 +0100 |
parents | d0c4b6f8d67f |
children | 36dafe48bc38 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Wed Dec 19 10:01:08 2012 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Mon Jan 07 08:38:40 2013 +0100 @@ -248,6 +248,10 @@ private static class BytecodeSizeBasedWeightComputationPolicy implements WeightComputationPolicy { @Override public double computeWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke, boolean preferredInvoke) { + if (GraalOptions.AlwaysInlineIntrinsics && InliningUtil.canIntrinsify(method)) { + return 0; + } + double codeSize = method.getCodeSize(); if (preferredInvoke) { codeSize = codeSize / GraalOptions.BoostInliningForEscapeAnalysis; @@ -259,6 +263,10 @@ private static class ComplexityBasedWeightComputationPolicy implements WeightComputationPolicy { @Override public double computeWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke, boolean preferredInvoke) { + if (GraalOptions.AlwaysInlineIntrinsics && InliningUtil.canIntrinsify(method)) { + return 0; + } + double complexity = method.getCompilationComplexity(); if (preferredInvoke) { complexity = complexity / GraalOptions.BoostInliningForEscapeAnalysis; @@ -270,6 +278,10 @@ private static class CompiledCodeSizeWeightComputationPolicy implements WeightComputationPolicy { @Override public double computeWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke, boolean preferredInvoke) { + if (GraalOptions.AlwaysInlineIntrinsics && InliningUtil.canIntrinsify(method)) { + return 0; + } + int compiledCodeSize = method.getCompiledCodeSize(); return compiledCodeSize > 0 ? compiledCodeSize : method.getCodeSize() * 10; }