# HG changeset patch # User Mick Jordan # Date 1379461066 25200 # Node ID 8d0303d8dbde4aaad943784e079ed14cd96d68dd # Parent 0d3b767e5356af23d0ef3b5d00190ad085400be8 make GreedyInliningPolicy/ExactInlineInfo public, allow optional null check suppression on inline diff -r 0d3b767e5356 -r 8d0303d8dbde graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java --- 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 hints) { super(hints); diff -r 0d3b767e5356 -r 8d0303d8dbde graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java --- 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,