public class Frame extends Object
| Constructor and Description |
|---|
Frame(Frame src)
Constructs a new frame that is identical to the given frame.
|
Frame(int nLocals,
int nStack)
Constructs a new frame with the given size.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public Frame(int nLocals,
int nStack)
nLocals - the maximum number of local variables of the frame.nStack - the maximum stack size of the frame.public Frame(Frame src)
src - a frame.public Frame init(Frame src)
src - a frame.public int getLocals()
public Value getLocal(int i) throws IndexOutOfBoundsException
i - a local variable index.IndexOutOfBoundsException - if the variable does not exist.public void setLocal(int i,
Value value)
throws IndexOutOfBoundsException
i - a local variable index.value - the new value of this local variable.IndexOutOfBoundsException - if the variable does not exist.public int getStackSize()
public Value getStack(int i) throws IndexOutOfBoundsException
i - the index of an operand stack slot.IndexOutOfBoundsException - if the operand stack slot does not
exist.public void clearStack()
public Value pop() throws IndexOutOfBoundsException
IndexOutOfBoundsException - if the operand stack is empty.public void push(Value value) throws IndexOutOfBoundsException
value - the value that must be pushed into the stack.IndexOutOfBoundsException - if the operand stack is full.public void execute(AbstractInsnNode insn, Interpreter interpreter) throws AnalyzerException
AnalyzerExceptionpublic boolean merge(Frame frame, Interpreter interpreter) throws AnalyzerException
frame - a frame.interpreter - the interpreter used to merge values.AnalyzerException - if the frames have incompatible sizes.public boolean merge(Frame frame, boolean[] access)
frame - a frameaccess - the local variables that have been accessed by the
subroutine to which the RET instruction corresponds.Copyright © 2018. All rights reserved.