Mercurial > hg > graal-compiler
changeset 20165:a100c22edc32
removed some redundant GraphBuilderContext methods or gave them default implementations
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sat, 04 Apr 2015 21:43:21 +0200 |
parents | c36ab3cd360c |
children | 28a85fa57b27 |
files | graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java |
diffstat | 3 files changed, 11 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- 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); }
--- 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();
--- 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(); }