Class GraphOutput<G,M>

java.lang.Object
jdk.graal.compiler.graphio.GraphOutput<G,M>
Type Parameters:
G - the type of graph this instance handles
M - the type of methods this instance handles
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, WritableByteChannel

public final class GraphOutput<G,M> extends Object implements Closeable, WritableByteChannel
Instance of output to dump informations about a compiler compilations.
Since:
19.0 a WritableByteChannel is implemented
  • Field Details

    • ATTR_VM_ID

      public static final String ATTR_VM_ID
      Name of stream attribute to identify the VM execution, allows to join different GraphOutput streams. The value should be the same for all related GraphOutputs.
      Since:
      20.2.0
      See Also:
  • Method Details

    • newBuilder

      public static <G, N, C, P> GraphOutput.Builder<G,N,?> newBuilder(GraphStructure<G,N,C,P> structure)
      Creates new builder to configure a future instance of GraphOutput.
      Type Parameters:
      G - the type of the graph
      N - the type of the nodes
      C - the type of the node classes
      P - the type of the ports
      Parameters:
      structure - description of the structure of the graph
      Returns:
      the builder to configure
    • beginGroup

      public void beginGroup(G forGraph, String name, String shortName, M method, int bci, Map<? extends Object,? extends Object> properties) throws IOException
      Begins a compilation group.
      Parameters:
      forGraph -
      name -
      shortName -
      method -
      bci -
      properties -
      Throws:
      IOException
    • print

      public void print(G graph, Map<? extends Object,? extends Object> properties, int id, String format, Object... args) throws IOException
      Prints a single graph.
      Parameters:
      graph -
      properties -
      id -
      format -
      args -
      Throws:
      IOException
    • endGroup

      public void endGroup() throws IOException
      Ends compilation group.
      Throws:
      IOException
    • close

      public void close()
      Closes the output. Closes allocated resources and associated output channel.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Channel
      Specified by:
      close in interface Closeable
    • isOpen

      public boolean isOpen()
      Checks if the GraphOutput is open.
      Specified by:
      isOpen in interface Channel
      Returns:
      true if the GraphOutput is open.
      Since:
      19.0
    • write

      public int write(ByteBuffer src) throws IOException
      Writes raw bytes into GraphOutput.
      Specified by:
      write in interface WritableByteChannel
      Parameters:
      src - the bytes to write
      Returns:
      the number of bytes written, possibly zero
      Throws:
      IOException - in case of IO error
      Since:
      19.0