Class StackTypes

java.lang.Object
org.plumelib.bcelutil.StackTypes

public final class StackTypes extends Object
Stores the types on the stack at each instruction (identified by byte code offset) in a method.
  • 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

    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.
     
    toString(org.apache.bcel.verifier.structurals.LocalVariables lv)
    Return a printed representation of the given LocalVariables.
    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
  • Constructor Details

    • 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 Details

    • 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 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