hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java Fri Jul 07 10:37:52 2017 +0200
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java Fri Jul 07 09:40:47 2017 -0700
@@ -28,7 +28,7 @@
import java.util.List;
import org.graalvm.compiler.core.common.type.Stamp;
-import org.graalvm.compiler.debug.Debug;
+import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeInputList;
import org.graalvm.compiler.nodes.ConstantNode;
@@ -69,7 +69,7 @@
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();
+ this.graph = (StructuredGraph) original.copy(invoke.asNode().getDebug());
specializeGraphToArguments(invoke, context, canonicalizer);
}
@@ -92,7 +92,8 @@
*/
@SuppressWarnings("try")
private boolean specializeGraphToArguments(final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) {
- try (Debug.Scope s = Debug.scope("InlineGraph", graph)) {
+ DebugContext debug = graph.getDebug();
+ try (DebugContext.Scope s = debug.scope("InlineGraph", graph)) {
ArrayList<Node> parameterUsages = replaceParamsWithMoreInformativeArguments(invoke, context);
if (parameterUsages != null) {
@@ -107,7 +108,7 @@
}
} catch (Throwable e) {
- throw Debug.handle(e);
+ throw debug.handle(e);
}
}
@@ -193,8 +194,9 @@
*/
@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)) {
+ 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();
}
@@ -209,7 +211,7 @@
return newGraph;
} catch (Throwable e) {
- throw Debug.handle(e);
+ throw debug.handle(e);
}
}