public class IntrinsicGraphBuilder extends CoreProvidersDelegate implements GraphBuilderContext, InvocationPlugin.Receiver
GraphBuilderContext used to produce a graph for a method based on an
InvocationPlugin for the method.GraphBuilderContext.ExternalInliningContext| Modifier and Type | Field and Description |
|---|---|
protected ValueNode[] |
arguments |
protected Bytecode |
code |
protected StructuredGraph |
graph |
protected int |
invokeBci |
protected FixedWithNextNode |
lastInstr |
protected ResolvedJavaMethod |
method |
protected ValueNode |
returnValue |
| Modifier | Constructor and Description |
|---|---|
|
IntrinsicGraphBuilder(OptionValues options,
DebugContext debug,
CoreProviders providers,
Bytecode code,
int invokeBci) |
|
IntrinsicGraphBuilder(OptionValues options,
DebugContext debug,
CoreProviders providers,
Bytecode code,
int invokeBci,
StructuredGraph.AllowAssumptions allowAssumptions) |
protected |
IntrinsicGraphBuilder(OptionValues options,
DebugContext debug,
CoreProviders providers,
Bytecode code,
int invokeBci,
StructuredGraph.AllowAssumptions allowAssumptions,
GraphBuilderConfiguration graphBuilderConfig) |
| Modifier and Type | Method and Description |
|---|---|
<T extends ValueNode> |
append(T v)
Adds the given node to the graph and also adds recursively all referenced inputs.
|
BailoutException |
bailout(String string) |
int |
bci()
Gets the index of the bytecode instruction currently being parsed.
|
StructuredGraph |
buildGraph(InvocationPlugin plugin) |
boolean |
canMergeIntrinsicReturns()
Some
InvocationPlugins have to build a MergeNode to handle
multiple return paths but not all contexts can do this. |
AbstractBeginNode |
genExplicitExceptionEdge(BytecodeExceptionNode.BytecodeExceptionKind exceptionKind,
ValueNode... exceptionArguments)
Generates an exception edge for the current bytecode.
|
ValueNode |
get(boolean performNullCheck)
Gets the receiver value, optionally null checking it first if necessary.
|
Bytecode |
getCode()
Gets the code being parsed.
|
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. |
FrameState |
getInvocationPluginBeforeState()
Build a FrameState that represents the represents the state before an intrinsic was invoked.
|
FrameState |
getInvocationPluginReturnState(JavaKind returnKind,
ValueNode retVal)
Build a FrameState that represents the return from an intrinsic with
returnValue on
the top of stack. |
CallTargetNode.InvokeKind |
getInvokeKind()
Gets the kind of invocation currently being parsed.
|
JavaType |
getInvokeReturnType()
Gets the return type of the invocation currently being parsed.
|
ResolvedJavaMethod |
getMethod()
Gets the method being parsed by this context.
|
GraphBuilderContext |
getParent()
Gets the parsing context for the method that inlines the method being parsed by this context.
|
Invoke |
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 |
handleReplacedInvoke(CallTargetNode callTarget,
JavaKind resultType) |
Invoke |
invokeFallback(FixedWithNextNode predecessor,
EndNode end) |
boolean |
isParsingInvocationPlugin() |
protected void |
mergeUnwinds()
If the graph contains multiple unwind nodes, then this method merges them into a single
unwind node containing a merged ExceptionNode.
|
boolean |
parsingIntrinsic()
Determines if this parsing context is within the bytecode of an intrinsic or a method inlined
by an intrinsic.
|
ValueNode |
pop(JavaKind slotKind)
Pops a value from the frame state stack using an explicit kind.
|
void |
push(JavaKind kind,
ValueNode value)
Pushes a given value to the frame state stack using an explicit kind.
|
protected void |
setExceptionState(StateSplit exceptionObject)
Currently unimplemented here, but implemented in subclasses that need it.
|
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.
|
String |
toString() |
getConstantFieldProvider, getConstantReflection, getForeignCalls, getLoopsDataProvider, getLowerer, getMetaAccess, getMetaAccessExtensionProvider, getPlatformConfigurationProvider, getProviders, getReplacements, getStampProvider, getWordVerificationclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addNonNullCast, addPush, allowDeoptInPlugins, bciCanBeDuplicated, emitBytecodeExceptionCheck, genCheckcastDynamic, getExternalInliningContext, getInvokeReturnStamp, getNonIntrinsicAncestor, intrinsicRangeCheck, isPluginEnabled, maskSubWordValue, maybeEmitExplicitDivisionByZeroCheck, maybeEmitExplicitNegativeArraySizeCheck, maybeEmitExplicitNegativeArraySizeCheck, needsExplicitException, nullCheckedValue, nullCheckedValue, popArguments, recursiveInliningDepth, replacePlugin, replacePluginWithExceptioncanDeferPlugin, getAssumptions, getDebug, getOptions, shouldDeferPlugingetConstantFieldProvider, getConstantReflection, getForeignCalls, getLoopsDataProvider, getLowerer, getMetaAccess, getMetaAccessExtensionProvider, getPlatformConfigurationProvider, getReplacements, getStampProvider, getWordVerificationget, isConstantprotected final StructuredGraph graph
protected final Bytecode code
protected final ResolvedJavaMethod method
protected final int invokeBci
protected FixedWithNextNode lastInstr
protected ValueNode[] arguments
protected ValueNode returnValue
public IntrinsicGraphBuilder(OptionValues options, DebugContext debug, CoreProviders providers, Bytecode code, int invokeBci)
public IntrinsicGraphBuilder(OptionValues options, DebugContext debug, CoreProviders providers, Bytecode code, int invokeBci, StructuredGraph.AllowAssumptions allowAssumptions)
protected IntrinsicGraphBuilder(OptionValues options, DebugContext debug, CoreProviders providers, Bytecode code, int invokeBci, StructuredGraph.AllowAssumptions allowAssumptions, GraphBuilderConfiguration graphBuilderConfig)
public AbstractBeginNode genExplicitExceptionEdge(BytecodeExceptionNode.BytecodeExceptionKind exceptionKind, ValueNode... exceptionArguments)
GraphBuilderContextGraphBuilderContext.needsExplicitException()
returns true, this method should return non-null begin nodes.genExplicitExceptionEdge in interface GraphBuilderContextexceptionKind - the type of exception to be created.exceptionArguments - the arguments for the exception.protected void setExceptionState(StateSplit exceptionObject)
exceptionObject - The node that needs an exception state.protected void mergeUnwinds()
public <T extends ValueNode> T append(T v)
GraphBuilderToolappend in interface GraphBuilderToolv - the node to be added to the graphpublic void push(JavaKind kind,
ValueNode value)
GraphBuilderContextvalue.getJavaKind() is different from the kind that the bytecode instruction
currently being parsed pushes to the stack.push in interface GraphBuilderContextkind - the kind to use when type checking this operationvalue - the value to push to the stack. The value must already have been
appended.public ValueNode pop(JavaKind slotKind)
GraphBuilderContextpop in interface GraphBuilderContextslotKind - the kind to use when type checking this operationpublic Invoke handleReplacedInvoke(CallTargetNode.InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args, boolean forceInlineEverything)
GraphBuilderContexthandleReplacedInvoke in interface GraphBuilderContextinvokeKind - 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 inlinedpublic void handleReplacedInvoke(CallTargetNode callTarget, JavaKind resultType)
handleReplacedInvoke in interface GraphBuilderContextpublic StructuredGraph getGraph()
GraphBuilderToolgetGraph in interface GraphBuilderToolpublic void setStateAfter(StateSplit sideEffect)
GraphBuilderContextsetStateAfter in interface GraphBuilderContextsideEffect - a side effect node just appended to the graphpublic GraphBuilderContext getParent()
GraphBuilderContextgetParent in interface GraphBuilderContextpublic Bytecode getCode()
GraphBuilderContextgetCode in interface GraphBuilderContextpublic ResolvedJavaMethod getMethod()
GraphBuilderContextgetMethod in interface GraphBuilderContextpublic int bci()
GraphBuilderContextbci in interface GraphBuilderContextpublic CallTargetNode.InvokeKind getInvokeKind()
GraphBuilderContextgetInvokeKind in interface GraphBuilderContextpublic JavaType getInvokeReturnType()
GraphBuilderContextgetInvokeReturnType in interface GraphBuilderContextpublic int getDepth()
GraphBuilderContextgetDepth in interface GraphBuilderContextpublic boolean parsingIntrinsic()
GraphBuilderContextparsingIntrinsic in interface GraphBuilderContextparsingIntrinsic in interface GraphBuilderToolpublic IntrinsicContext getIntrinsic()
GraphBuilderContextnull if not
parsing an intrinsic.getIntrinsic in interface GraphBuilderContextpublic BailoutException bailout(String string)
bailout in interface GraphBuilderContextpublic ValueNode get(boolean performNullCheck)
InvocationPlugin.Receiverget in interface InvocationPlugin.Receiverpublic final StructuredGraph buildGraph(InvocationPlugin plugin)
public FrameState getInvocationPluginReturnState(JavaKind returnKind, ValueNode retVal)
GraphBuilderContextreturnValue on
the top of stack. Usually this will be a state in the caller after the call site.getInvocationPluginReturnState in interface GraphBuilderContextpublic FrameState getInvocationPluginBeforeState()
GraphBuilderContextgetInvocationPluginBeforeState in interface GraphBuilderContextpublic boolean canMergeIntrinsicReturns()
GraphBuilderContextInvocationPlugins have to build a MergeNode to handle
multiple return paths but not all contexts can do this.canMergeIntrinsicReturns in interface GraphBuilderContextGraphBuilderContext.getInvocationPluginReturnState(JavaKind, ValueNode) cannot be
called (i.e. it unconditionally raises an error)public boolean isParsingInvocationPlugin()
isParsingInvocationPlugin in interface GraphBuilderContextpublic Invoke invokeFallback(FixedWithNextNode predecessor, EndNode end)
invokeFallback in interface GraphBuilderContext