# HG changeset patch # User Thomas Wuerthinger # Date 1423006293 -3600 # Node ID c4cb2ccd0b96680445a618715ac3258e92cee80a # Parent 46544f51cde45123f4c779acece1c03aff3b1b92 Move more logic from TruffleCache to PartialEvaluator. diff -r 46544f51cde4 -r c4cb2ccd0b96 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed Feb 04 00:20:29 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed Feb 04 00:31:33 2015 +0100 @@ -71,6 +71,7 @@ private final TruffleCache truffleCache; private final SnippetReflectionProvider snippetReflection; private final ResolvedJavaMethod callDirectMethod; + private final ResolvedJavaMethod callInlinedMethod; private final ResolvedJavaMethod callSiteProxyMethod; protected final ResolvedJavaMethod callRootMethod; private final GraphBuilderConfiguration configForRoot; @@ -81,6 +82,7 @@ this.snippetReflection = snippetReflection; this.truffleCache = truffleCache; this.callDirectMethod = providers.getMetaAccess().lookupJavaMethod(OptimizedCallTarget.getCallDirectMethod()); + this.callInlinedMethod = providers.getMetaAccess().lookupJavaMethod(OptimizedCallTarget.getCallInlinedMethod()); this.callSiteProxyMethod = providers.getMetaAccess().lookupJavaMethod(GraalFrameInstance.CallNodeFrame.METHOD); this.configForRoot = configForRoot; @@ -175,6 +177,12 @@ return graph; } + public StructuredGraph createInlineGraph(String name) { + StructuredGraph graph = new StructuredGraph(name, callInlinedMethod); + new GraphBuilderPhase.Instance(providers.getMetaAccess(), providers.getStampProvider(), new Assumptions(false), configForRoot, TruffleCompilerImpl.Optimizations).apply(graph); + return graph; + } + private static void postPartialEvaluation(final StructuredGraph graph) { NeverPartOfCompilationNode.verifyNotFoundIn(graph); for (MaterializeFrameNode materializeNode : graph.getNodes(MaterializeFrameNode.class).snapshot()) { @@ -480,7 +488,7 @@ private StructuredGraph createInlineGraph(PhaseContext phaseContext, Assumptions assumptions, TruffleInliningCache cache, TruffleInliningDecision decision) { try (Scope s = Debug.scope("GuestLanguageInlinedGraph", new DebugDumpScope(decision.getTarget().toString()))) { OptimizedCallTarget target = decision.getTarget(); - StructuredGraph inlineGraph = truffleCache.createInlineGraph(target.toString()); + StructuredGraph inlineGraph = createInlineGraph(target.toString()); injectConstantCallTarget(inlineGraph, decision.getTarget(), phaseContext); TruffleExpansionLogger expansionLogger = null; if (TraceTruffleExpansion.getValue()) { diff -r 46544f51cde4 -r c4cb2ccd0b96 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Wed Feb 04 00:20:29 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Wed Feb 04 00:31:33 2015 +0100 @@ -29,8 +29,6 @@ public interface TruffleCache { - StructuredGraph createInlineGraph(String name); - /** * Returns a cached graph for a method with given arguments. */ diff -r 46544f51cde4 -r c4cb2ccd0b96 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java Wed Feb 04 00:20:29 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java Wed Feb 04 00:31:33 2015 +0100 @@ -67,8 +67,6 @@ private final ResolvedJavaType errorClass; private final ResolvedJavaType controlFlowExceptionClass; - protected final ResolvedJavaMethod callInlinedMethod; - private long counter; public TruffleCacheImpl(Providers providers, GraphBuilderConfiguration config, OptimisticOptimizations optimisticOptimizations) { @@ -80,14 +78,6 @@ this.runtimeExceptionClass = providers.getMetaAccess().lookupJavaType(RuntimeException.class); this.errorClass = providers.getMetaAccess().lookupJavaType(Error.class); this.controlFlowExceptionClass = providers.getMetaAccess().lookupJavaType(ControlFlowException.class); - - this.callInlinedMethod = providers.getMetaAccess().lookupJavaMethod(OptimizedCallTarget.getCallInlinedMethod()); - } - - public StructuredGraph createInlineGraph(String name) { - StructuredGraph graph = new StructuredGraph(name, callInlinedMethod); - new GraphBuilderPhase.Instance(providers.getMetaAccess(), providers.getStampProvider(), new Assumptions(false), config, TruffleCompilerImpl.Optimizations).apply(graph); - return graph; } private static List computeCacheKey(ResolvedJavaMethod method, NodeInputList arguments) {