Class Stack


  • public final class Stack
    extends Object
    The abstract operand stack: a growable array of StackCtx (one logical entry per value; a long/double is a single wide entry).
    • Constructor Detail

      • Stack

        public Stack​(int maxStack)
        Creates an empty stack sized for the method's declared max stack.
        Parameters:
        maxStack - the method's declared operand-stack depth
      • Stack

        public Stack​(Stack other)
        Copies another stack for a forked frame.
        Parameters:
        other - the stack to copy
    • Method Detail

      • push

        public void push​(StackCtx ctx)
        Pushes an entry, growing the backing array if needed.
        Parameters:
        ctx - the entry to push
      • peek

        public StackCtx peek()
        Returns the top entry without removing it.
        Returns:
        the top stack entry
      • getSize

        public int getSize()
        Returns:
        the size