Package com.oracle.truffle.api.bytecode
Class Instruction.Argument
java.lang.Object
com.oracle.truffle.api.bytecode.Instruction.Argument
- Enclosing class:
Instruction
Represents metadata for an argument of an instruction in a bytecode node.
Compatibility note: The data contained in instruction classes is subject to change without notice between Truffle versions. This introspection API is therefore intended to be used for debugging and tracing purposes only. Do not rely on instructions for your language semantics.
- Since:
- 24.2
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a branch profile.static enumRepresents kind of anInstruction.Argument. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts this argument to abranch profile.intConverts this argument to an bytecodeIndex.Converts this argument to acached node.Converts this argument to a object constant.intConverts this argument to anintvalue.intConverts this argument to a localIndex.intConverts this argument to a localOffset.Converts this argument to atag tree node.abstract Instruction.Argument.KindgetKind()Returns theInstruction.Argument.Kindof this argument.abstract StringgetName()Returns a humand readable name for this argument.Converts this argument to aspecialization info.final StringtoString()
-
Constructor Details
-
Argument
Internal constructor for generated code. Do not use.- Since:
- 24.2
-
-
Method Details
-
getKind
Returns theInstruction.Argument.Kindof this argument. Depending on the kind you may use any of the as prefixed methods.- Since:
- 24.2
-
getName
Returns a humand readable name for this argument. This could be for example"localOffset"for a local variable access instruction. Arguments with the samegetKind()may have differentnames. A name is typically more descriptive than just the kind and should be preferred over the kind for debug output.- Since:
- 24.2
-
asInteger
Converts this argument to anintvalue. This method is only supported for for the following kind:Instruction.Argument.Kind.INTEGER. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown.- Throws:
UnsupportedOperationException- Since:
- 24.2
-
asBytecodeIndex
public int asBytecodeIndex()Converts this argument to an bytecodeIndex. This method is only supported for for the following kind:Instruction.Argument.Kind.BYTECODE_INDEX. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. If the returned value is >= 0 then the bytecode index can be used to be converted to aBytecodeLocation.- Since:
- 24.2
-
asConstant
Converts this argument to a object constant. This method is only supported for for the following kind:Instruction.Argument.Kind.CONSTANT. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown.- Since:
- 24.2
-
asCachedNode
Converts this argument to acached node. This method is only supported for for the following kind:Instruction.Argument.Kind.NODE_PROFILE. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. The returned value is nevernullif theBytecodeTierisBytecodeTier.CACHED.- Since:
- 24.2
-
asTagNode
Converts this argument to atag tree node. This method is only supported for for the following kind:Instruction.Argument.Kind.TAG_NODE. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. The returned value is nevernull.- Since:
- 24.2
-
asLocalOffset
public int asLocalOffset()Converts this argument to a localOffset. This method is only supported for for the following kind:Instruction.Argument.Kind.LOCAL_OFFSET. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. This index may be used to access locals with the local local access methods inBytecodeNode.- Since:
- 24.2
- See Also:
-
asLocalIndex
public int asLocalIndex()Converts this argument to a localIndex. This method is only supported for for the following kind:Instruction.Argument.Kind.LOCAL_INDEX. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. The local index can be used to index into the list oflocals.- Since:
- 24.2
- See Also:
-
asBranchProfile
Converts this argument to abranch profile. This method is only supported for for the following kind:Instruction.Argument.Kind.BRANCH_PROFILE. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. The returned value is nevernull.- Since:
- 24.2
-
getSpecializationInfo
Converts this argument to aspecialization info. This method is only supported for for the following kind:Instruction.Argument.Kind.NODE_PROFILE. If called for arguments of other kinds then anUnsupportedOperationExceptionis thrown. The specialization info is only available ifGenerateBytecode.enableSpecializationIntrospection()is set totrue.- Since:
- 24.2
-
toString
-