Warning
long and double values are represented with two slots in local variables, and with one slot in the operand stack.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | MAX_STACK_SIZE
The maximum size of the operand stack of any method. |
| private int | maxStack
The maximum number of elements in the operand stack. |
| private int | numLocals
The number of local variables of this frame. |
| private int | numStack
The number of elements in the operand stack. |
| private V | returnValue
The expected return type of the analyzed method, or null if the method returns void. |
| private V[] | values
The local variables and the operand stack of this frame. |
| Access | Constructor and Description |
|---|---|
| public | Frame(final int
the number of local variables of the frame. Long and double values are
represented with two elements. numLocals, final int the maximum number of elements in the operand stack, or -1 if there is no
maximum value. Long and double values are represented with a single element. maxStack)Constructs a new frame with the given size. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | execute(final AbstractInsnNode
the instruction to execute. insn, final Interpreter<V> the interpreter to use to compute values from other values. interpreter)Simulates the execution of the given instruction on this execution stack frame. |
| private boolean | |
| private void | executeInvokeInsn(final AbstractInsnNode insn, final String methodDescriptor, final Interpreter<V> interpreter)
|
| public V | Returns: the value of the given local variable.a local variable index. index)Returns the value of the given local variable. |
| public int | Returns: the maximum number of local variables of this frame.Returns the maximum number of local variables of this frame. |
| public int | Returns: the maximum number of elements in the operand stack of this frame.Returns the maximum number of elements in the operand stack of this frame. |
| public V | Returns: the value of the given operand stack slot.the index of an operand stack slot. index)Returns the value of the given operand stack slot. |
| public int | Returns: the number of elements in the operand stack of this frame.Returns the number of elements in the operand stack of this frame. |
| public Frame | |
| public void | initJumpTarget(final int
the opcode of the jump instruction. Can be IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE,
IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE,
GOTO, JSR, IFNULL, IFNONNULL, TABLESWITCH or LOOKUPSWITCH. opcode, final LabelNode a target of the jump instruction this frame corresponds to, or null if
this frame corresponds to the successor of the jump instruction (i.e. the next instruction
in the instructions sequence). target)Initializes a frame corresponding to the target or to the successor of a jump instruction. |
| public boolean | Returns: true if this frame has been changed as a result of the merge operation, or false otherwise.a frame. This frame is left unchanged by this method. frame, final Interpreter<V> the interpreter used to merge values. interpreter)Merges the given frame into this frame. |
| public boolean | Returns: true if this frame has been changed as a result of the merge operation, or false otherwise.a frame. This frame is left unchanged by this method. frame, final boolean[] the local variables that are read or written by the subroutine. The i-th
element is true if and only if the local variable at index i is read or written by the
subroutine. localsUsed)Merges the given frame into this frame (case of a subroutine). |
| public V | Returns: the value that has been popped from the stack.Pops a value from the operand stack of this frame. |
| public void | push(final V
the value that must be pushed into the stack. value)Pushes a value into the operand stack of this frame. |
| public void | setLocal(final int
a local variable index. index, final V the new value of this local variable. value)Sets the value of the given local variable. |
| public void | setReturn(final V
the expected return type of the analyzed method, or null if the method
returns void. v)Sets the expected return type of the analyzed method. |
| public void | setStack(final int
the index of an operand stack slot. index, final V the new value of the stack slot. value)Sets the value of the given stack slot. |
| public String | Returns: a string representation of this frame.Overrides java. |
| MAX_STACK_SIZE | back to summary |
|---|---|
| private static final int MAX_STACK_SIZE The maximum size of the operand stack of any method. | |
| maxStack | back to summary |
|---|---|
| private int maxStack The maximum number of elements in the operand stack. Long and double values are represented with a single element. | |
| numLocals | back to summary |
|---|---|
| private int numLocals The number of local variables of this frame. Long and double values are represented with two elements. | |
| numStack | back to summary |
|---|---|
| private int numStack The number of elements in the operand stack. Long and double values are represented with a single element. | |
| returnValue | back to summary |
|---|---|
| private V returnValue The expected return type of the analyzed method, or null if the method returns void. | |
| values | back to summary |
|---|---|
| private V[] values The local variables and the operand stack of this frame. The first | |
| Frame | back to summary |
|---|---|
| public Frame(final int numLocals, final int maxStack) Constructs a new frame with the given size.
| |
| Frame | back to summary |
|---|---|
| public Frame(final Frame<? extends V> frame) Constructs a copy of the given Frame.
| |
| clearStack | back to summary |
|---|---|
| public void clearStack() Clears the operand stack of this frame. | |
| execute | back to summary |
|---|---|
| public void execute(final AbstractInsnNode insn, final Interpreter<V> interpreter) throws AnalyzerException Simulates the execution of the given instruction on this execution stack frame.
| |
| executeDupX2 | back to summary |
|---|---|
| private boolean executeDupX2(final AbstractInsnNode insn, final V value1, final Interpreter<V> interpreter) throws AnalyzerException | |
| executeInvokeInsn | back to summary |
|---|---|
| private void executeInvokeInsn(final AbstractInsnNode insn, final String methodDescriptor, final Interpreter<V> interpreter) throws AnalyzerException | |
| getLocal | back to summary |
|---|---|
| public V getLocal(final int index) Returns the value of the given local variable. Long and double values are represented with two variables.
| |
| getLocals | back to summary |
|---|---|
| public int getLocals() Returns the maximum number of local variables of this frame. Long and double values are represented with two variables.
| |
| getMaxStackSize | back to summary |
|---|---|
| public int getMaxStackSize() Returns the maximum number of elements in the operand stack of this frame. Long and double values are represented with a single element.
| |
| getStack | back to summary |
|---|---|
| public V getStack(final int index) Returns the value of the given operand stack slot.
| |
| getStackSize | back to summary |
|---|---|
| public int getStackSize() Returns the number of elements in the operand stack of this frame. Long and double values are represented with a single element.
| |
| init | back to summary |
|---|---|
| public Frame Copies the state of the given frame into this frame. | |
| initJumpTarget | back to summary |
|---|---|
| public void initJumpTarget(final int opcode, final LabelNode target) Initializes a frame corresponding to the target or to the successor of a jump instruction. This
method is called by Overriding this method and changing the frame values allows implementing branch-sensitive analyses.
| |
| merge | back to summary |
|---|---|
| public boolean merge(final Frame<? extends V> frame, final Interpreter<V> interpreter) throws AnalyzerException Merges the given frame into this frame.
| |
| merge | back to summary |
|---|---|
| public boolean merge(final Frame<? extends V> frame, final boolean[] localsUsed) Merges the given frame into this frame (case of a subroutine). The operand stacks are not merged, and only the local variables that have not been used by the subroutine are merged.
| |
| pop | back to summary |
|---|---|
| public V pop() Pops a value from the operand stack of this frame.
| |
| push | back to summary |
|---|---|
| public void push(final V value) Pushes a value into the operand stack of this frame.
| |
| setLocal | back to summary |
|---|---|
| public void setLocal(final int index, final V value) Sets the value of the given local variable. Long and double values are represented with two variables.
| |
| setReturn | back to summary |
|---|---|
| public void setReturn(final V v) Sets the expected return type of the analyzed method.
| |
| setStack | back to summary |
|---|---|
| public void setStack(final int index, final V value) Sets the value of the given stack slot.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this frame. | |