public interface GraphBuilderContext
GraphBuilderPlugin
to interface with an object that parses the bytecode of a
single method as part of building a graph .Modifier and Type | Method and Description |
---|---|
default <T extends ValueNode> |
add(T value)
Adds a node to the graph.
|
default <T extends ValueNode> |
addPush(Kind kind,
T value)
Adds a node with a non-void kind to the graph, pushes it to the stack.
|
<T extends ValueNode> |
append(T value)
Raw operation for adding a node to the graph when neither
add(T) nor
addPush(Kind, ValueNode) can be used. |
BailoutException |
bailout(String string) |
int |
bci()
Gets the index of the bytecode instruction currently being parsed.
|
default Assumptions |
getAssumptions() |
ConstantReflectionProvider |
getConstantReflection() |
default int |
getDepth()
Gets the inline depth of this context.
|
StructuredGraph |
getGraph()
Gets the graph being constructed.
|
IntrinsicContext |
getIntrinsic()
Gets the intrinsic of the current parsing context or
null if not
parsing an intrinsic . |
CallTargetNode.InvokeKind |
getInvokeKind()
Gets the kind of invocation currently being parsed.
|
default Stamp |
getInvokeReturnStamp() |
JavaType |
getInvokeReturnType()
Gets the return type of the invocation currently being parsed.
|
MetaAccessProvider |
getMetaAccess() |
ResolvedJavaMethod |
getMethod()
Gets the method being parsed by this context.
|
default GraphBuilderContext |
getNonIntrinsicAncestor()
Gets the first ancestor parsing context that is not parsing a
intrinsic.
|
GraphBuilderContext |
getParent()
Gets the parsing context for the method that inlines the method being parsed by this context.
|
StampProvider |
getStampProvider() |
void |
handleReplacedInvoke(CallTargetNode.InvokeKind invokeKind,
ResolvedJavaMethod targetMethod,
ValueNode[] args,
boolean forceInlineEverything)
Handles an invocation that a plugin determines can replace the original invocation (i.e., the
one for which the plugin was applied).
|
void |
intrinsify(ResolvedJavaMethod targetMethod,
ResolvedJavaMethod substitute,
ValueNode[] args)
Intrinsifies an invocation of a given method by inlining the bytecodes of a given
substitution method.
|
default ValueNode |
nullCheckedValue(ValueNode value)
Gets a version of a given value that has a non-null stamp.
|
default boolean |
parsingIntrinsic()
Determines if this parsing context is within the bytecode of an intrinsic or a method inlined
by an intrinsic.
|
void |
push(Kind kind,
ValueNode value)
Pushes a given value to the frame state stack using an explicit kind.
|
<T extends ValueNode> |
recursiveAppend(T value)
Adds the given node to the graph and also adds recursively all referenced inputs.
|
void |
setStateAfter(StateSplit sideEffect)
Creates a snap shot of the current frame state with the BCI of the instruction after the one
currently being parsed and assigns it to a given side
effect node.
|
<T extends ValueNode> T append(T value)
add(T)
nor
addPush(Kind, ValueNode)
can be used.<T extends ValueNode> T recursiveAppend(T value)
value
- the node to be added to the graphvoid push(Kind kind, ValueNode value)
value.getKind()
is different from the kind that the bytecode instruction
currently being parsed pushes to the stack.kind
- the kind to use when type checking this operationvalue
- the value to push to the stack. The value must already have been
appended.default <T extends ValueNode> T add(T value)
StateSplit
with a null
frame state, the frame state is initialized.value
- the value to add to the graph and push to the stack. The value.getKind()
kind is used when type checking this operation.value
in the graphdefault <T extends ValueNode> T addPush(Kind kind, T value)
StateSplit
with a null frame state, the
frame state is initialized.kind
- the kind to use when type checking this operationvalue
- the value to add to the graph and push to the stackvalue
in the graphvoid handleReplacedInvoke(CallTargetNode.InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args, boolean forceInlineEverything)
invokeKind
- the kind of the replacement invocationtargetMethod
- the target of the replacement invocationargs
- the arguments to the replacement invocationforceInlineEverything
- specifies if all invocations encountered in the scope of
handling the replaced invoke are to be force inlinedvoid intrinsify(ResolvedJavaMethod targetMethod, ResolvedJavaMethod substitute, ValueNode[] args)
targetMethod
- the method being intrinsifiedsubstitute
- the intrinsic implementationargs
- the arguments with which to inline the invocationStampProvider getStampProvider()
MetaAccessProvider getMetaAccess()
default Assumptions getAssumptions()
ConstantReflectionProvider getConstantReflection()
StructuredGraph getGraph()
void setStateAfter(StateSplit sideEffect)
sideEffect
- a side effect node just appended to the graphGraphBuilderContext getParent()
default GraphBuilderContext getNonIntrinsicAncestor()
ResolvedJavaMethod getMethod()
int bci()
CallTargetNode.InvokeKind getInvokeKind()
JavaType getInvokeReturnType()
default Stamp getInvokeReturnStamp()
default int getDepth()
default boolean parsingIntrinsic()
IntrinsicContext getIntrinsic()
null
if not
parsing an intrinsic
.BailoutException bailout(String string)
default ValueNode nullCheckedValue(ValueNode value)