Class StackManipulation.Size

java.lang.Object
net.bytebuddy.implementation.bytecode.StackManipulation.Size
Enclosing interface:
StackManipulation

@Enhance public static class StackManipulation.Size extends Object
A description of the size change that is imposed by some StackManipulation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The maximal size of stack slots this stack manipulation ever requires.
    private final int
    The impact of any size operation onto the operand stack.
    A size of zero.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Size(int sizeImpact, int maximalSize)
    Creates an immutable descriptor of the size change that is implied by some stack manipulation.
  • Method Summary

    Modifier and Type
    Method
    Description
    aggregate(int sizeChange, int interimMaximalSize)
    Aggregates a size change with this stack manipulation size.
    Concatenates this size representation with another size representation in order to represent the size change that is represented by both alterations of the operand stack size.
    int
    Returns the maximal interim size of the operand stack that is represented by this instance.
    int
    Returns the size change on the operand stack that is represented by this instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ZERO

      public static final StackManipulation.Size ZERO
      A size of zero.
    • sizeImpact

      private final int sizeImpact
      The impact of any size operation onto the operand stack. This value can be negative if more values were consumed from the stack than added to it.
    • maximalSize

      private final int maximalSize
      The maximal size of stack slots this stack manipulation ever requires. If an operation for example pushes five values onto the stack and subsequently consumes three operations, this value should still be five to express that a stack operation requires at least five slots in order to be applicable.
  • Constructor Details

    • Size

      public Size(int sizeImpact, int maximalSize)
      Creates an immutable descriptor of the size change that is implied by some stack manipulation.
      Parameters:
      sizeImpact - The change of the size of the operand stack that is implied by some stack manipulation.
      maximalSize - The maximal stack size that is required for executing this stack manipulation. Should never be negative number.
  • Method Details

    • getSizeImpact

      public int getSizeImpact()
      Returns the size change on the operand stack that is represented by this instance.
      Returns:
      The size change on the operand stack that is represented by this instance.
    • getMaximalSize

      public int getMaximalSize()
      Returns the maximal interim size of the operand stack that is represented by this instance.
      Returns:
      The maximal interim size of the operand stack that is represented by this instance.
    • aggregate

      Concatenates this size representation with another size representation in order to represent the size change that is represented by both alterations of the operand stack size.
      Parameters:
      other - The other size representation.
      Returns:
      A new size representation representing both stack size requirements.
    • aggregate

      private StackManipulation.Size aggregate(int sizeChange, int interimMaximalSize)
      Aggregates a size change with this stack manipulation size.
      Parameters:
      sizeChange - The change in size the other operation implies.
      interimMaximalSize - The interim maximal size of the operand stack that the other operation requires at least to function.
      Returns:
      The aggregated size.