Package org.jboss.classfilewriter.code
Class StackFrame
- java.lang.Object
-
- org.jboss.classfilewriter.code.StackFrame
-
public class StackFrame extends java.lang.Object
Represents a stack frame in the virtual machine. Holds the state of the local variable array and the stack
-
-
Field Summary
Fields Modifier and Type Field Description private LocalVariableState
localVariableState
The local variable stateprivate StackState
stackState
The current state of the stackprivate StackFrameType
type
-
Constructor Summary
Constructors Constructor Description StackFrame(ClassMethod method)
Creates the initial stack frameStackFrame(StackState stackState, LocalVariableState localVariableState, StackFrameType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackFrame
aconstNull()
pushes a null type onto the stackStackFrame
constructorCall(int initializedValueStackPosition)
marks the value in potition initializedValueStackPosition as initialized.StackFrame
dup()
StackFrame
dup2()
StackFrame
dup2X1()
StackFrame
dup2X2()
StackFrame
dupX1()
StackFrame
dupX2()
LocalVariableState
getLocalVariableState()
StackState
getStackState()
StackFrameType
getType()
StackFrame
pop()
pops an operand from the stackStackFrame
pop(int no)
StackFrame
pop2()
pops 2 operands from the stackStackFrame
pop2push1(java.lang.String type)
remote the top two operands and replace them with an different operandStackFrame
pop3()
pops 3 operands from the stackStackFrame
pop4()
pops 4 operands from the stackStackFrame
pop4push1(java.lang.String type)
remote the top two operands and replace them with an different operandStackFrame
push(java.lang.String type)
push an operand of the given type onto the stackStackFrame
push(StackEntry entry)
push an operand of the given type onto the stack.StackFrame
replace(java.lang.String type)
replace the operand at the top of the stack with the given operandStackFrame
store(int no)
Store the variable on top of the stack into a local variable, poping the variable from the stack.StackFrame
swap()
java.lang.String
toString()
private StackFrameType
typeNoLocalChange(StackState ns)
determins the type of stack frame this is when no local variables have changed
-
-
-
Field Detail
-
stackState
private final StackState stackState
The current state of the stack
-
localVariableState
private final LocalVariableState localVariableState
The local variable state
-
type
private final StackFrameType type
-
-
Constructor Detail
-
StackFrame
public StackFrame(ClassMethod method)
Creates the initial stack frame
-
StackFrame
public StackFrame(StackState stackState, LocalVariableState localVariableState, StackFrameType type)
-
-
Method Detail
-
getStackState
public StackState getStackState()
-
getLocalVariableState
public LocalVariableState getLocalVariableState()
-
push
public StackFrame push(java.lang.String type)
push an operand of the given type onto the stackIf the entry is wide then a corresponding TOP type will be created
-
push
public StackFrame push(StackEntry entry)
push an operand of the given type onto the stack.If the entry is wide then a corresponding TOP type will be created
-
aconstNull
public StackFrame aconstNull()
pushes a null type onto the stack- Returns:
-
pop
public StackFrame pop(int no)
-
pop
public StackFrame pop()
pops an operand from the stack
-
pop2
public StackFrame pop2()
pops 2 operands from the stack
-
pop3
public StackFrame pop3()
pops 3 operands from the stack
-
pop4
public StackFrame pop4()
pops 4 operands from the stack
-
replace
public StackFrame replace(java.lang.String type)
replace the operand at the top of the stack with the given operand
-
dup
public StackFrame dup()
-
dupX1
public StackFrame dupX1()
-
dupX2
public StackFrame dupX2()
-
dup2
public StackFrame dup2()
-
dup2X1
public StackFrame dup2X1()
-
dup2X2
public StackFrame dup2X2()
-
store
public StackFrame store(int no)
Store the variable on top of the stack into a local variable, poping the variable from the stack. Wide types are handled automatically
-
pop2push1
public StackFrame pop2push1(java.lang.String type)
remote the top two operands and replace them with an different operand
-
pop4push1
public StackFrame pop4push1(java.lang.String type)
remote the top two operands and replace them with an different operand
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
constructorCall
public StackFrame constructorCall(int initializedValueStackPosition)
marks the value in potition initializedValueStackPosition as initialized. This also pops this value and everything above it
-
swap
public StackFrame swap()
-
typeNoLocalChange
private StackFrameType typeNoLocalChange(StackState ns)
determins the type of stack frame this is when no local variables have changed
-
getType
public StackFrameType getType()
-
-