# HG changeset patch # User Doug Simon # Date 1428176601 -7200 # Node ID a100c22edc3259b306fa07b7c2a11677d8a4e0ca # Parent c36ab3cd360c1d5dbc5217381b6fdeefc2898af1 removed some redundant GraphBuilderContext methods or gave them default implementations diff -r c36ab3cd360c -r a100c22edc32 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Sat Apr 04 19:52:26 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Sat Apr 04 21:43:21 2015 +0200 @@ -153,7 +153,7 @@ /** * Handles an invocation that a plugin determines can replace the original invocation (i.e., the * one for which the plugin was applied). This applies all standard graph builder processing to - * the replaced invocation including applying any relevant plugins to it. + * the replaced invocation including applying any relevant plugins. * * @param invokeKind the kind of the replacement invocation * @param targetMethod the target of the replacement invocation @@ -165,12 +165,17 @@ MetaAccessProvider getMetaAccess(); - Assumptions getAssumptions(); + default Assumptions getAssumptions() { + return getGraph().getAssumptions(); + } ConstantReflectionProvider getConstantReflection(); SnippetReflectionProvider getSnippetReflection(); + /** + * Gets the graph being constructed. + */ StructuredGraph getGraph(); /** @@ -208,7 +213,10 @@ * Gets the inline depth of this context. 0 implies this is the context for the compilation root * method. */ - int getDepth(); + default int getDepth() { + GraphBuilderContext parent = getParent(); + return parent == null ? 0 : 1 + parent.getDepth(); + } /** * Determines if the current parsing context is a snippet or method substitution. @@ -223,7 +231,5 @@ */ Replacement getReplacement(); - boolean eagerResolving(); - BailoutException bailout(String string); } diff -r c36ab3cd360c -r a100c22edc32 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Sat Apr 04 19:52:26 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Sat Apr 04 21:43:21 2015 +0200 @@ -2429,10 +2429,6 @@ return metaAccess; } - public Assumptions getAssumptions() { - return graph.getAssumptions(); - } - public void push(Kind kind, ValueNode value) { assert value.isAlive(); assert kind == kind.getStackKind(); @@ -2466,18 +2462,10 @@ return parent; } - public int getDepth() { - return parent == null ? 0 : 1 + parent.getDepth(); - } - public Replacement getReplacement() { return replacementContext; } - public boolean eagerResolving() { - return graphBuilderConfig.eagerResolving(); - } - @Override public String toString() { Formatter fmt = new Formatter(); diff -r c36ab3cd360c -r a100c22edc32 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 Sat Apr 04 19:52:26 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Sat Apr 04 21:43:21 2015 +0200 @@ -142,10 +142,6 @@ return providers.getMetaAccess(); } - public Assumptions getAssumptions() { - return graph.getAssumptions(); - } - public ConstantReflectionProvider getConstantReflection() { return providers.getConstantReflection(); } @@ -194,10 +190,6 @@ throw GraalInternalError.shouldNotReachHere(); } - public boolean eagerResolving() { - return true; - } - public BailoutException bailout(String string) { throw GraalInternalError.shouldNotReachHere(); }