Top Description Fields Constructors Methods
org.jboss.classfilewriter.code

public Class StackFrame

extends Object
Class Inheritance
Imports
org.jboss.classfilewriter.ClassMethod

Represents a stack frame in the virtual machine. Holds the state of the local variable array and the stack
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final LocalVariableState
localVariableState

The local variable state

private final StackState
stackState

The current state of the stack

private final StackFrameType

Constructor Summary

AccessConstructor and Description
public
StackFrame(ClassMethod method)

Creates the initial stack frame

public
StackFrame(StackState stackState, LocalVariableState localVariableState, StackFrameType type)

Method Summary

Modifier and TypeMethod and Description
public StackFrame
aconstNull()

pushes a null type onto the stack

public StackFrame
constructorCall(int initializedValueStackPosition)

marks the value in potition initializedValueStackPosition as initialized.

public StackFrame
public StackFrame
dup()

public StackFrame
dup2()

public StackFrame
public StackFrame
public StackFrame
public StackFrame
public LocalVariableState
public StackState
public StackFrameType
public StackFrame
mergeLocals(int pos, StackEntry frame)

public StackFrame
mergeStack(int pos, StackEntry frame)

public StackFrame
pop(int no)

public StackFrame
pop()

pops an operand from the stack

public StackFrame
pop2()

pops 2 operands from the stack

public StackFrame
pop2push1(String type)

remote the top two operands and replace them with an different operand

public StackFrame
pop3()

pops 3 operands from the stack

public StackFrame
pop4()

pops 4 operands from the stack

public StackFrame
pop4push1(String type)

remote the top two operands and replace them with an different operand

public StackFrame
push(String type)

push an operand of the given type onto the stack

If the entry is wide then a corresponding TOP type will be created

public StackFrame
push(StackEntry entry)

push an operand of the given type onto the stack.

public StackFrame
replace(String type)

replace the operand at the top of the stack with the given operand

public StackFrame
store(int no)

Store the variable on top of the stack into a local variable, poping the variable from the stack.

public StackFrame
swap()

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private StackFrameType
typeNoLocalChange(StackState ns)

determins the type of stack frame this is when no local variables have changed

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

localVariableStateback to summary
private final LocalVariableState localVariableState

The local variable state

stackStateback to summary
private final StackState stackState

The current state of the stack

typeback to summary
private final StackFrameType type

Constructor Detail

StackFrameback to summary
public StackFrame(ClassMethod method)

Creates the initial stack frame

StackFrameback to summary
public StackFrame(StackState stackState, LocalVariableState localVariableState, StackFrameType type)

Method Detail

aconstNullback to summary
public StackFrame aconstNull()

pushes a null type onto the stack

constructorCallback to summary
public StackFrame constructorCall(int initializedValueStackPosition)

marks the value in potition initializedValueStackPosition as initialized. This also pops this value and everything above it

createFullback to summary
public StackFrame createFull()
dupback to summary
public StackFrame dup()
dup2back to summary
public StackFrame dup2()
dup2X1back to summary
public StackFrame dup2X1()
dup2X2back to summary
public StackFrame dup2X2()
dupX1back to summary
public StackFrame dupX1()
dupX2back to summary
public StackFrame dupX2()
getLocalVariableStateback to summary
public LocalVariableState getLocalVariableState()
getStackStateback to summary
public StackState getStackState()
getTypeback to summary
public StackFrameType getType()
mergeLocalsback to summary
public StackFrame mergeLocals(int pos, StackEntry frame)
mergeStackback to summary
public StackFrame mergeStack(int pos, StackEntry frame)
popback to summary
public StackFrame pop(int no)
popback to summary
public StackFrame pop()

pops an operand from the stack

pop2back to summary
public StackFrame pop2()

pops 2 operands from the stack

pop2push1back to summary
public StackFrame pop2push1(String type)

remote the top two operands and replace them with an different operand

pop3back to summary
public StackFrame pop3()

pops 3 operands from the stack

pop4back to summary
public StackFrame pop4()

pops 4 operands from the stack

pop4push1back to summary
public StackFrame pop4push1(String type)

remote the top two operands and replace them with an different operand

pushback to summary
public StackFrame push(String type)

push an operand of the given type onto the stack

If the entry is wide then a corresponding TOP type will be created

pushback to summary
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

replaceback to summary
public StackFrame replace(String type)

replace the operand at the top of the stack with the given operand

storeback to summary
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

swapback to summary
public StackFrame swap()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
typeNoLocalChangeback to summary
private StackFrameType typeNoLocalChange(StackState ns)

determins the type of stack frame this is when no local variables have changed