Class StackTypes


  • public final class StackTypes
    extends java.lang.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("operandStacks") [] localVariableses
      The state of the live local variables at each instruction location.
      (package private) org.apache.bcel.verifier.structurals.OperandStack @SameLen("localVariableses") [] operandStacks
      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({"localVariableses", "operandStacks"}) int offset)
      Returns the stack contents at the specified offset.
      void set​(@org.checkerframework.checker.index.qual.IndexFor({"localVariableses", "operandStacks"}) 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.
      java.lang.String toString()  
      java.lang.String toString​(org.apache.bcel.verifier.structurals.LocalVariables lv)
      Return a printed representation of the given LocalVariables.
      java.lang.String toString​(org.apache.bcel.verifier.structurals.OperandStack os)
      Return a printed representation of the given OperandStack.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • operandStacks

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

        org.apache.bcel.verifier.structurals.LocalVariables @SameLen("operandStacks") [] localVariableses
        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({"localVariableses", "operandStacks"}) 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({"localVariableses", "operandStacks"}) 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 java.lang.String toString​(@GuardSatisfied StackTypes this)
        Overrides:
        toString in class java.lang.Object
      • toString

        @SideEffectFree
        public java.lang.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 java.lang.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