Package jdk.graal.compiler.graphio
Class GraphOutput.Builder<G,N,M>
java.lang.Object
jdk.graal.compiler.graphio.GraphOutput.Builder<G,N,M>
- Type Parameters:
G
- the type of the (root element of) graphN
- the type of the nodesM
- the type of the methods
- Enclosing class:
GraphOutput<G,
M>
Builder to configure and create an instance of
GraphOutput
.-
Method Summary
Modifier and TypeMethodDescriptionAttaches metadata to the dump.blocks
(GraphBlocks<G, ?, N> graphBlocks) Associates implementation of blocks.build
(WritableByteChannel channel) Creates newGraphOutput
to output to provided channel.build
(GraphOutput<?, ?> parent) Support for nesting heterogenous graphs.<E,
P> GraphOutput.Builder <G, N, E> elements
(GraphElements<E, ?, ?, P> graphElements) Associates implementation of graph elements.<E,
P> GraphOutput.Builder <G, N, E> elementsAndLocations
(GraphElements<E, ?, ?, P> graphElements, GraphLocations<E, P, ?> graphLocations) Associates implementation of graph elements and an advanced way to interpret their locations.embedded
(boolean embedded) SetsGraphOutput
as embedded.protocolVersion
(int majorVersion, int minorVersion) Chooses which version of the protocol to use.types
(GraphTypes graphTypes) Associates different implementation of types.
-
Method Details
-
protocolVersion
Chooses which version of the protocol to use. The default version is7.0
(when theGraphOutput
& co. classes were introduced). The default can be changed to other known versions manually by calling this method.Note: the the default version is 7.0 since version 20.2. Previous versions used default version 4.0
- Parameters:
majorVersion
- by default 7, newer version may be knownminorVersion
- usually 0- Returns:
- this builder
- Since:
- 0.28
-
embedded
SetsGraphOutput
as embedded. The embeddedGraphOutput
shareschannel
with another already open non parentGraphOutput
. The embeddedGraphOutput
flushes data after eachprint
,beginGroup
andendGroup
call.- Parameters:
embedded
- iftrue
the builder creates an embeddedGraphOutput
- Returns:
- this builder
- Since:
- 19.0
-
types
Associates different implementation of types.- Parameters:
graphTypes
- implementation of types and enum recognition- Returns:
- this builder
-
blocks
Associates implementation of blocks.- Parameters:
graphBlocks
- the blocks implementation- Returns:
- this builder
-
elements
Associates implementation of graph elements.- Parameters:
graphElements
- the elements implementation- Returns:
- this builder
-
elementsAndLocations
public <E,P> GraphOutput.Builder<G,N, elementsAndLocationsE> (GraphElements<E, ?, ?, P> graphElements, GraphLocations<E, P, ?> graphLocations) Associates implementation of graph elements and an advanced way to interpret their locations.- Parameters:
graphElements
- the elements implementationgraphLocations
- the locations for the elements- Returns:
- this builder
- Since:
- 0.33 GraalVM 0.33
-
attr
Attaches metadata to the dump. The method may be called more times, subsequent calls will overwrite previous values of matching keys.- Parameters:
name
- key namevalue
- value for the key- Returns:
- this builder
- Since:
- 20.1.0
-
build
Creates newGraphOutput
to output to provided channel. The output will use interfaces currently associated with this builder.- Parameters:
channel
- the channel to output to- Returns:
- new graph output
- Throws:
IOException
- if something goes wrong when writing to the channel
-
build
Support for nesting heterogenous graphs. The newly created output uses all the interfaces currently associated with this builder, but shares withparent
the outputchannel
, internal constant pool andprotocol version
.Both GraphOutput (the
parent
and the returned one) has to be used in synchronization - e.g. only onebegin
,end
of group orprinting
can be on at a given moment.- Parameters:
parent
- the output to inheritchannel
and protocol version from- Returns:
- new output sharing
channel
and other internals withparent
-