Interface StackMapFrameInfo


public sealed interface StackMapFrameInfo
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.
See Java Virtual Machine Specification:
4.7.4 The StackMapTable Attribute
4.10.1 Verification by Type Checking
Since:
24
See Also:
  • Method Details

    • frameType

      int frameType()
      Returns the raw u1 frame_type.
      Returns:
      the raw u1 frame_type
    • target

      Label target()
      Returns the frame target label.
      Returns:
      the frame target label
    • locals

      Returns the expanded local variable types.
      Returns:
      the expanded local variable types
    • stack

      Returns the expanded operand stack types.
      Returns:
      the expanded operand stack types
    • unsetFields

      List<NameAndTypeEntry> unsetFields()
      unsetFields is a reflective preview API of the Java platform.
      Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
      Returns the expanded unset fields.

      If this stack map frame is declared in a class file that does not depend on preview features, the list of unset fields is always empty. If the class file depends on preview features, this method returns the list of unset fields.

      Returns:
      the expanded unset fields
      See Java Virtual Machine Specification:
      4.7.4 The StackMapTable AttributePREVIEW
      Since:
      28
    • of

      Returns a new stack map frame.
      Parameters:
      target - the location of the frame
      locals - the complete list of frame locals
      stack - the complete frame stack
      Returns:
      a new stack map frame
      Throws:
      IllegalArgumentException - if the number of types in locals or stack exceeds the limit of u2
    • of

      of is a reflective preview API of the Java platform.
      Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
      Returns a new stack map frame.

      If this stack map frame is declared in a class file that does not depend on preview features, the list of unset fields must be empty; otherwise, the class file must declare that it depends on preview features if the unset fields list contains any item.

      Parameters:
      target - the location of the frame
      locals - the complete list of frame locals
      stack - the complete frame stack
      unsetFields - the complete list of unset fields
      Returns:
      a new stack map frame
      Throws:
      IllegalArgumentException - if the number of elements in locals, stack, or unsetFields exceeds the limit of u2; or if unset fields has elements, but no uninitializedThis is present in locals
      Since:
      28