|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.util.MutabilityControl
com.android.dx.cf.code.ExecutionStack
public final class ExecutionStack
Representation of a Java method execution stack.
Note: For the most part, the documentation for this class
ignores the distinction between Type and TypeBearer.
| Constructor Summary | |
|---|---|
ExecutionStack(int maxStack)
Constructs an instance. |
|
| Method Summary | |
|---|---|
void |
annotate(com.android.dex.util.ExceptionWithContext ex)
Annotates (adds context to) the given exception with information about this instance. |
void |
change(int n,
TypeBearer type)
Changes an element already on a stack. |
void |
clear()
Clears the stack. |
ExecutionStack |
copy()
Makes and returns a mutable copy of this instance. |
int |
getMaxStack()
Gets the maximum stack size for this instance. |
void |
makeInitialized(Type type)
Replaces all the occurrences of the given uninitialized type in this stack with its initialized equivalent. |
ExecutionStack |
merge(ExecutionStack other)
Merges this stack with another stack. |
TypeBearer |
peek(int n)
Peeks at the nth element down from the top of the stack. |
boolean |
peekLocal(int n)
Peeks at the nth element down from the top of the
stack, returning whether or not it has local info. |
Type |
peekType(int n)
Peeks at the nth element down from the top of the
stack, returning the type per se, as opposed to the
type-bearer. |
TypeBearer |
pop()
Pops the top element off of the stack. |
void |
push(TypeBearer type)
Pushes a value of the given type onto the stack. |
void |
setLocal()
Flags the next value pushed onto the stack as having local info. |
int |
size()
Gets the current stack size. |
| Methods inherited from class com.android.dx.util.MutabilityControl |
|---|
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExecutionStack(int maxStack)
maxStack - >= 0; the maximum size of the stack for this
instance| Method Detail |
|---|
public ExecutionStack copy()
non-null; the copypublic void annotate(com.android.dex.util.ExceptionWithContext ex)
ex - non-null; the exception to annotatepublic void makeInitialized(Type type)
type - non-null; type to replacepublic int getMaxStack()
>= 0; the max stack sizepublic int size()
>= 0, < getMaxStack(); the current stack sizepublic void clear()
public void push(TypeBearer type)
type - non-null; type of the value
SimException - thrown if there is insufficient room on the
stack for the valuepublic void setLocal()
public TypeBearer peek(int n)
nth element down from the top of the stack.
n == 0 means to peek at the top of the stack. Note that
this will return null if the indicated element is the
deeper half of a category-2 value.
n - >= 0; which element to peek at
null-ok; the type of value stored at that element
SimException - thrown if n >= size()public boolean peekLocal(int n)
nth element down from the top of the
stack, returning whether or not it has local info.
n - >= 0; which element to peek at
true if the value has local info, false otherwise
SimException - thrown if n >= size()public Type peekType(int n)
nth element down from the top of the
stack, returning the type per se, as opposed to the
type-bearer. This method is just a convenient shorthand
for peek(n).getType().
peek(int)public TypeBearer pop()
non-null; the type formerly on the top of the stack
SimException - thrown if the stack is empty
public void change(int n,
TypeBearer type)
n - >= 0; which element to change, where 0 is
the top element of the stacktype - non-null; type of the new value
SimException - thrown if n >= size() or
the action is otherwise prohibitedpublic ExecutionStack merge(ExecutionStack other)
Merger.mergeStack()
other - non-null; a stack to merge with
non-null; the result of the merge
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||