Mercurial > hg > graal-jvmci-8
changeset 11689:8d0303d8dbde
make GreedyInliningPolicy/ExactInlineInfo public, allow optional null check suppression on inline
author | Mick Jordan <mick.jordan@oracle.com> |
---|---|
date | Tue, 17 Sep 2013 16:37:46 -0700 |
parents | 0d3b767e5356 |
children | 56e59e384dc1 |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Tue Sep 17 23:28:14 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Tue Sep 17 16:37:46 2013 -0700 @@ -407,7 +407,7 @@ } } - private static final class GreedyInliningPolicy extends AbstractInliningPolicy { + public static class GreedyInliningPolicy extends AbstractInliningPolicy { public GreedyInliningPolicy(Map<Invoke, Double> hints) { super(hints);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Tue Sep 17 23:28:14 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Tue Sep 17 16:37:46 2013 -0700 @@ -350,10 +350,11 @@ * Represents an inlining opportunity where the compiler can statically determine a monomorphic * target method and therefore is able to determine the called method exactly. */ - private static class ExactInlineInfo extends AbstractInlineInfo { + public static class ExactInlineInfo extends AbstractInlineInfo { protected final ResolvedJavaMethod concrete; private Inlineable inlineableElement; + private boolean suppressNullCheck; public ExactInlineInfo(Invoke invoke, ResolvedJavaMethod concrete) { super(invoke); @@ -361,9 +362,13 @@ assert concrete != null; } + public void suppressNullCheck() { + suppressNullCheck = true; + } + @Override public void inline(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements) { - inline(invoke, concrete, inlineableElement, assumptions, true); + inline(invoke, concrete, inlineableElement, assumptions, !suppressNullCheck); } @Override @@ -1020,7 +1025,7 @@ /** * Determines if inlining is possible at the given invoke node. - * + * * @param invoke the invoke that should be inlined * @return an instance of InlineInfo, or null if no inlining is possible at the given invoke */ @@ -1282,7 +1287,7 @@ /** * Performs an actual inlining, thereby replacing the given invoke with the given inlineGraph. - * + * * @param invoke the invoke that will be replaced * @param inlineGraph the graph that the invoke will be replaced with * @param receiverNullCheck true if a null check needs to be generated for non-static inlinings,