类 Frame<V extends Value>

java.lang.Object
org.beetl.ow2.asm.tree.analysis.Frame<V>
类型参数:
V - type of the Value used for the analysis.

public class Frame<V extends Value> extends Object
A symbolic execution stack frame. A stack frame contains a set of local variable slots, and an operand stack. Warning: long and double values are represented by two slots in local variables, and by one slot in the operand stack.
作者:
Eric Bruneton
  • 构造器概要

    构造器
    构造器
    说明
    Frame(int nLocals, int nStack)
    Constructs a new frame with the given size.
    Frame(Frame<? extends V> src)
    Constructs a new frame that is identical to the given frame.
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Clears the operand stack of this frame.
    void
    execute(AbstractInsnNode insn, Interpreter<V> interpreter)
     
    getLocal(int i)
    Returns the value of the given local variable.
    int
    Returns the maximum number of local variables of this frame.
    int
    Returns the maximum stack size of this frame.
    getStack(int i)
    Returns the value of the given operand stack slot.
    int
    Returns the number of values in the operand stack of this frame.
    init(Frame<? extends V> src)
    Copies the state of the given frame into this frame.
    boolean
    merge(Frame<? extends V> frame, boolean[] access)
    Merges this frame with the given frame (case of a RET instruction).
    boolean
    merge(Frame<? extends V> frame, Interpreter<V> interpreter)
    Merges this frame with the given frame.
    pop()
    Pops a value from the operand stack of this frame.
    void
    push(V value)
    Pushes a value into the operand stack of this frame.
    void
    setLocal(int i, V value)
    Sets the value of the given local variable.
    void
    Sets the expected return type of the analyzed method.
    Returns a string representation of this frame.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 构造器详细资料

    • Frame

      public Frame(int nLocals, int nStack)
      Constructs a new frame with the given size.
      参数:
      nLocals - the maximum number of local variables of the frame.
      nStack - the maximum stack size of the frame.
    • Frame

      public Frame(Frame<? extends V> src)
      Constructs a new frame that is identical to the given frame.
      参数:
      src - a frame.
  • 方法详细资料

    • init

      public Frame<V> init(Frame<? extends V> src)
      Copies the state of the given frame into this frame.
      参数:
      src - a frame.
      返回:
      this frame.
    • setReturn

      public void setReturn(V v)
      Sets the expected return type of the analyzed method.
      参数:
      v - the expected return type of the analyzed method, or null if the method returns void.
    • getLocals

      public int getLocals()
      Returns the maximum number of local variables of this frame.
      返回:
      the maximum number of local variables of this frame.
    • getMaxStackSize

      public int getMaxStackSize()
      Returns the maximum stack size of this frame.
      返回:
      the maximum stack size of this frame.
    • getLocal

      public V getLocal(int i) throws IndexOutOfBoundsException
      Returns the value of the given local variable.
      参数:
      i - a local variable index.
      返回:
      the value of the given local variable.
      抛出:
      IndexOutOfBoundsException - if the variable does not exist.
    • setLocal

      public void setLocal(int i, V value) throws IndexOutOfBoundsException
      Sets the value of the given local variable.
      参数:
      i - a local variable index.
      value - the new value of this local variable.
      抛出:
      IndexOutOfBoundsException - if the variable does not exist.
    • getStackSize

      public int getStackSize()
      Returns the number of values in the operand stack of this frame. Long and double values are treated as single values.
      返回:
      the number of values in the operand stack of this frame.
    • getStack

      public V getStack(int i) throws IndexOutOfBoundsException
      Returns the value of the given operand stack slot.
      参数:
      i - the index of an operand stack slot.
      返回:
      the value of the given operand stack slot.
      抛出:
      IndexOutOfBoundsException - if the operand stack slot does not exist.
    • clearStack

      public void clearStack()
      Clears the operand stack of this frame.
    • pop

      public V pop() throws IndexOutOfBoundsException
      Pops a value from the operand stack of this frame.
      返回:
      the value that has been popped from the stack.
      抛出:
      IndexOutOfBoundsException - if the operand stack is empty.
    • push

      public void push(V value) throws IndexOutOfBoundsException
      Pushes a value into the operand stack of this frame.
      参数:
      value - the value that must be pushed into the stack.
      抛出:
      IndexOutOfBoundsException - if the operand stack is full.
    • execute

      public void execute(AbstractInsnNode insn, Interpreter<V> interpreter) throws AnalyzerException
      抛出:
      AnalyzerException
    • merge

      public boolean merge(Frame<? extends V> frame, Interpreter<V> interpreter) throws AnalyzerException
      Merges this frame with the given frame.
      参数:
      frame - a frame.
      interpreter - the interpreter used to merge values.
      返回:
      true if this frame has been changed as a result of the merge operation, or false otherwise.
      抛出:
      AnalyzerException - if the frames have incompatible sizes.
    • merge

      public boolean merge(Frame<? extends V> frame, boolean[] access)
      Merges this frame with the given frame (case of a RET instruction).
      参数:
      frame - a frame
      access - the local variables that have been accessed by the subroutine to which the RET instruction corresponds.
      返回:
      true if this frame has been changed as a result of the merge operation, or false otherwise.
    • toString

      public String toString()
      Returns a string representation of this frame.
      覆盖:
      toString 在类中 Object
      返回:
      a string representation of this frame.