APIdia Launch Partner
Top Description Inners Methods
java.lang.classfile.attribute

public sealed Interface StackMapFrameInfo

permits StackMapFrameImpl
Known Direct Implementers
jdk.internal.classfile.impl.StackMapDecoder.StackMapFrameImpl
Imports
java.lang.classfile.ClassFile, .Label, .Opcode, java.lang.classfile.constantpool.ClassEntry, java.lang.classfile.instruction.BranchInstruction, java.lang.constant.ClassDesc, java.util.List, jdk.internal.classfile.impl.StackMapDecoder, .StackMapGenerator, .TemporaryConstantPool

Models a stack map frame in a StackMapTable attribute (JVMS 4.7.4). A stack map frame must appear at the beginning of each basic block in a method (JVMS 4.10.1).

API Note

In general, a stack map frame should be defined for each target of a BranchInstruction, or unreachable code right after an unconditional branch instruction like goto. The automatic stack map generation cannot handle unreachable code right after an unconditional jump; The ClassFile.DeadCodeOption allows substituting such code, or advanced users can provide their own stack maps for dead code.

Since
24
Java Virtual Machine Specification
4.7.4 The StackMapTable Attribute, 4.10.1 Verification by Type Checking
See Also
StackMapTableAttribute#entries()

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
StackMapFrameInfo.ObjectVerificationTypeInfo

A stack value for an object type.

public static enum
public static interface
public static interface
StackMapFrameInfo.VerificationTypeInfo

The type of a stack or local variable value.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the raw u1 frame_type
frameType
()

Returns the raw u1 frame_type.

public List<StackMapFrameInfo.VerificationTypeInfo>

Returns:

the expanded local variable types
locals
()

Returns the expanded local variable types.

public static StackMapFrameInfo

Returns:

a new stack map frame
of
(Label
the location of the frame
target
,
List<StackMapFrameInfo.VerificationTypeInfo>
the complete list of frame locals
locals
,
List<StackMapFrameInfo.VerificationTypeInfo>
the complete frame stack
stack
)

Returns a new stack map frame.

public List<StackMapFrameInfo.VerificationTypeInfo>

Returns:

the expanded operand stack types
stack
()

Returns the expanded operand stack types.

public Label

Returns:

the frame target label
target
()

Returns the frame target label.

Method Detail

frameTypeback to summary
public int frameType()

Returns the raw u1 frame_type.

Returns:int

the raw u1 frame_type

localsback to summary
public List<StackMapFrameInfo.VerificationTypeInfo> locals()

Returns the expanded local variable types.

Returns:List<StackMapFrameInfo.VerificationTypeInfo>

the expanded local variable types

ofback to summary
public static StackMapFrameInfo of(Label target, List<StackMapFrameInfo.VerificationTypeInfo> locals, List<StackMapFrameInfo.VerificationTypeInfo> stack)

Returns a new stack map frame.

Parameters
target:Label

the location of the frame

locals:List<StackMapFrameInfo.VerificationTypeInfo>

the complete list of frame locals

stack:List<StackMapFrameInfo.VerificationTypeInfo>

the complete frame stack

Returns:StackMapFrameInfo

a new stack map frame

Exceptions
IllegalArgumentException:
if the number of types in locals or stack exceeds the limit of u2
stackback to summary
public List<StackMapFrameInfo.VerificationTypeInfo> stack()

Returns the expanded operand stack types.

Returns:List<StackMapFrameInfo.VerificationTypeInfo>

the expanded operand stack types

targetback to summary
public Label target()

Returns the frame target label.

Returns:Label

the frame target label

java.lang.classfile.attribute back to summary

public sealed Interface StackMapFrameInfo.ObjectVerificationTypeInfo

extends VerificationTypeInfo
permits ObjectVerificationTypeInfoImpl
Known Direct Implementers
jdk.internal.classfile.impl.StackMapDecoder.ObjectVerificationTypeInfoImpl

A stack value for an object type. Its tag is 7.
Since
24
Java Virtual Machine Specification
4.7.4 The StackMapTable Attribute

Field Summary

Inherited from java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo:
ITEM_DOUBLEITEM_FLOATITEM_INTEGERITEM_LONGITEM_NULLITEM_OBJECTITEM_TOPITEM_UNINITIALIZEDITEM_UNINITIALIZED_THIS

Method Summary

Modifier and TypeMethod and Description
public ClassEntry

Returns:

the class of the object
className
()

Returns the class of the object.

public default ClassDesc

Returns:

the class of the object, as a symbolic descriptor
classSymbol
()

Returns the class of the object, as a symbolic descriptor.

public static StackMapFrameInfo.ObjectVerificationTypeInfo

Returns:

a new object verification type info
of
(ClassEntry
the class of the object
className
)

Returns a new object verification type info.

public static StackMapFrameInfo.ObjectVerificationTypeInfo

Returns:

a new object verification type info
of
(ClassDesc
the class of the object
classDesc
)

Returns a new object verification type info.

Inherited from java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo:
tag

Method Detail

classNameback to summary
public ClassEntry className()

Returns the class of the object.

Returns:ClassEntry

the class of the object

classSymbolback to summary
public default ClassDesc classSymbol()

Returns the class of the object, as a symbolic descriptor.

Returns:ClassDesc

the class of the object, as a symbolic descriptor

ofback to summary
public static StackMapFrameInfo.ObjectVerificationTypeInfo of(ClassEntry className)

Returns a new object verification type info.

Parameters
className:ClassEntry

the class of the object

Returns:StackMapFrameInfo.ObjectVerificationTypeInfo

a new object verification type info

ofback to summary
public static StackMapFrameInfo.ObjectVerificationTypeInfo of(ClassDesc classDesc)

Returns a new object verification type info.

Parameters
classDesc:ClassDesc

the class of the object

Returns:StackMapFrameInfo.ObjectVerificationTypeInfo

a new object verification type info

Exceptions
IllegalArgumentException:
if classDesc represents a primitive type
java.lang.classfile.attribute back to summary

public final Enum StackMapFrameInfo.SimpleVerificationTypeInfo

extends Enum<StackMapFrameInfo.SimpleVerificationTypeInfo>
implements VerificationTypeInfo
Class Inheritance
All Implemented Interfaces
java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo

A simple stack value.
Since
24

Field Summary

Modifier and TypeField and Description
public static final StackMapFrameInfo.SimpleVerificationTypeInfo
DOUBLE

Verification type double.

public static final StackMapFrameInfo.SimpleVerificationTypeInfo
FLOAT

Verification type float.

public static final StackMapFrameInfo.SimpleVerificationTypeInfo
INTEGER

Verification type int.

public static final StackMapFrameInfo.SimpleVerificationTypeInfo
LONG

Verification type long.

public static final StackMapFrameInfo.SimpleVerificationTypeInfo
NULL

Verification type null.

private final int
public static final StackMapFrameInfo.SimpleVerificationTypeInfo
TOP

Verification type top.

public static final StackMapFrameInfo.SimpleVerificationTypeInfo
UNINITIALIZED_THIS

Verification type uninitializedThis.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
public static StackMapFrameInfo.SimpleVerificationTypeInfo
public static StackMapFrameInfo.SimpleVerificationTypeInfo[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DOUBLEback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo DOUBLE

Verification type double.

FLOATback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo FLOAT

Verification type float.

INTEGERback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo INTEGER

Verification type int.

LONGback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo LONG

Verification type long.

NULLback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo NULL

Verification type null.

tagback to summary
private final int tag
TOPback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo TOP

Verification type top.

UNINITIALIZED_THISback to summary
public static final StackMapFrameInfo.SimpleVerificationTypeInfo UNINITIALIZED_THIS

Verification type uninitializedThis.

Constructor Detail

SimpleVerificationTypeInfoback to summary
private SimpleVerificationTypeInfo(int tag)

Method Detail

tagback to summary
public int tag()

Implements java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo.tag.

Doc from java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo.tag.

Returns the tag of the type info.

Annotations
@Override
valueOfback to summary
public static StackMapFrameInfo.SimpleVerificationTypeInfo valueOf(String name)
valuesback to summary
public static StackMapFrameInfo.SimpleVerificationTypeInfo[] values()
java.lang.classfile.attribute back to summary

public sealed Interface StackMapFrameInfo.UninitializedVerificationTypeInfo

extends VerificationTypeInfo
permits UninitializedVerificationTypeInfoImpl
Known Direct Implementers
jdk.internal.classfile.impl.StackMapDecoder.UninitializedVerificationTypeInfoImpl

An uninitialized stack value. Its tag is 8.
Since
24
Java Virtual Machine Specification
4.7.4 The StackMapTable Attribute

Field Summary

Inherited from java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo:
ITEM_DOUBLEITEM_FLOATITEM_INTEGERITEM_LONGITEM_NULLITEM_OBJECTITEM_TOPITEM_UNINITIALIZEDITEM_UNINITIALIZED_THIS

Method Summary

Modifier and TypeMethod and Description
public Label

Returns:

the label immediately before the new instruction that creates this uninitialized object
newTarget
()

Returns the label immediately before the new instruction that creates this uninitialized object.

public static StackMapFrameInfo.UninitializedVerificationTypeInfo

Returns:

an uninitialized verification type info
of
(Label
the label immediately before the new instruction that creates this uninitialized object
newTarget
)

Returns an uninitialized verification type info.

Inherited from java.lang.classfile.attribute.StackMapFrameInfo.VerificationTypeInfo:
tag

Method Detail

newTargetback to summary
public Label newTarget()

Returns the label immediately before the new instruction that creates this uninitialized object.

Returns:Label

the label immediately before the new instruction that creates this uninitialized object

ofback to summary
public static StackMapFrameInfo.UninitializedVerificationTypeInfo of(Label newTarget)

Returns an uninitialized verification type info.

Parameters
newTarget:Label

the label immediately before the new instruction that creates this uninitialized object

Returns:StackMapFrameInfo.UninitializedVerificationTypeInfo

an uninitialized verification type info

java.lang.classfile.attribute back to summary

public sealed Interface StackMapFrameInfo.VerificationTypeInfo

permits SimpleVerificationTypeInfo, ObjectVerificationTypeInfo, UninitializedVerificationTypeInfo
Known Direct Subinterfaces
java.lang.classfile.attribute.StackMapFrameInfo.ObjectVerificationTypeInfo, java.lang.classfile.attribute.StackMapFrameInfo.UninitializedVerificationTypeInfo
Known Direct Implementers
java.lang.classfile.attribute.StackMapFrameInfo.SimpleVerificationTypeInfo

The type of a stack or local variable value.
Since
24
Java Virtual Machine Specification
4.7.4 The StackMapTable Attribute
See Also
locals(), stack()

Field Summary

Modifier and TypeField and Description
public static final int
ITEM_DOUBLE

The tag for verification type info DOUBLE.

public static final int
ITEM_FLOAT

The tag for verification type info FLOAT.

public static final int
ITEM_INTEGER

The tag for verification type info INTEGER.

public static final int
ITEM_LONG

The tag for verification type info LONG.

public static final int
ITEM_NULL

The tag for verification type info NULL.

public static final int
ITEM_OBJECT

The tag for verification type info OBJECT.

public static final int
ITEM_TOP

The tag for verification type info TOP.

public static final int
ITEM_UNINITIALIZED

The tag for verification type info UNINITIALIZED.

public static final int
ITEM_UNINITIALIZED_THIS

The tag for verification type info UNINITIALIZED_THIS.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the tag of the type info
tag
()

Returns the tag of the type info.

Field Detail

ITEM_DOUBLEback to summary
public static final int ITEM_DOUBLE

The tag for verification type info DOUBLE.

ITEM_FLOATback to summary
public static final int ITEM_FLOAT

The tag for verification type info FLOAT.

ITEM_INTEGERback to summary
public static final int ITEM_INTEGER

The tag for verification type info INTEGER.

ITEM_LONGback to summary
public static final int ITEM_LONG

The tag for verification type info LONG.

ITEM_NULLback to summary
public static final int ITEM_NULL

The tag for verification type info NULL.

ITEM_OBJECTback to summary
public static final int ITEM_OBJECT

The tag for verification type info OBJECT.

ITEM_TOPback to summary
public static final int ITEM_TOP

The tag for verification type info TOP.

ITEM_UNINITIALIZEDback to summary
public static final int ITEM_UNINITIALIZED

The tag for verification type info UNINITIALIZED.

ITEM_UNINITIALIZED_THISback to summary
public static final int ITEM_UNINITIALIZED_THIS

The tag for verification type info UNINITIALIZED_THIS.

Method Detail

tagback to summary
public int tag()

Returns the tag of the type info.

API Note

ITEM_-prefixed constants in this class, such as ITEM_TOP, describe the possible return values of this method.

Returns:int

the tag of the type info