# HG changeset patch # User Miguel Garcia # Date 1399986336 -7200 # Node ID 7988771f71917ed8cfffd9faecded45d60d90049 # Parent 58bf117e18d8bd932f4c176992540c955570189d [inlining] preparing to move depth-search utilities diff -r 58bf117e18d8 -r 7988771f7191 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java Tue May 13 14:54:23 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java Tue May 13 15:05:36 2014 +0200 @@ -277,11 +277,11 @@ if (macroNodeClass != null) { return new InlineableMacroNode(macroNodeClass); } else { - return new InlineableGraph(buildGraph(method, invoke, context)); + return new InlineableGraph(buildGraph(method, invoke, context, canonicalizer)); } } - private StructuredGraph buildGraph(final ResolvedJavaMethod method, final Invoke invoke, final HighTierContext context) { + private static StructuredGraph buildGraph(final ResolvedJavaMethod method, final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) { final StructuredGraph newGraph; final boolean parseBytecodes; @@ -304,7 +304,7 @@ try (Scope s = Debug.scope("InlineGraph", newGraph)) { if (parseBytecodes) { - parseBytecodes(newGraph, context); + parseBytecodes(newGraph, context, canonicalizer); } boolean callerHasMoreInformationAboutArguments = false; @@ -350,8 +350,12 @@ return null; } - private StructuredGraph parseBytecodes(StructuredGraph newGraph, HighTierContext context) { - boolean hasMatureProfilingInfo = newGraph.method().getProfilingInfo().isMature(); + /** + * This method builds the IR nodes for newGraph and canonicalizes them. Provided + * profiling info is mature, the resulting graph is cached. + */ + private static StructuredGraph parseBytecodes(StructuredGraph newGraph, HighTierContext context, CanonicalizerPhase canonicalizer) { + final boolean hasMatureProfilingInfo = newGraph.method().getProfilingInfo().isMature(); if (context.getGraphBuilderSuite() != null) { context.getGraphBuilderSuite().apply(newGraph, context);