Class StackTypes


  • public final class StackTypes
    extends Object
    Stores the types on the stack at each instruction (identified by byte code offset) in a method.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) org.apache.bcel.verifier.structurals.LocalVariables @SameLen("os_arr") [] loc_arr
      The state of the live local variables at each instruction location.
      (package private) org.apache.bcel.verifier.structurals.OperandStack @SameLen("loc_arr") [] os_arr
      The state of the operand stack at each instruction location.
    • Constructor Summary

      Constructors 
      Constructor Description
      StackTypes​(org.apache.bcel.generic.MethodGen mg)
      Create a record of the types on the stack at each instruction in a method.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.bcel.verifier.structurals.OperandStack get​(@org.checkerframework.checker.index.qual.IndexFor({"loc_arr", "os_arr"}) int offset)
      Returns the stack contents at the specified offset.
      void set​(@org.checkerframework.checker.index.qual.IndexFor({"loc_arr", "os_arr"}) int offset, org.apache.bcel.verifier.structurals.Frame f)
      Sets the stack for the instruction at the specified offset to a copy of the information in the given frame.
      String toString()  
      String toString​(org.apache.bcel.verifier.structurals.LocalVariables lv)
      Return a printed representation of the given LocalVariables.
      String toString​(org.apache.bcel.verifier.structurals.OperandStack os)
      Return a printed representation of the given OperandStack.
    • Field Detail

      • os_arr

        org.apache.bcel.verifier.structurals.OperandStack @SameLen("loc_arr") [] os_arr
        The state of the operand stack at each instruction location. The instruction's byte code offset is used as the index.
      • loc_arr

        org.apache.bcel.verifier.structurals.LocalVariables @SameLen("os_arr") [] loc_arr
        The state of the live local variables at each instruction location. The instruction's byte code offset is used as the index.
    • Constructor Detail

      • StackTypes

        public StackTypes​(org.apache.bcel.generic.MethodGen mg)
        Create a record of the types on the stack at each instruction in a method. The created object starts out empty, with no type information.
        Parameters:
        mg - the method
    • Method Detail

      • set

        public void set​(@org.checkerframework.checker.index.qual.IndexFor({"loc_arr", "os_arr"}) int offset,
                        org.apache.bcel.verifier.structurals.Frame f)
        Sets the stack for the instruction at the specified offset to a copy of the information in the given frame.
        Parameters:
        offset - the offset at which the instruction appears
        f - the stack frame to use for the instruction
      • get

        public org.apache.bcel.verifier.structurals.OperandStack get​(@org.checkerframework.checker.index.qual.IndexFor({"loc_arr", "os_arr"}) int offset)
        Returns the stack contents at the specified offset.
        Parameters:
        offset - the offset to which to get the stack contents
        Returns:
        the stack at the (instruction at the) given offset
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied StackTypes this)
        Overrides:
        toString in class Object
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied StackTypes this,
                               org.apache.bcel.verifier.structurals.OperandStack os)
        Return a printed representation of the given OperandStack.
        Parameters:
        os - the OperandStack to print
        Returns:
        a printed representation of os
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied StackTypes this,
                               org.apache.bcel.verifier.structurals.LocalVariables lv)
        Return a printed representation of the given LocalVariables.
        Parameters:
        lv - the LocalVariablesStack to print
        Returns:
        a printed representation of lv