org.objectweb.asm.tree.analysis
Class Frame
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.
Frame(int nLocals, int nStack) - Constructs a new frame with the given size.
|
Frame(Frame src) - Constructs a new frame that is identical to the given frame.
|
void | clearStack() - Clears the operand stack of this frame.
|
void | execute(AbstractInsnNode insn, Interpreter interpreter)
|
Value | getLocal(int i) - Returns the value of the given local variable.
|
int | getLocals() - Returns the maximum number of local variables of this frame.
|
Value | getStack(int i) - Returns the value of the given operand stack slot.
|
int | getStackSize() - Returns the number of values in the operand stack of this frame.
|
Frame | init(Frame src) - Copies the state of the given frame into this frame.
|
boolean | merge(Frame frame, boolean[] access) - Merges this frame with the given frame (case of a RET instruction).
|
boolean | merge(Frame frame, Interpreter interpreter) - Merges this frame with the given frame.
|
Value | pop() - Pops a value from the operand stack of this frame.
|
void | push(Value value) - Pushes a value into the operand stack of this frame.
|
void | setLocal(int i, Value value) - Sets the value of the given local variable.
|
String | toString() - Returns a string representation of this frame.
|
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 src)
Constructs a new frame that is identical to the given frame.
clearStack
public void clearStack()
Clears the operand stack of this frame.
getLocal
public Value getLocal(int i)
throws AnalyzerException
Returns the value of the given local variable.
i
- a local variable index.
- the value of the given local variable.
getLocals
public int getLocals()
Returns the maximum number of local variables of this frame.
- the maximum number of local variables of this frame.
getStack
public Value getStack(int i)
throws AnalyzerException
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.
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.
init
public Frame init(Frame src)
Copies the state of the given frame into this frame.
merge
public boolean merge(Frame frame,
boolean[] access)
Merges this frame with the given frame (case of a RET instruction).
frame
- a frameaccess
- 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.
merge
public boolean merge(Frame frame,
Interpreter 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.
pop
public Value pop()
throws AnalyzerException
Pops a value from the operand stack of this frame.
- the value that has been popped from the stack.
push
public void push(Value value)
throws AnalyzerException
Pushes a value into the operand stack of this frame.
value
- the value that must be pushed into the stack.
setLocal
public void setLocal(int i,
Value value)
throws AnalyzerException
Sets the value of the given local variable.
i
- a local variable index.value
- the new value of this local variable.
toString
public String toString()
Returns a string representation of this frame.
- a string representation of this frame.