Mercurial > hg > truffle
changeset 15617:7988771f7191
[inlining] preparing to move depth-search utilities
author | Miguel Garcia <miguel.m.garcia@oracle.com> |
---|---|
date | Tue, 13 May 2014 15:05:36 +0200 |
parents | 58bf117e18d8 |
children | 64dc2584a3f0 |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 <code>newGraph</code> 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);