# HG changeset patch # User Miguel Garcia # Date 1401722853 -7200 # Node ID 9b9d0017168ca104e3991c3716b357be0df20a4e # Parent 2b79ddf41d2fcb9b1d1fe16d594e9c1280d660c6 [inliner] removed a method, lost nothing (but code is more readable afterwards) diff -r 2b79ddf41d2f -r 9b9d0017168c graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java Mon Jun 02 17:20:11 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java Mon Jun 02 17:27:33 2014 +0200 @@ -42,38 +42,27 @@ private final StructuredGraph graph; public InlineableGraph(final ResolvedJavaMethod method, final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) { - StructuredGraph original = buildGraph(method, context, canonicalizer); + StructuredGraph original = getOriginalGraph(method, context, canonicalizer); // TODO copying the graph is only necessary if it is modified or if it contains any invokes this.graph = original.copy(); specializeGraphToArguments(invoke, context, canonicalizer); } /** - * @return a (possibly cached) graph. The caller is responsible for cloning before modification. - */ - private static StructuredGraph getOriginalGraph(final ResolvedJavaMethod method, final HighTierContext context) { - StructuredGraph intrinsicGraph = InliningUtil.getIntrinsicGraph(context.getReplacements(), method); - if (intrinsicGraph != null) { - return intrinsicGraph; - } - StructuredGraph cachedGraph = getCachedGraph(method, context); - if (cachedGraph != null) { - return cachedGraph; - } - return null; - } - - /** * This method looks up in a cache the graph for the argument, if not found bytecode is parsed. * The graph thus obtained is returned, ie the caller is responsible for cloning before * modification. */ - private static StructuredGraph buildGraph(final ResolvedJavaMethod method, final HighTierContext context, CanonicalizerPhase canonicalizer) { - StructuredGraph result = getOriginalGraph(method, context); - if (result == null) { - result = parseBytecodes(method, context, canonicalizer); + private static StructuredGraph getOriginalGraph(final ResolvedJavaMethod method, final HighTierContext context, CanonicalizerPhase canonicalizer) { + StructuredGraph result = InliningUtil.getIntrinsicGraph(context.getReplacements(), method); + if (result != null) { + return result; } - return result; + result = getCachedGraph(method, context); + if (result != null) { + return result; + } + return parseBytecodes(method, context, canonicalizer); } /**