src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
Print this page
*** 26,36 ****
import java.util.ArrayList;
import java.util.List;
import org.graalvm.compiler.core.common.type.Stamp;
! import org.graalvm.compiler.debug.Debug;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeInputList;
import org.graalvm.compiler.nodes.ConstantNode;
import org.graalvm.compiler.nodes.Invoke;
import org.graalvm.compiler.nodes.ParameterNode;
--- 26,36 ----
import java.util.ArrayList;
import java.util.List;
import org.graalvm.compiler.core.common.type.Stamp;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeInputList;
import org.graalvm.compiler.nodes.ConstantNode;
import org.graalvm.compiler.nodes.Invoke;
import org.graalvm.compiler.nodes.ParameterNode;
*** 67,77 ****
private FixedNodeProbabilityCache probabilites = new FixedNodeProbabilityCache();
public InlineableGraph(final ResolvedJavaMethod method, final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) {
StructuredGraph original = getOriginalGraph(method, context, canonicalizer, invoke.asNode().graph(), invoke.bci());
// TODO copying the graph is only necessary if it is modified or if it contains any invokes
! this.graph = (StructuredGraph) original.copy();
specializeGraphToArguments(invoke, context, canonicalizer);
}
/**
* This method looks up in a cache the graph for the argument, if not found bytecode is parsed.
--- 67,77 ----
private FixedNodeProbabilityCache probabilites = new FixedNodeProbabilityCache();
public InlineableGraph(final ResolvedJavaMethod method, final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) {
StructuredGraph original = getOriginalGraph(method, context, canonicalizer, invoke.asNode().graph(), invoke.bci());
// TODO copying the graph is only necessary if it is modified or if it contains any invokes
! this.graph = (StructuredGraph) original.copy(invoke.asNode().getDebug());
specializeGraphToArguments(invoke, context, canonicalizer);
}
/**
* This method looks up in a cache the graph for the argument, if not found bytecode is parsed.
*** 90,100 ****
* @return true iff one or more parameters <code>newGraph</code> were specialized to account for
* a constant argument, or an argument with a more specific stamp.
*/
@SuppressWarnings("try")
private boolean specializeGraphToArguments(final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) {
! try (Debug.Scope s = Debug.scope("InlineGraph", graph)) {
ArrayList<Node> parameterUsages = replaceParamsWithMoreInformativeArguments(invoke, context);
if (parameterUsages != null) {
assert !parameterUsages.isEmpty() : "The caller didn't have more information about arguments after all";
canonicalizer.applyIncremental(graph, context, parameterUsages);
--- 90,101 ----
* @return true iff one or more parameters <code>newGraph</code> were specialized to account for
* a constant argument, or an argument with a more specific stamp.
*/
@SuppressWarnings("try")
private boolean specializeGraphToArguments(final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) {
! DebugContext debug = graph.getDebug();
! try (DebugContext.Scope s = debug.scope("InlineGraph", graph)) {
ArrayList<Node> parameterUsages = replaceParamsWithMoreInformativeArguments(invoke, context);
if (parameterUsages != null) {
assert !parameterUsages.isEmpty() : "The caller didn't have more information about arguments after all";
canonicalizer.applyIncremental(graph, context, parameterUsages);
*** 105,115 ****
// probability to check the inlining
return false;
}
} catch (Throwable e) {
! throw Debug.handle(e);
}
}
private static boolean isArgMoreInformativeThanParam(ValueNode arg, ParameterNode param) {
return arg.isConstant() || canStampBeImproved(arg, param);
--- 106,116 ----
// probability to check the inlining
return false;
}
} catch (Throwable e) {
! throw debug.handle(e);
}
}
private static boolean isArgMoreInformativeThanParam(ValueNode arg, ParameterNode param) {
return arg.isConstant() || canStampBeImproved(arg, param);
*** 191,202 ****
* for cloning before modification.
* </p>
*/
@SuppressWarnings("try")
private static StructuredGraph parseBytecodes(ResolvedJavaMethod method, HighTierContext context, CanonicalizerPhase canonicalizer, StructuredGraph caller) {
! StructuredGraph newGraph = new StructuredGraph.Builder(caller.getOptions(), AllowAssumptions.ifNonNull(caller.getAssumptions())).method(method).build();
! try (Debug.Scope s = Debug.scope("InlineGraph", newGraph)) {
if (!caller.isUnsafeAccessTrackingEnabled()) {
newGraph.disableUnsafeAccessTracking();
}
if (context.getGraphBuilderSuite() != null) {
context.getGraphBuilderSuite().apply(newGraph, context);
--- 192,204 ----
* for cloning before modification.
* </p>
*/
@SuppressWarnings("try")
private static StructuredGraph parseBytecodes(ResolvedJavaMethod method, HighTierContext context, CanonicalizerPhase canonicalizer, StructuredGraph caller) {
! DebugContext debug = caller.getDebug();
! StructuredGraph newGraph = new StructuredGraph.Builder(caller.getOptions(), debug, AllowAssumptions.ifNonNull(caller.getAssumptions())).method(method).build();
! try (DebugContext.Scope s = debug.scope("InlineGraph", newGraph)) {
if (!caller.isUnsafeAccessTrackingEnabled()) {
newGraph.disableUnsafeAccessTracking();
}
if (context.getGraphBuilderSuite() != null) {
context.getGraphBuilderSuite().apply(newGraph, context);
*** 207,217 ****
canonicalizer.apply(newGraph, context);
return newGraph;
} catch (Throwable e) {
! throw Debug.handle(e);
}
}
@Override
public int getNodeCount() {
--- 209,219 ----
canonicalizer.apply(newGraph, context);
return newGraph;
} catch (Throwable e) {
! throw debug.handle(e);
}
}
@Override
public int getNodeCount() {
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File