src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.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.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
Print this page
*** 30,41 ****
import java.util.Map.Entry;
import java.util.Set;
import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
import org.graalvm.compiler.bytecode.BytecodeDisassembler;
! import org.graalvm.compiler.debug.GraalDebugConfig.Options;
! import org.graalvm.compiler.debug.internal.DebugScope;
import org.graalvm.compiler.graph.Graph;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeMap;
import org.graalvm.compiler.graph.Position;
import org.graalvm.compiler.nodeinfo.Verbosity;
--- 30,41 ----
import java.util.Map.Entry;
import java.util.Set;
import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
import org.graalvm.compiler.bytecode.BytecodeDisassembler;
! import org.graalvm.compiler.debug.DebugContext;
! import org.graalvm.compiler.debug.DebugOptions;
import org.graalvm.compiler.graph.Graph;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeMap;
import org.graalvm.compiler.graph.Position;
import org.graalvm.compiler.nodeinfo.Verbosity;
*** 48,57 ****
--- 48,58 ----
import org.graalvm.compiler.nodes.StateSplit;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult;
import org.graalvm.compiler.nodes.cfg.Block;
import org.graalvm.compiler.nodes.cfg.ControlFlowGraph;
+ import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.phases.schedule.SchedulePhase;
import org.graalvm.util.EconomicSet;
import org.graalvm.util.Equivalence;
import jdk.vm.ci.meta.ResolvedJavaMethod;
*** 61,100 ****
* <a href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
*/
public class IdealGraphPrinter extends BasicIdealGraphPrinter implements GraphPrinter {
private final boolean tryToSchedule;
! private SnippetReflectionProvider snippetReflection;
/**
* Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
*
* @param tryToSchedule If false, no scheduling is done, which avoids exceptions for
* non-schedulable graphs.
*/
! public IdealGraphPrinter(OutputStream stream, boolean tryToSchedule) {
super(stream);
this.begin();
this.tryToSchedule = tryToSchedule;
}
@Override
- public void setSnippetReflectionProvider(SnippetReflectionProvider snippetReflection) {
- this.snippetReflection = snippetReflection;
- }
-
- @Override
public SnippetReflectionProvider getSnippetReflectionProvider() {
return snippetReflection;
}
/**
* Starts a new group of graphs with the given name, short name and method byte code index (BCI)
* as properties.
*/
@Override
! public void beginGroup(String name, String shortName, ResolvedJavaMethod method, int bci, Map<Object, Object> properties) {
beginGroup();
beginProperties();
printProperty("name", name);
if (properties != null) {
for (Entry<Object, Object> entry : properties.entrySet()) {
--- 62,97 ----
* <a href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
*/
public class IdealGraphPrinter extends BasicIdealGraphPrinter implements GraphPrinter {
private final boolean tryToSchedule;
! private final SnippetReflectionProvider snippetReflection;
/**
* Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
*
* @param tryToSchedule If false, no scheduling is done, which avoids exceptions for
* non-schedulable graphs.
*/
! public IdealGraphPrinter(OutputStream stream, boolean tryToSchedule, SnippetReflectionProvider snippetReflection) {
super(stream);
+ this.snippetReflection = snippetReflection;
this.begin();
this.tryToSchedule = tryToSchedule;
}
@Override
public SnippetReflectionProvider getSnippetReflectionProvider() {
return snippetReflection;
}
/**
* Starts a new group of graphs with the given name, short name and method byte code index (BCI)
* as properties.
*/
@Override
! public void beginGroup(DebugContext debug, String name, String shortName, ResolvedJavaMethod method, int bci, Map<Object, Object> properties) {
beginGroup();
beginProperties();
printProperty("name", name);
if (properties != null) {
for (Entry<Object, Object> entry : properties.entrySet()) {
*** 112,133 ****
/**
* Prints an entire {@link Graph} with the specified title, optionally using short names for
* nodes.
*/
@Override
! public void print(Graph graph, Map<Object, Object> properties, int id, String format, Object... args) {
! String title = formatTitle(id, format, args);
beginGraph(title);
EconomicSet<Node> noBlockNodes = EconomicSet.create(Equivalence.IDENTITY);
ScheduleResult schedule = null;
if (graph instanceof StructuredGraph) {
StructuredGraph structuredGraph = (StructuredGraph) graph;
schedule = structuredGraph.getLastSchedule();
if (schedule == null && tryToSchedule) {
! if (Options.PrintGraphWithSchedule.getValue(DebugScope.getConfig().getOptions())) {
try {
! SchedulePhase schedulePhase = new SchedulePhase(graph.getOptions());
schedulePhase.apply(structuredGraph);
schedule = structuredGraph.getLastSchedule();
} catch (Throwable t) {
}
}
--- 109,131 ----
/**
* Prints an entire {@link Graph} with the specified title, optionally using short names for
* nodes.
*/
@Override
! public void print(DebugContext debug, Graph graph, Map<Object, Object> properties, int id, String format, Object... args) {
! String title = id + ": " + String.format(format, simplifyClassArgs(args));
beginGraph(title);
EconomicSet<Node> noBlockNodes = EconomicSet.create(Equivalence.IDENTITY);
ScheduleResult schedule = null;
if (graph instanceof StructuredGraph) {
StructuredGraph structuredGraph = (StructuredGraph) graph;
schedule = structuredGraph.getLastSchedule();
if (schedule == null && tryToSchedule) {
! OptionValues options = graph.getOptions();
! if (DebugOptions.PrintGraphWithSchedule.getValue(options)) {
try {
! SchedulePhase schedulePhase = new SchedulePhase(options);
schedulePhase.apply(structuredGraph);
schedule = structuredGraph.getLastSchedule();
} catch (Throwable t) {
}
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File