src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java Fri Jul 7 09:31:22 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java Fri Jul 7 09:31:22 2017
*** 39,49 ****
--- 39,49 ----
import org.graalvm.compiler.core.common.Fields;
import org.graalvm.compiler.core.common.PermanentBailoutException;
import org.graalvm.compiler.core.common.util.TypeReader;
import org.graalvm.compiler.core.common.util.UnsafeArrayTypeReader;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.GraalError;
import org.graalvm.compiler.graph.Edges;
import org.graalvm.compiler.graph.Graph;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeBitMap;
*** 59,68 ****
--- 59,69 ----
import org.graalvm.compiler.nodes.GraphDecoder.MethodScope;
import org.graalvm.compiler.nodes.GraphDecoder.ProxyPlaceholder;
import org.graalvm.compiler.nodes.calc.FloatingNode;
import org.graalvm.compiler.nodes.extended.IntegerSwitchNode;
import org.graalvm.compiler.nodes.graphbuilderconf.LoopExplosionPlugin.LoopExplosionKind;
+ import org.graalvm.compiler.options.OptionValues;
import org.graalvm.util.EconomicMap;
import org.graalvm.util.EconomicSet;
import org.graalvm.util.Equivalence;
import jdk.vm.ci.code.Architecture;
*** 339,365 ****
--- 340,371 ----
}
protected final Architecture architecture;
/** The target graph where decoded nodes are added to. */
protected final StructuredGraph graph;
+ protected final OptionValues options;
+ protected final DebugContext debug;
+
private final EconomicMap<NodeClass<?>, ArrayDeque<Node>> reusableFloatingNodes;
public GraphDecoder(Architecture architecture, StructuredGraph graph) {
this.architecture = architecture;
this.graph = graph;
+ this.options = graph.getOptions();
+ this.debug = graph.getDebug();
reusableFloatingNodes = EconomicMap.create(Equivalence.IDENTITY);
}
@SuppressWarnings("try")
public final void decode(EncodedGraph encodedGraph) {
! try (Debug.Scope scope = Debug.scope("GraphDecoder", graph)) {
! try (DebugContext.Scope scope = debug.scope("GraphDecoder", graph)) {
MethodScope methodScope = new MethodScope(null, graph, encodedGraph, LoopExplosionKind.NONE);
decode(createInitialLoopScope(methodScope, null));
cleanupGraph(methodScope);
assert graph.verify();
} catch (Throwable ex) {
! Debug.handle(ex);
! debug.handle(ex);
}
}
protected final LoopScope createInitialLoopScope(MethodScope methodScope, FixedWithNextNode startNode) {
LoopScope loopScope = new LoopScope(methodScope);
*** 1353,1363 ****
--- 1359,1370 ----
this.methodScope = methodScope;
}
@Override
public void run() {
! Debug.dump(Debug.DETAILED_LEVEL, graph, "Before loop detection");
! DebugContext debug = graph.getDebug();
+ debug.dump(DebugContext.DETAILED_LEVEL, graph, "Before loop detection");
List<Loop> orderedLoops = findLoops();
assert orderedLoops.get(orderedLoops.size() - 1) == irreducibleLoopHandler : "outermost loop must be the last element in the list";
for (Loop loop : orderedLoops) {
*** 1376,1390 ****
--- 1383,1397 ----
if (loop.irreducible) {
handleIrreducibleLoop(loop);
} else {
insertLoopNodes(loop);
}
! Debug.dump(Debug.DETAILED_LEVEL, graph, "After handling of loop %s", loop.header);
! debug.dump(DebugContext.DETAILED_LEVEL, graph, "After handling of loop %s", loop.header);
}
logIrreducibleLoops();
! Debug.dump(Debug.DETAILED_LEVEL, graph, "After loop detection");
! debug.dump(DebugContext.DETAILED_LEVEL, graph, "After loop detection");
}
private List<Loop> findLoops() {
/* Mapping from the loop header node to additional loop information. */
EconomicMap<MergeNode, Loop> unorderedLoops = EconomicMap.create(Equivalence.IDENTITY);
*** 1907,1924 ****
--- 1914,1932 ----
/**
* Print information about irreducible loops, when enabled with -Dgraal.Log=IrreducibleLoops.
*/
@SuppressWarnings("try")
private void logIrreducibleLoops() {
try (Debug.Scope s = Debug.scope("IrreducibleLoops")) {
! if (Debug.isLogEnabled(Debug.BASIC_LEVEL) && irreducibleLoopSwitch != null) {
+ DebugContext debug = graph.getDebug();
! try (DebugContext.Scope s = debug.scope("IrreducibleLoops")) {
+ if (debug.isLogEnabled(DebugContext.BASIC_LEVEL) && irreducibleLoopSwitch != null) {
StringBuilder msg = new StringBuilder("Inserted state machine to remove irreducible loops. Dispatching to the following states: ");
String sep = "";
for (int i = 0; i < irreducibleLoopSwitch.keyCount(); i++) {
msg.append(sep).append(irreducibleLoopSwitch.keyAt(i).asInt());
sep = ", ";
}
! Debug.log(Debug.BASIC_LEVEL, "%s", msg);
! debug.log(DebugContext.BASIC_LEVEL, "%s", msg);
}
}
}
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File