Enum StackSize

    • Enum Constant Detail

      • ZERO

        public static final StackSize ZERO
        An empty stack size.
      • SINGLE

        public static final StackSize SINGLE
        A single slot stack size.
      • DOUBLE

        public static final StackSize DOUBLE
        A double slot stack size which is required by long and double values.
    • Method Detail

      • values

        public static StackSize[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (StackSize c : StackSize.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StackSize valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • of

        public static StackSize of​(Class<?> type)
        Finds the operand stack size of a given Java type.
        Parameters:
        type - The type of interest.
        Returns:
        The given type's operand stack size.
      • of

        public static StackSize of​(int size)
        Represents a numeric size as a StackSize.
        Parameters:
        size - The size to represent. Must be 0, 1 or 2.
        Returns:
        A stack size representation for the given value.
      • of

        public static int of​(TypeDefinition... typeDefinition)
        Computes the stack size of all supplied types.
        Parameters:
        typeDefinition - The types for which to compute the size.
        Returns:
        The total size of all types.
      • of

        public static int of​(Collection<? extends TypeDefinition> typeDefinitions)
        Computes the stack size of all supplied types.
        Parameters:
        typeDefinitions - The types for which to compute the size.
        Returns:
        The total size of all types.
      • getSize

        public int getSize()
        The numeric value of this stack size representation.
        Returns:
        An integer representing the operand stack size.
      • toIncreasingSize

        public StackManipulation.Size toIncreasingSize()
        Creates an instance of a StackManipulation.Size that describes a stack growth of this size.
        Returns:
        A stack size growth by the size represented by this stack size.
      • toDecreasingSize

        public StackManipulation.Size toDecreasingSize()
        Creates an instance of a StackManipulation.Size that describes a stack decrease of this size.
        Returns:
        A stack size decrease by the size represented by this stack size.
      • maximum

        public StackSize maximum​(StackSize stackSize)
        Determines the maximum of two stack size representations.
        Parameters:
        stackSize - The other stack size representation.
        Returns:
        The maximum of this and the other stack size.