# HG changeset patch # User Doug Simon # Date 1428564515 -7200 # Node ID 2228b4368946a4854723d1b5c70fff14ea880cfc # Parent ce38ee1b67ab570f6b1f742bfd6ce214cf81ae51 decouple IntrinsicGraphBuilder from Providers diff -r ce38ee1b67ab -r 2228b4368946 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Thu Apr 09 09:17:04 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Thu Apr 09 09:28:35 2015 +0200 @@ -34,7 +34,6 @@ import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; -import com.oracle.graal.phases.util.*; /** * Implementation of {@link GraphBuilderContext} used to produce a graph for a method based on an @@ -42,7 +41,9 @@ */ public class IntrinsicGraphBuilder implements GraphBuilderContext, Receiver { - private final Providers providers; + private final MetaAccessProvider metaAccess; + private final ConstantReflectionProvider constantReflection; + private final StampProvider stampProvider; private final SnippetReflectionProvider snippetReflection; private final StructuredGraph graph; private final ResolvedJavaMethod method; @@ -50,8 +51,11 @@ private ValueNode[] arguments; private ValueNode returnValue; - public IntrinsicGraphBuilder(Providers providers, SnippetReflectionProvider snippetReflection, ResolvedJavaMethod method) { - this.providers = providers; + public IntrinsicGraphBuilder(MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection, StampProvider stampProvider, SnippetReflectionProvider snippetReflection, + ResolvedJavaMethod method) { + this.metaAccess = metaAccess; + this.constantReflection = constantReflection; + this.stampProvider = stampProvider; this.snippetReflection = snippetReflection; this.graph = new StructuredGraph(method, AllowAssumptions.YES); this.method = method; @@ -135,15 +139,15 @@ } public StampProvider getStampProvider() { - return providers.getStampProvider(); + return stampProvider; } public MetaAccessProvider getMetaAccess() { - return providers.getMetaAccess(); + return metaAccess; } public ConstantReflectionProvider getConstantReflection() { - return providers.getConstantReflection(); + return constantReflection; } public SnippetReflectionProvider getSnippetReflection() { diff -r ce38ee1b67ab -r 2228b4368946 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Thu Apr 09 09:17:04 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Thu Apr 09 09:28:35 2015 +0200 @@ -344,7 +344,7 @@ MethodSubstitutionPlugin msplugin = (MethodSubstitutionPlugin) plugin; substitute = msplugin.getSubstitute(providers.getMetaAccess()); } else if (plugin != null) { - StructuredGraph graph = new IntrinsicGraphBuilder(providers, snippetReflection, original).buildGraph(plugin); + StructuredGraph graph = new IntrinsicGraphBuilder(providers.getMetaAccess(), providers.getConstantReflection(), providers.getStampProvider(), snippetReflection, original).buildGraph(plugin); if (graph != null) { return graph; }