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

public Class StackState

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, org.jboss.classfilewriter.InvalidBytecodeException, org.jboss.classfilewriter.constpool.ConstPool, org.jboss.classfilewriter.util.DescriptorUtils

In immutable stack state, which may be shared between frames
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final ConstPool
private final List<StackEntry>
contents

The contents of the stack

This list may be shared between frames, so it must never be modified

The very first element represents the bottom of the stack, with the last element representing the top.

Constructor Summary

AccessConstructor and Description
public
StackState(ConstPool constPool)

public
StackState(String exceptionType, ConstPool constPool)

private
StackState(final List<StackEntry> contents, ConstPool constPool)

Method Summary

Modifier and TypeMethod and Description
public StackState
public StackState
constructorCall(int initializedValueStackPosition, StackEntry entry)

public StackState
dup()

public StackState
dup2()

public StackState
public StackState
public StackState
public StackState
public List<StackEntry>
public boolean
isOnTop(String descriptor)

checks that the appropriate object type is on top of the stack

private StackState
newStack(StackEntry... pushValues)

public StackState
pop(int no)

pop a non-wide type from the top of the stack

public StackState
push(String type)

push a type on to the top of the stack

public StackState
push(StackEntry entry)

push a type on to the top of the stack

public int
size()

public StackState
swap()

public StackEntry
top()

public StackEntry
public StackEntry
public StackEntry
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public StackState
updateMerged(int pos, StackEntry frame)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

constPoolback to summary
private final ConstPool constPool
contentsback to summary
private final List<StackEntry> contents

The contents of the stack

This list may be shared between frames, so it must never be modified

The very first element represents the bottom of the stack, with the last element representing the top. Wide elements are stored as Wide, Top, with the StackEntryType#TOP on the top of the stack

Constructor Detail

StackStateback to summary
public StackState(ConstPool constPool)
StackStateback to summary
public StackState(String exceptionType, ConstPool constPool)
StackStateback to summary
private StackState(final List<StackEntry> contents, ConstPool constPool)

Method Detail

aconstNullback to summary
public StackState aconstNull()
constructorCallback to summary
public StackState constructorCall(int initializedValueStackPosition, StackEntry entry)
dupback to summary
public StackState dup()
dup2back to summary
public StackState dup2()
dup2X1back to summary
public StackState dup2X1()
dup2X2back to summary
public StackState dup2X2()
dupX1back to summary
public StackState dupX1()
dupX2back to summary
public StackState dupX2()
getContentsback to summary
public List<StackEntry> getContents()
isOnTopback to summary
public boolean isOnTop(String descriptor)

checks that the appropriate object type is on top of the stack

newStackback to summary
private StackState newStack(StackEntry... pushValues)
popback to summary
public StackState pop(int no)

pop a non-wide type from the top of the stack

pushback to summary
public StackState push(String type)

push a type on to the top of the stack

pushback to summary
public StackState push(StackEntry entry)

push a type on to the top of the stack

sizeback to summary
public int size()
swapback to summary
public StackState swap()
topback to summary
public StackEntry top()
top_1back to summary
public StackEntry top_1()
top_2back to summary
public StackEntry top_2()
top_3back to summary
public StackEntry top_3()
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
updateMergedback to summary
public StackState updateMerged(int pos, StackEntry frame)