Class Variables


  • public final class Variables
    extends Object
    The abstract local-variable table: an array of VarCtx indexed by slot.
    • Constructor Detail

      • Variables

        public Variables​(int maxLocals)
        Creates a table sized for the method's declared max locals.
        Parameters:
        maxLocals - the method's declared local-slot count
      • Variables

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

      • set

        public void set​(int index,
                        VarCtx value)
        Writes a slot, ignoring out-of-range indices.
        Parameters:
        index - the slot index
        value - the context to store
      • get

        public VarCtx get​(int index)
        Reads a slot, returning null when the index is out of range or the slot is unset.
        Parameters:
        index - the slot index
        Returns:
        the slot's context, or null
      • size

        public int size()
        Returns:
        the number of local slots