public class BytecodeParser extends CoreProvidersDelegate implements GraphBuilderContext
GraphBuilder class parses the bytecode of a method and builds the IR graph.| Modifier and Type | Class and Description |
|---|---|
static class |
BytecodeParser.BytecodeParserError |
protected static class |
BytecodeParser.ExceptionEdgeAction
Describes what should be done with the exception edge of an invocation.
|
protected static class |
BytecodeParser.ReturnToCallerData |
GraphBuilderContext.ExternalInliningContext| Modifier | Constructor and Description |
|---|---|
protected |
BytecodeParser(GraphBuilderPhase.Instance graphBuilderInstance,
StructuredGraph graph,
BytecodeParser parent,
ResolvedJavaMethod method,
int entryBCI,
IntrinsicContext intrinsicContext) |
| 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.
|
protected ConstantNode |
appendConstant(JavaConstant constant) |
protected void |
appendGoto(BciBlockMapping.BciBlock successor) |
protected Invoke |
appendInvoke(CallTargetNode.InvokeKind initialInvokeKind,
ResolvedJavaMethod initialTargetMethod,
ValueNode[] args) |
protected boolean |
applyInvocationPlugin(CallTargetNode.InvokeKind invokeKind,
ValueNode[] args,
ResolvedJavaMethod targetMethod,
JavaKind resultType,
InvocationPlugin plugin) |
protected boolean |
asyncExceptionLiveness()
Return true if the
local liveness calculation should consider async
exceptions that might occur at any bci covered by an exception handler. |
BailoutException |
bailout(String string) |
int |
bci()
Gets the index of the bytecode instruction currently being parsed.
|
boolean |
bciCanBeDuplicated() |
protected void |
build(FixedWithNextNode startInstruction,
FrameStateBuilder startFrameState) |
protected void |
buildRootMethod() |
protected boolean |
canInlinePartialIntrinsicExit()
Determines if a partial intrinsic exit (i.e., a call to the original method within an
intrinsic) can be inlined.
|
boolean |
canMergeIntrinsicReturns()
Some
InvocationPlugins have to build a MergeNode to handle
multiple return paths but not all contexts can do this. |
protected boolean |
checkLastInstruction() |
protected void |
cleanupFinalGraph() |
protected void |
clearNonLiveLocalsAtLoopExitCreation(BciBlockMapping.BciBlock block,
FrameStateBuilder state)
Because LoopExitNodes do not have a unique bci, in some native-image configurations it is not
possible to clear non-live locals before generating these nodes.
|
protected void |
clearNonLiveLocalsAtTargetCreation(BciBlockMapping.BciBlock block,
FrameStateBuilder state)
In some native-image configurations, it is not legal to clear non-live locals at target
creation.
|
protected AnchoringNode |
createAnchor(JavaTypeProfile profile) |
protected NodeSourcePosition |
createBytecodePosition() |
protected void |
createExceptionDispatch(BciBlockMapping.ExceptionDispatchBlock block) |
protected void |
createHandleExceptionTarget(FixedWithNextNode afterExceptionLoaded,
int bci,
FrameStateBuilder dispatchState) |
protected LogicNode |
createInstanceOf(TypeReference type,
ValueNode object) |
protected LogicNode |
createInstanceOf(TypeReference type,
ValueNode object,
JavaTypeProfile profile) |
protected LogicNode |
createInstanceOfAllowNull(TypeReference type,
ValueNode object,
JavaTypeProfile profile) |
protected InvokeNode |
createInvoke(int invokeBci,
CallTargetNode callTarget,
JavaKind resultType) |
protected InvokeWithExceptionNode |
createInvokeWithException(int invokeBci,
CallTargetNode callTarget,
JavaKind resultType,
BytecodeParser.ExceptionEdgeAction exceptionEdgeAction) |
MethodCallTargetNode |
createMethodCallTarget(CallTargetNode.InvokeKind invokeKind,
ResolvedJavaMethod targetMethod,
ValueNode[] args,
StampPair returnStamp,
JavaTypeProfile profile) |
protected MonitorEnterNode |
createMonitorEnterNode(ValueNode x,
MonitorIdNode monitorId) |
protected Invoke |
createNonInlinedInvoke(BytecodeParser.ExceptionEdgeAction exceptionEdge,
int invokeBci,
CallTargetNode callTarget,
JavaKind resultType) |
protected Invoke |
createNonInlinedInvoke(BytecodeParser.ExceptionEdgeAction exceptionEdge,
int invokeBci,
ValueNode[] invokeArgs,
ResolvedJavaMethod targetMethod,
CallTargetNode.InvokeKind invokeKind,
JavaKind resultType,
JavaType returnType,
JavaTypeProfile profile) |
protected boolean |
disableLoopSafepoint() |
AbstractBeginNode |
emitBytecodeExceptionCheck(LogicNode condition,
boolean passingOnTrue,
BytecodeExceptionNode.BytecodeExceptionKind exceptionKind,
ValueNode... arguments) |
protected void |
emitCheckForInvokeSuperSpecial(ValueNode[] args)
Checks that the class of the receiver of an
Bytecodes.INVOKESPECIAL in a method
declared in an interface (i.e., a default method) is assignable to the interface. |
protected boolean |
forceLoopPhis() |
protected ValueNode |
genAnd(ValueNode x,
ValueNode y) |
protected ValueNode |
genArrayLength(ValueNode x) |
protected void |
genCheckCast(JavaType type,
ValueNode object) |
protected void |
genCheckCast(ResolvedJavaType resolvedType,
ValueNode objectIn) |
protected ValueNode |
genConditional(ValueNode x) |
protected BciBlockMapping |
generateBlockMap() |
AbstractBeginNode |
genExplicitExceptionEdge(BytecodeExceptionNode.BytecodeExceptionKind exceptionKind,
ValueNode... exceptionArguments)
Generates an exception edge for the current bytecode.
|
protected ValueNode |
genFloatAdd(ValueNode x,
ValueNode y) |
protected ValueNode |
genFloatConvert(FloatConvert op,
ValueNode input) |
protected ValueNode |
genFloatDiv(ValueNode x,
ValueNode y) |
protected ValueNode |
genFloatMul(ValueNode x,
ValueNode y) |
protected ValueNode |
genFloatRem(ValueNode x,
ValueNode y) |
protected ValueNode |
genFloatSub(ValueNode x,
ValueNode y) |
protected void |
genGetField(int cpi,
int opcode) |
protected void |
genGetField(int cpi,
int opcode,
ValueNode receiverInput) |
protected void |
genGetStatic(int cpi,
int opcode) |
protected void |
genGoto() |
protected void |
genIf(LogicNode conditionInput,
BciBlockMapping.BciBlock trueBlockInput,
BciBlockMapping.BciBlock falseBlockInput,
ProfileData.BranchProbabilityData originalProfileData) |
protected void |
genIf(ValueNode x,
Condition cond,
ValueNode y) |
protected ValueNode |
genIfNode(LogicNode condition,
FixedNode trueSuccessor,
FixedNode falseSuccessor,
ProfileData.BranchProbabilityData profileData) |
protected void |
genInstanceOf(JavaType type,
ValueNode object) |
protected void |
genInstanceOf(ResolvedJavaType resolvedType,
ValueNode objectIn) |
protected ValueNode |
genIntegerAdd(ValueNode x,
ValueNode y) |
protected ValueNode |
genIntegerDiv(ValueNode x,
ValueNode y,
GuardingNode zeroCheck) |
protected LogicNode |
genIntegerEquals(ValueNode x,
ValueNode y) |
protected LogicNode |
genIntegerLessThan(ValueNode x,
ValueNode y) |
protected ValueNode |
genIntegerMul(ValueNode x,
ValueNode y) |
protected ValueNode |
genIntegerNormalizeCompare(ValueNode x,
ValueNode y) |
protected ValueNode |
genIntegerRem(ValueNode x,
ValueNode y,
GuardingNode zeroCheck) |
protected ValueNode |
genIntegerSub(ValueNode x,
ValueNode y) |
protected void |
genIntegerSwitch(ValueNode value,
ArrayList<BciBlockMapping.BciBlock> actualSuccessors,
int[] keys,
double[] keyProbabilities,
int[] keySuccessors,
ProfileData.ProfileSource profileSource) |
protected void |
genInvokeDynamic(int cpi,
int opcode) |
protected void |
genInvokeInterface(int cpi,
int opcode) |
protected void |
genInvokeInterface(JavaType referencedType,
JavaMethod target) |
protected void |
genInvokeSpecial(int cpi,
int opcode) |
protected void |
genInvokeStatic(int cpi,
int opcode) |
protected void |
genInvokeVirtual(int cpi,
int opcode) |
protected void |
genInvokeVirtual(ResolvedJavaMethod resolvedTarget) |
protected void |
genJsr(int dest) |
protected ValueNode |
genLeftShift(ValueNode x,
ValueNode y) |
protected void |
genLoadConstant(int cpi,
int opcode) |
protected ValueNode |
genLoadField(ValueNode receiver,
ResolvedJavaField field) |
protected ValueNode |
genLoadIndexed(ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
JavaKind kind) |
protected void |
genMonitorEnter(ValueNode x,
int bci) |
protected void |
genMonitorExit(ValueNode x,
ValueNode escapedValue,
int bci) |
protected ValueNode |
genNarrow(ValueNode input,
int bitCount) |
protected ValueNode |
genNegateOp(ValueNode x) |
protected void |
genNewInstance(int cpi) |
protected void |
genNewInstance(JavaType type) |
protected void |
genNewInstance(ResolvedJavaType resolvedType) |
protected ValueNode |
genNormalizeCompare(ValueNode x,
ValueNode y,
boolean isUnorderedLess) |
protected LogicNode |
genObjectEquals(ValueNode x,
ValueNode y) |
protected ValueNode |
genOr(ValueNode x,
ValueNode y) |
protected void |
genPutField(int cpi,
int opcode) |
protected void |
genPutField(JavaField field) |
protected void |
genPutStatic(int cpi,
int opcode) |
protected void |
genPutStatic(JavaField field) |
protected void |
genRet(int localIndex) |
protected void |
genReturn(ValueNode returnVal,
JavaKind returnKind) |
protected ValueNode |
genRightShift(ValueNode x,
ValueNode y) |
protected ValueNode |
genSignExtend(ValueNode input,
int bitCount) |
protected void |
genStoreField(ValueNode receiver,
ResolvedJavaField field,
ValueNode value) |
protected void |
genStoreIndexed(ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
GuardingNode storeCheck,
JavaKind kind,
ValueNode value) |
protected void |
genThrow() |
protected LogicNode |
genUnique(LogicNode x) |
protected ValueNode |
genUnique(ValueNode x) |
protected ValueNode |
genUnsignedRightShift(ValueNode x,
ValueNode y) |
protected StateSplitProxyNode |
genVolatileFieldReadProxy(ValueNode fieldRead) |
protected ValueNode |
genXor(ValueNode x,
ValueNode y) |
protected ValueNode |
genZeroExtend(ValueNode input,
int bitCount) |
protected BytecodeParser.ExceptionEdgeAction |
getActionForInvokeExceptionEdge(InlineInvokePlugin.InlineInfo lastInlineInfo) |
FixedWithNextNode |
getBeforeUnwindNode() |
Bytecode |
getCode()
Gets the code being parsed.
|
FrameStateBuilder |
getFrameStateBuilder() |
StructuredGraph |
getGraph()
Gets the graph being processed by this builder.
|
protected GraphBuilderPhase.Instance |
getGraphBuilderInstance() |
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 returnVal)
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.
|
BytecodeParser |
getNonIntrinsicAncestor()
Gets the first ancestor parsing context that is not parsing a intrinsic.
|
BytecodeParser |
getParent()
Gets the parsing context for the method that inlines the method being parsed by this context.
|
protected ProfileData.BranchProbabilityData |
getProfileData(boolean negate) |
protected JavaTypeProfile |
getProfileForInvoke(CallTargetNode.InvokeKind invokeKind) |
protected BytecodeStream |
getStream() |
ValueNode |
getUnwindValue() |
protected void |
handleBytecodeBlock(BciBlockMapping.BciBlock block) |
protected AbstractBeginNode |
handleException(ValueNode exceptionObject,
int bci,
boolean deoptimizeOnly) |
protected void |
handleIllegalNewInstance(JavaType type) |
Invoke |
handleReplacedInvoke(CallTargetNode.InvokeKind invokeKind,
ResolvedJavaMethod targetMethod,
ValueNode[] args,
boolean inlineEverything)
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) |
protected void |
handleUnresolvedCheckCast(JavaType type,
ValueNode object) |
protected void |
handleUnresolvedExceptionType(JavaType type) |
protected void |
handleUnresolvedInstanceOf(JavaType type,
ValueNode object) |
protected void |
handleUnresolvedInvoke(JavaMethod javaMethod,
CallTargetNode.InvokeKind invokeKind) |
protected void |
handleUnresolvedLoadConstant(JavaType type) |
protected void |
handleUnresolvedLoadField(JavaField field,
ValueNode receiver) |
protected void |
handleUnresolvedNewInstance(JavaType type) |
protected void |
handleUnresolvedNewMultiArray(JavaType type,
ValueNode[] dims) |
protected void |
handleUnresolvedNewObjectArray(JavaType type,
ValueNode length) |
protected void |
handleUnresolvedStoreField(JavaField field,
ValueNode value,
ValueNode receiver) |
protected boolean |
insideTryBlock()
Returns true if the current parse position is covered by an exception handler, including
exception handlers of all outer scopes when inlining during parsing.
|
Invoke |
invokeFallback(FixedWithNextNode predecessor,
EndNode end) |
protected boolean |
isNeverExecutedCode(double probability) |
boolean |
isParsingInvocationPlugin() |
boolean |
isPotentialCountedLoopExit(LogicNode condition,
BciBlockMapping.BciBlock target) |
protected void |
iterateBytecodesForBlock(BciBlockMapping.BciBlock block) |
void |
loadLocal(int index,
JavaKind kind) |
void |
loadLocalObject(int index) |
protected Object |
loadReferenceTypeLock()
Gets the object to lock when resolving and initializing a type referenced by a constant pool
entry.
|
protected JavaField |
lookupField(int cpi,
int opcode) |
protected JavaField |
lookupField(JavaField result) |
protected JavaMethod |
lookupMethodInPool(int cpi,
int opcode) |
protected JavaType |
lookupReferencedTypeInPool(int cpi,
int opcode) |
protected JavaType |
lookupType(int cpi,
int bytecode) |
protected void |
maybeEagerlyInitialize(ResolvedJavaType resolvedType) |
protected void |
maybeEagerlyResolve(int cpi,
int bytecode) |
protected JavaType |
maybeEagerlyResolve(JavaType type,
ResolvedJavaType accessingClass) |
protected GuardingNode |
maybeEmitExplicitBoundsCheck(ValueNode receiver,
ValueNode index) |
ValueNode |
maybeEmitExplicitNullCheck(ValueNode receiver) |
protected GuardingNode |
maybeEmitExplicitStoreCheck(ValueNode array,
JavaKind elementKind,
ValueNode value) |
protected boolean |
needsExplicitBoundsCheckException(ValueNode array,
ValueNode index)
Returns true if an explicit null check should be emitted for the given object.
|
protected boolean |
needsExplicitClassCastException(ValueNode object)
Returns true if an explicit check for a
ClassCastException should be emitted for the
given object. |
boolean |
needsExplicitException() |
protected boolean |
needsExplicitNullCheckException(ValueNode object)
Returns true if an explicit null check should be emitted for the given object.
|
protected boolean |
needsExplicitStoreCheckException(ValueNode array,
ValueNode value)
Returns true if an explicit null check should be emitted for the given object.
|
protected void |
notifyAfterInline(ResolvedJavaMethod inlinedMethod) |
protected void |
notifyBeforeInline(ResolvedJavaMethod inlinedMethod) |
protected void |
parseAndInlineCallee(ResolvedJavaMethod targetMethod,
ValueNode[] args,
IntrinsicContext calleeIntrinsicContext) |
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.
|
ValueNode[] |
popArguments(int argSize) |
protected void |
postProcessIfNode(ValueNode node)
Hook for subclasses to generate custom nodes before an IfNode.
|
protected void |
processBlock(BciBlockMapping.BciBlock block) |
void |
processBytecode(int bci,
int opcode) |
void |
push(JavaKind slotKind,
ValueNode value)
Pushes a given value to the frame state stack using an explicit kind.
|
void |
replacePlugin(GeneratedInvocationPlugin plugin,
ResolvedJavaMethod targetMethod,
ValueNode[] args,
PluginReplacementNode.ReplacementFunction replacementFunction)
Replaces an invocation of a given method by inserting a
PluginReplacementNode that
defers the application of an
InvocationPlugin. |
void |
replacePluginWithException(GeneratedInvocationPlugin plugin,
ResolvedJavaMethod targetMethod,
ValueNode[] args,
PluginReplacementWithExceptionNode.ReplacementWithExceptionFunction replacementFunction)
Replaces an invocation of a given method by inserting a
PluginReplacementWithExceptionNode that
defers the application of an
InvocationPlugin. |
void |
setBciCanBeDuplicated(boolean bciCanBeDuplicated) |
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.
|
protected boolean |
stampFromValueForForcedPhis() |
void |
storeLocal(JavaKind kind,
int index) |
protected RuntimeException |
throwParserError(Throwable e) |
String |
toString() |
protected void |
traceInstruction(int bci,
int opcode,
boolean blockStart) |
protected void |
traceWithContext(String format,
Object... args)
Prints a line to
TTY with a prefix indicating the current parse context. |
protected InlineInvokePlugin.InlineInfo |
tryInline(ValueNode[] args,
ResolvedJavaMethod targetMethod)
Try to inline a method.
|
protected boolean |
tryInvocationPlugin(CallTargetNode.InvokeKind invokeKind,
ValueNode[] args,
ResolvedJavaMethod targetMethod,
JavaKind resultType) |
protected boolean |
typeIsResolved(JavaType type)
Check if a type is resolved.
|
getConstantFieldProvider, getConstantReflection, getForeignCalls, getLoopsDataProvider, getLowerer, getMetaAccess, getMetaAccessExtensionProvider, getPlatformConfigurationProvider, getProviders, getReplacements, getStampProvider, getWordVerificationclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addNonNullCast, addPush, allowDeoptInPlugins, genCheckcastDynamic, getDepth, getExternalInliningContext, getInvokeReturnStamp, intrinsicRangeCheck, isPluginEnabled, maskSubWordValue, maybeEmitExplicitDivisionByZeroCheck, maybeEmitExplicitNegativeArraySizeCheck, maybeEmitExplicitNegativeArraySizeCheck, nullCheckedValue, nullCheckedValue, recursiveInliningDepthcanDeferPlugin, getAssumptions, getDebug, getOptions, shouldDeferPlugingetConstantFieldProvider, getConstantReflection, getForeignCalls, getLoopsDataProvider, getLowerer, getMetaAccess, getMetaAccessExtensionProvider, getPlatformConfigurationProvider, getReplacements, getStampProvider, getWordVerificationpublic static final int TRACELEVEL_INSTRUCTIONS
BytecodeParserOptions.TraceBytecodeParserLevel must be set
to trace the bytecode instructions as they are parsed.public static final int TRACELEVEL_STATE
BytecodeParserOptions.TraceBytecodeParserLevel must be set
to emit the frame state for each traced bytecode instruction.public static final int TRACELEVEL_BLOCKMAP
BytecodeParserOptions.TraceBytecodeParserLevel must be set
to emit the block map for each traced method.public static final CounterKey BytecodesParsed
protected static final CounterKey EXPLICIT_EXCEPTIONS
protected final StructuredGraph graph
protected final OptionValues options
protected final DebugContext debug
protected BciBlockMapping blockMap
protected final int entryBCI
protected FixedWithNextNode lastInstr
protected FrameStateBuilder frameState
protected BciBlockMapping.BciBlock currentBlock
protected final BytecodeStream stream
protected final GraphBuilderConfiguration graphBuilderConfig
protected final ResolvedJavaMethod method
protected final Bytecode code
protected final BytecodeProvider bytecodeProvider
protected final ProfilingInfo profilingInfo
protected final OptimisticOptimizations optimisticOpts
protected final ConstantPool constantPool
protected final IntrinsicContext intrinsicContext
protected InvocationPluginContext invocationPluginContext
public static final CounterKey fallBackSpeculationTaken
public static final CounterKey fallBackSpeculationNotTaken
protected BytecodeParser(GraphBuilderPhase.Instance graphBuilderInstance, StructuredGraph graph, BytecodeParser parent, ResolvedJavaMethod method, int entryBCI, IntrinsicContext intrinsicContext)
public FrameState getInvocationPluginReturnState(JavaKind returnKind, ValueNode returnVal)
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)protected boolean insideTryBlock()
protected GraphBuilderPhase.Instance getGraphBuilderInstance()
public ValueNode getUnwindValue()
public FixedWithNextNode getBeforeUnwindNode()
protected void buildRootMethod()
protected BciBlockMapping generateBlockMap()
protected boolean asyncExceptionLiveness()
local liveness calculation should consider async
exceptions that might occur at any bci covered by an exception handler.protected void build(FixedWithNextNode startInstruction, FrameStateBuilder startFrameState)
protected void cleanupFinalGraph()
protected void handleUnresolvedLoadConstant(JavaType type)
type - the unresolved type of the constantprotected void handleUnresolvedCheckCast(JavaType type,
ValueNode object)
type - the unresolved type of the type checkobject - the object value whose type is being checked against typeprotected void handleUnresolvedInstanceOf(JavaType type,
ValueNode object)
type - the unresolved type of the type checkobject - the object value whose type is being checked against typeprotected void handleUnresolvedNewInstance(JavaType type)
type - the type being instantiatedprotected void handleIllegalNewInstance(JavaType type)
type - the type being instantiatedprotected void handleUnresolvedNewObjectArray(JavaType type,
ValueNode length)
type - the type of the array being instantiatedlength - the length of the arrayprotected void handleUnresolvedNewMultiArray(JavaType type,
ValueNode[] dims)
type - the type being instantiateddims - the dimensions for the multi-arrayprotected void handleUnresolvedLoadField(JavaField field,
ValueNode receiver)
field - the unresolved fieldreceiver - the object containing the field or null if field is staticprotected void handleUnresolvedStoreField(JavaField field,
ValueNode value,
ValueNode receiver)
field - the unresolved fieldvalue - the value being stored to the fieldreceiver - the object containing the field or null if field is staticprotected void handleUnresolvedExceptionType(JavaType type)
type - protected void handleUnresolvedInvoke(JavaMethod javaMethod,
CallTargetNode.InvokeKind invokeKind)
javaMethod - invokeKind - protected AbstractBeginNode handleException(ValueNode exceptionObject, int bci, boolean deoptimizeOnly)
protected void createHandleExceptionTarget(FixedWithNextNode afterExceptionLoaded, int bci, FrameStateBuilder dispatchState)
protected ValueNode genLoadIndexed(ValueNode array, ValueNode index, GuardingNode boundsCheck, JavaKind kind)
protected void genStoreIndexed(ValueNode array, ValueNode index, GuardingNode boundsCheck, GuardingNode storeCheck, JavaKind kind, ValueNode value)
protected ValueNode genIntegerDiv(ValueNode x, ValueNode y, GuardingNode zeroCheck)
protected ValueNode genIntegerRem(ValueNode x, ValueNode y, GuardingNode zeroCheck)
protected ValueNode genNormalizeCompare(ValueNode x, ValueNode y, boolean isUnorderedLess)
protected ValueNode genFloatConvert(FloatConvert op, ValueNode input)
protected void genGoto()
protected ValueNode genIfNode(LogicNode condition, FixedNode trueSuccessor, FixedNode falseSuccessor, ProfileData.BranchProbabilityData profileData)
protected void genThrow()
protected LogicNode createInstanceOf(TypeReference type, ValueNode object)
protected AnchoringNode createAnchor(JavaTypeProfile profile)
protected LogicNode createInstanceOf(TypeReference type, ValueNode object, JavaTypeProfile profile)
protected LogicNode createInstanceOfAllowNull(TypeReference type, ValueNode object, JavaTypeProfile profile)
protected StateSplitProxyNode genVolatileFieldReadProxy(ValueNode fieldRead)
protected GuardingNode maybeEmitExplicitBoundsCheck(ValueNode receiver, ValueNode index)
protected GuardingNode maybeEmitExplicitStoreCheck(ValueNode array, JavaKind elementKind, ValueNode value)
public AbstractBeginNode emitBytecodeExceptionCheck(LogicNode condition, boolean passingOnTrue, BytecodeExceptionNode.BytecodeExceptionKind exceptionKind, ValueNode... arguments)
emitBytecodeExceptionCheck in interface GraphBuilderContextprotected void genStoreField(ValueNode receiver, ResolvedJavaField field, ValueNode value)
protected boolean typeIsResolved(JavaType type)
protected void genInvokeStatic(int cpi,
int opcode)
protected void genInvokeInterface(int cpi,
int opcode)
protected void genInvokeInterface(JavaType referencedType,
JavaMethod target)
protected void genInvokeDynamic(int cpi,
int opcode)
protected void genInvokeVirtual(int cpi,
int opcode)
protected void genInvokeVirtual(ResolvedJavaMethod resolvedTarget)
protected void genInvokeSpecial(int cpi,
int opcode)
public CallTargetNode.InvokeKind getInvokeKind()
GraphBuilderContextgetInvokeKind in interface GraphBuilderContextpublic JavaType getInvokeReturnType()
GraphBuilderContextgetInvokeReturnType in interface GraphBuilderContextpublic Invoke handleReplacedInvoke(CallTargetNode.InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args, boolean inlineEverything)
GraphBuilderContexthandleReplacedInvoke in interface GraphBuilderContextinvokeKind - the kind of the replacement invocationtargetMethod - the target of the replacement invocationargs - the arguments to the replacement invocationinlineEverything - 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 GraphBuilderContextprotected Invoke appendInvoke(CallTargetNode.InvokeKind initialInvokeKind, ResolvedJavaMethod initialTargetMethod, ValueNode[] args)
protected void emitCheckForInvokeSuperSpecial(ValueNode[] args)
Bytecodes.INVOKESPECIAL in a method
declared in an interface (i.e., a default method) is assignable to the interface. If not,
then deoptimize so that the interpreter can throw an IllegalAccessError.
This is a check not performed by the verifier and so must be performed at runtime.args - arguments to an Bytecodes.INVOKESPECIAL implementing a direct call to a
method in a super classprotected JavaTypeProfile getProfileForInvoke(CallTargetNode.InvokeKind invokeKind)
protected Invoke createNonInlinedInvoke(BytecodeParser.ExceptionEdgeAction exceptionEdge, int invokeBci, ValueNode[] invokeArgs, ResolvedJavaMethod targetMethod, CallTargetNode.InvokeKind invokeKind, JavaKind resultType, JavaType returnType, JavaTypeProfile profile)
protected Invoke createNonInlinedInvoke(BytecodeParser.ExceptionEdgeAction exceptionEdge, int invokeBci, CallTargetNode callTarget, JavaKind resultType)
protected BytecodeParser.ExceptionEdgeAction getActionForInvokeExceptionEdge(InlineInvokePlugin.InlineInfo lastInlineInfo)
public void replacePlugin(GeneratedInvocationPlugin plugin, ResolvedJavaMethod targetMethod, ValueNode[] args, PluginReplacementNode.ReplacementFunction replacementFunction)
GraphBuilderContextPluginReplacementNode that
defers the application of an
InvocationPlugin.replacePlugin in interface GraphBuilderContextplugin - the InvocationPlugin that is deferredtargetMethod - the target of the replacement invocationargs - the arguments to the replacement invocationreplacementFunction - the replacement function for deferred application of the
pluginpublic void replacePluginWithException(GeneratedInvocationPlugin plugin, ResolvedJavaMethod targetMethod, ValueNode[] args, PluginReplacementWithExceptionNode.ReplacementWithExceptionFunction replacementFunction)
GraphBuilderContextPluginReplacementWithExceptionNode that
defers the application of an
InvocationPlugin.replacePluginWithException in interface GraphBuilderContextplugin - the InvocationPlugin that is deferredtargetMethod - the target of the replacement invocationargs - the arguments to the replacement invocationreplacementFunction - the replacement function for deferred application of the
pluginprotected boolean tryInvocationPlugin(CallTargetNode.InvokeKind invokeKind, ValueNode[] args, ResolvedJavaMethod targetMethod, JavaKind resultType)
public Invoke invokeFallback(FixedWithNextNode predecessor, EndNode end)
invokeFallback in interface GraphBuilderContextpublic boolean isParsingInvocationPlugin()
isParsingInvocationPlugin in interface GraphBuilderContextprotected boolean applyInvocationPlugin(CallTargetNode.InvokeKind invokeKind, ValueNode[] args, ResolvedJavaMethod targetMethod, JavaKind resultType, InvocationPlugin plugin)
protected InlineInvokePlugin.InlineInfo tryInline(ValueNode[] args, ResolvedJavaMethod targetMethod)
BytecodeParser.SUCCESSFULLY_INLINED.
Otherwise, it returns the InlineInvokePlugin.InlineInfo that lead to the decision to not inline it, or
null if there is no InlineInvokePlugin.InlineInfo for this method.protected final void notifyBeforeInline(ResolvedJavaMethod inlinedMethod)
protected final void notifyAfterInline(ResolvedJavaMethod inlinedMethod)
protected boolean canInlinePartialIntrinsicExit()
protected void traceWithContext(String format, Object... args)
TTY with a prefix indicating the current parse context. The prefix
is of the form:
{SPACE * n} {name of method being parsed} "(" {file name} ":" {line number} ")"
where n is the current inlining depth.format - a format stringargs - arguments to the format stringprotected RuntimeException throwParserError(Throwable e)
protected void parseAndInlineCallee(ResolvedJavaMethod targetMethod,
ValueNode[] args,
IntrinsicContext calleeIntrinsicContext)
public MethodCallTargetNode createMethodCallTarget(CallTargetNode.InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args, StampPair returnStamp, JavaTypeProfile profile)
protected InvokeNode createInvoke(int invokeBci, CallTargetNode callTarget, JavaKind resultType)
protected InvokeWithExceptionNode createInvokeWithException(int invokeBci, CallTargetNode callTarget, JavaKind resultType, BytecodeParser.ExceptionEdgeAction exceptionEdgeAction)
protected void genReturn(ValueNode returnVal, JavaKind returnKind)
protected MonitorEnterNode createMonitorEnterNode(ValueNode x, MonitorIdNode monitorId)
protected void genMonitorEnter(ValueNode x, int bci)
protected void genJsr(int dest)
protected void genRet(int localIndex)
protected void genIntegerSwitch(ValueNode value, ArrayList<BciBlockMapping.BciBlock> actualSuccessors, int[] keys, double[] keyProbabilities, int[] keySuccessors, ProfileData.ProfileSource profileSource)
protected ConstantNode appendConstant(JavaConstant constant)
public <T extends ValueNode> T append(T v)
GraphBuilderToolappend in interface GraphBuilderToolv - the node to be added to the graphprotected void clearNonLiveLocalsAtLoopExitCreation(BciBlockMapping.BciBlock block, FrameStateBuilder state)
protected void clearNonLiveLocalsAtTargetCreation(BciBlockMapping.BciBlock block, FrameStateBuilder state)
protected void processBlock(BciBlockMapping.BciBlock block)
protected void createExceptionDispatch(BciBlockMapping.ExceptionDispatchBlock block)
protected void appendGoto(BciBlockMapping.BciBlock successor)
protected void handleBytecodeBlock(BciBlockMapping.BciBlock block)
protected void iterateBytecodesForBlock(BciBlockMapping.BciBlock block)
protected boolean forceLoopPhis()
protected boolean stampFromValueForForcedPhis()
protected boolean checkLastInstruction()
protected boolean disableLoopSafepoint()
protected ProfileData.BranchProbabilityData getProfileData(boolean negate)
protected void genIf(LogicNode conditionInput, BciBlockMapping.BciBlock trueBlockInput, BciBlockMapping.BciBlock falseBlockInput, ProfileData.BranchProbabilityData originalProfileData)
public boolean isPotentialCountedLoopExit(LogicNode condition, BciBlockMapping.BciBlock target)
protected void postProcessIfNode(ValueNode node)
public void push(JavaKind slotKind,
ValueNode value)
GraphBuilderContextvalue.getJavaKind() is different from the kind that the bytecode instruction
currently being parsed pushes to the stack.push in interface GraphBuilderContextslotKind - 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 ValueNode[] popArguments(int argSize)
popArguments in interface GraphBuilderContextpublic StructuredGraph getGraph()
getGraph in interface GraphBuilderToolpublic BytecodeParser getParent()
GraphBuilderContextgetParent in interface GraphBuilderContextpublic IntrinsicContext getIntrinsic()
GraphBuilderContextnull if not
parsing an intrinsic.getIntrinsic in interface GraphBuilderContextpublic BailoutException bailout(String string)
bailout in interface GraphBuilderContextpublic void setStateAfter(StateSplit sideEffect)
GraphBuilderContextsetStateAfter in interface GraphBuilderContextsideEffect - a side effect node just appended to the graphprotected NodeSourcePosition createBytecodePosition()
protected final BytecodeStream getStream()
public int bci()
GraphBuilderContextbci in interface GraphBuilderContextpublic void setBciCanBeDuplicated(boolean bciCanBeDuplicated)
public boolean bciCanBeDuplicated()
bciCanBeDuplicated in interface GraphBuilderContextpublic void loadLocal(int index,
JavaKind kind)
public void loadLocalObject(int index)
public void storeLocal(JavaKind kind,
int index)
protected void genLoadConstant(int cpi,
int opcode)
protected JavaType lookupType(int cpi,
int bytecode)
protected JavaMethod lookupMethodInPool(int cpi,
int opcode)
protected JavaType lookupReferencedTypeInPool(int cpi,
int opcode)
protected JavaField lookupField(int cpi,
int opcode)
protected JavaField lookupField(JavaField result)
protected void maybeEagerlyResolve(int cpi,
int bytecode)
protected Object loadReferenceTypeLock()
null if no synchronization is necessaryprotected JavaType maybeEagerlyResolve(JavaType type,
ResolvedJavaType accessingClass)
protected void maybeEagerlyInitialize(ResolvedJavaType resolvedType)
protected void genCheckCast(JavaType type,
ValueNode object)
protected void genCheckCast(ResolvedJavaType resolvedType,
ValueNode objectIn)
protected void genInstanceOf(JavaType type,
ValueNode object)
protected void genInstanceOf(ResolvedJavaType resolvedType,
ValueNode objectIn)
protected void genNewInstance(int cpi)
protected void genNewInstance(JavaType type)
protected void genNewInstance(ResolvedJavaType resolvedType)
protected void genGetField(int cpi,
int opcode)
protected void genGetField(int cpi,
int opcode,
ValueNode receiverInput)
protected boolean needsExplicitNullCheckException(ValueNode object)
object - The object that is accessed.protected boolean needsExplicitBoundsCheckException(ValueNode array, ValueNode index)
array - The array that is accessed.index - The array index that is accessed.protected boolean needsExplicitClassCastException(ValueNode object)
ClassCastException should be emitted for the
given object.object - The object that is accessed.protected boolean needsExplicitStoreCheckException(ValueNode array, ValueNode value)
array - The array that is accessed.value - The value that is stored into the array.public boolean needsExplicitException()
needsExplicitException in interface GraphBuilderContextpublic 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 genPutField(int cpi,
int opcode)
protected void genPutField(JavaField field)
protected void genGetStatic(int cpi,
int opcode)
protected void genPutStatic(int cpi,
int opcode)
protected void genPutStatic(JavaField field)
protected boolean isNeverExecutedCode(double probability)
public final void processBytecode(int bci,
int opcode)
public ResolvedJavaMethod getMethod()
GraphBuilderContextgetMethod in interface GraphBuilderContextpublic Bytecode getCode()
GraphBuilderContextgetCode in interface GraphBuilderContextpublic FrameStateBuilder getFrameStateBuilder()
protected void traceInstruction(int bci,
int opcode,
boolean blockStart)
public boolean parsingIntrinsic()
GraphBuilderContextparsingIntrinsic in interface GraphBuilderContextparsingIntrinsic in interface GraphBuilderToolpublic BytecodeParser getNonIntrinsicAncestor()
GraphBuilderContextgetNonIntrinsicAncestor in interface GraphBuilderContext