74 import org.graalvm.graphio.GraphStructure;
75 import org.graalvm.graphio.GraphTypes;
76
77 import jdk.vm.ci.meta.JavaType;
78 import jdk.vm.ci.meta.ResolvedJavaField;
79 import jdk.vm.ci.meta.ResolvedJavaMethod;
80 import jdk.vm.ci.meta.Signature;
81
82 public class BinaryGraphPrinter implements
83 GraphStructure<BinaryGraphPrinter.GraphInfo, Node, NodeClass<?>, Edges>,
84 GraphBlocks<BinaryGraphPrinter.GraphInfo, Block, Node>,
85 GraphElements<ResolvedJavaMethod, ResolvedJavaField, Signature, NodeSourcePosition>,
86 GraphLocations<ResolvedJavaMethod, NodeSourcePosition, SourceLanguagePosition>,
87 GraphTypes, GraphPrinter {
88 private final SnippetReflectionProvider snippetReflection;
89 private final GraphOutput<BinaryGraphPrinter.GraphInfo, ResolvedJavaMethod> output;
90
91 public BinaryGraphPrinter(DebugContext ctx, SnippetReflectionProvider snippetReflection) throws IOException {
92 // @formatter:off
93 this.output = ctx.buildOutput(GraphOutput.newBuilder(this).
94 protocolVersion(6, 0).
95 blocks(this).
96 elementsAndLocations(this, this).
97 types(this)
98 );
99 // @formatter:on
100 this.snippetReflection = snippetReflection;
101 }
102
103 @Override
104 public SnippetReflectionProvider getSnippetReflectionProvider() {
105 return snippetReflection;
106 }
107
108 @Override
109 public void beginGroup(DebugContext debug, String name, String shortName, ResolvedJavaMethod method, int bci, Map<Object, Object> properties) throws IOException {
110 output.beginGroup(new GraphInfo(debug, null), name, shortName, method, bci, DebugContext.addVersionProperties(properties));
111 }
112
113 @Override
114 public void endGroup() throws IOException {
|
74 import org.graalvm.graphio.GraphStructure;
75 import org.graalvm.graphio.GraphTypes;
76
77 import jdk.vm.ci.meta.JavaType;
78 import jdk.vm.ci.meta.ResolvedJavaField;
79 import jdk.vm.ci.meta.ResolvedJavaMethod;
80 import jdk.vm.ci.meta.Signature;
81
82 public class BinaryGraphPrinter implements
83 GraphStructure<BinaryGraphPrinter.GraphInfo, Node, NodeClass<?>, Edges>,
84 GraphBlocks<BinaryGraphPrinter.GraphInfo, Block, Node>,
85 GraphElements<ResolvedJavaMethod, ResolvedJavaField, Signature, NodeSourcePosition>,
86 GraphLocations<ResolvedJavaMethod, NodeSourcePosition, SourceLanguagePosition>,
87 GraphTypes, GraphPrinter {
88 private final SnippetReflectionProvider snippetReflection;
89 private final GraphOutput<BinaryGraphPrinter.GraphInfo, ResolvedJavaMethod> output;
90
91 public BinaryGraphPrinter(DebugContext ctx, SnippetReflectionProvider snippetReflection) throws IOException {
92 // @formatter:off
93 this.output = ctx.buildOutput(GraphOutput.newBuilder(this).
94 protocolVersion(6, 1).
95 blocks(this).
96 elementsAndLocations(this, this).
97 types(this)
98 );
99 // @formatter:on
100 this.snippetReflection = snippetReflection;
101 }
102
103 @Override
104 public SnippetReflectionProvider getSnippetReflectionProvider() {
105 return snippetReflection;
106 }
107
108 @Override
109 public void beginGroup(DebugContext debug, String name, String shortName, ResolvedJavaMethod method, int bci, Map<Object, Object> properties) throws IOException {
110 output.beginGroup(new GraphInfo(debug, null), name, shortName, method, bci, DebugContext.addVersionProperties(properties));
111 }
112
113 @Override
114 public void endGroup() throws IOException {
|