public interface NodePlugin extends GraphBuilderPlugin
| Modifier and Type | Method and Description |
|---|---|
default boolean |
canChangeStackKind(GraphBuilderContext b)
If the plugin
pushes a value with a different
JavaKind than specified by the bytecode, it must override this method and return
true. |
default org.graalvm.collections.Pair<ResolvedJavaMethod,ValueNode[]> |
convertInvokeDynamic(GraphBuilderContext b,
BootstrapMethodIntrospection m)
Converts an invoke dynamic (indy) call into a static call that passes the returned arguments.
|
default boolean |
handleCheckCast(GraphBuilderContext b,
ValueNode object,
ResolvedJavaType type,
JavaTypeProfile profile)
Handle the parsing of a CHECKCAST bytecode.
|
default boolean |
handleInstanceOf(GraphBuilderContext b,
ValueNode object,
ResolvedJavaType type,
JavaTypeProfile profile)
Handle the parsing of a INSTANCEOF bytecode.
|
default boolean |
handleInvoke(GraphBuilderContext b,
ResolvedJavaMethod method,
ValueNode[] args)
Handle the parsing of a method invocation bytecode to a method that can be bound statically.
|
default boolean |
handleLoadField(GraphBuilderContext b,
ValueNode object,
ResolvedJavaField field)
Handle the parsing of a GETFIELD bytecode.
|
default boolean |
handleLoadIndexed(GraphBuilderContext b,
ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
JavaKind elementKind)
Handle the parsing of an array load bytecode.
|
default boolean |
handleLoadStaticField(GraphBuilderContext b,
ResolvedJavaField field)
Handle the parsing of a GETSTATIC bytecode.
|
default boolean |
handleNewArray(GraphBuilderContext b,
ResolvedJavaType elementType,
ValueNode length)
Handle the parsing of a NEWARRAY and ANEWARRAY bytecode.
|
default boolean |
handleNewInstance(GraphBuilderContext b,
ResolvedJavaType type)
Handle the parsing of a NEW bytecode.
|
default boolean |
handleNewMultiArray(GraphBuilderContext b,
ResolvedJavaType type,
ValueNode[] dimensions)
Handle the parsing of a MULTIANEWARRAY bytecode.
|
default boolean |
handleStoreField(GraphBuilderContext b,
ValueNode object,
ResolvedJavaField field,
ValueNode value)
Handle the parsing of a PUTFIELD bytecode.
|
default boolean |
handleStoreIndexed(GraphBuilderContext b,
ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
GuardingNode storeCheck,
JavaKind elementKind,
ValueNode value)
Handle the parsing of an array store bytecode.
|
default boolean |
handleStoreStaticField(GraphBuilderContext b,
ResolvedJavaField field,
ValueNode value)
Handle the parsing of a PUTSTATIC bytecode.
|
default FixedWithNextNode |
instrumentExceptionDispatch(StructuredGraph graph,
FixedWithNextNode afterExceptionLoaded,
Supplier<FrameState> frameStateFunction)
Allows this plugin to add nodes after the exception object has been loaded in the dispatch
sequence.
|
default boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args)
push a value as the
result of the method invocation using the return kind of the
method.b - the contextmethod - the statically bound, invoked methodargs - the arguments of the method invocationdefault boolean handleLoadField(GraphBuilderContext b, ValueNode object, ResolvedJavaField field)
push a value using the
kind of the field.b - the contextobject - the receiver object for the field accessfield - the accessed fielddefault boolean handleLoadStaticField(GraphBuilderContext b, ResolvedJavaField field)
push a value using the
kind of the field.b - the contextfield - the accessed fielddefault boolean handleStoreField(GraphBuilderContext b, ValueNode object, ResolvedJavaField field, ValueNode value)
b - the contextobject - the receiver object for the field accessfield - the accessed fieldvalue - the value to be stored into the fielddefault boolean handleStoreStaticField(GraphBuilderContext b, ResolvedJavaField field, ValueNode value)
b - the contextfield - the accessed fieldvalue - the value to be stored into the fielddefault boolean handleLoadIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, GuardingNode boundsCheck, JavaKind elementKind)
push a value using the provided elementKind.b - the contextarray - the accessed arrayindex - the index for the array accessboundsCheck - the explicit bounds check already emitted, or null if no bounds check was
emitted yetelementKind - the element kind of the accessed arraydefault boolean handleStoreIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, GuardingNode boundsCheck, GuardingNode storeCheck, JavaKind elementKind, ValueNode value)
b - the contextarray - the accessed arrayindex - the index for the array accessboundsCheck - the explicit array bounds check already emitted, or null if no array
bounds check was emitted yetstoreCheck - the explicit array store check already emitted, or null if no array store
check was emitted yetelementKind - the element kind of the accessed arrayvalue - the value to be stored into the arraydefault boolean handleCheckCast(GraphBuilderContext b, ValueNode object, ResolvedJavaType type, JavaTypeProfile profile)
push a value with the result of the cast using
JavaKind.Object.b - the contextobject - the object to be type checkedtype - the type that the object is checked againstprofile - the profiling information for the type check, or null if no profiling
information is availabledefault boolean handleInstanceOf(GraphBuilderContext b, ValueNode object, ResolvedJavaType type, JavaTypeProfile profile)
push a value with the result of the instanceof using
JavaKind.Int.b - the contextobject - the object to be type checkedtype - the type that the object is checked againstprofile - the profiling information for the type check, or null if no profiling
information is availabledefault boolean handleNewInstance(GraphBuilderContext b, ResolvedJavaType type)
push a value with the result of the allocation using
JavaKind.Object.b - the contexttype - the type to be instantiateddefault boolean handleNewArray(GraphBuilderContext b, ResolvedJavaType elementType, ValueNode length)
push a value with the result of the allocation using
JavaKind.Object.b - the contextelementType - the element type of the array to be instantiatedlength - the length of the new arraydefault boolean handleNewMultiArray(GraphBuilderContext b, ResolvedJavaType type, ValueNode[] dimensions)
push a value with the result of the allocation using
JavaKind.Object.b - the contexttype - the type of the outermost array to be instantiateddimensions - the array of lengths for all the dimensions to be instantiateddefault org.graalvm.collections.Pair<ResolvedJavaMethod,ValueNode[]> convertInvokeDynamic(GraphBuilderContext b, BootstrapMethodIntrospection m)
b - the contextm - information about the indy's bootstrap methoddefault FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded, Supplier<FrameState> frameStateFunction)
StructuredGraph is provided to this call instead of a
GraphBuilderContext so that the caller has a guarantee that its current control flow
insertion point is not changed by this call. This means nodes must be added to the graph with
the appropriate method (e.g., Graph.unique(T) for Node.ValueNumberable
nodes) and fixed nodes must be manually added as
successors of afterExceptionLoaded.
The reason for this constraint is that when this plugin runs, it's inserting instructions
into a different block than the one currently being parsed.graph - the graph being parsedafterExceptionLoaded - the last fixed node after loading the exceptionframeStateFunction - a helper that produces a FrameState suitable for deoptdefault boolean canChangeStackKind(GraphBuilderContext b)
pushes a value with a different
JavaKind than specified by the bytecode, it must override this method and return
true. This disables assertion checking for value kinds.b - the context