public class JvmFrameAbstractState<StateT extends AbstractState<StateT>> extends java.lang.Object implements AbstractState<JvmFrameAbstractState<StateT>>
JvmFrameAbstractState combines the operand stack as the StackAbstractState
and the local variable array as the ListAbstractState. This abstract state does not
restrict the way one models values, i.e., one abstract state may correspond to a byte sequence of
arbitrary length.| Modifier and Type | Field and Description |
|---|---|
protected ListAbstractState<StateT> |
localVariables |
protected StackAbstractState<StateT> |
operandStack |
| Constructor and Description |
|---|
JvmFrameAbstractState()
Create an empty frame.
|
JvmFrameAbstractState(ListAbstractState<StateT> localVariables,
StackAbstractState<StateT> operandStack)
Create a frame from a local variable array and an operand stack.
|
| Modifier and Type | Method and Description |
|---|---|
JvmFrameAbstractState<StateT> |
copy()
Creates a copy of itself.
|
boolean |
equals(java.lang.Object obj) |
ListAbstractState<StateT> |
getLocalVariables()
Returns the variable array.
|
StackAbstractState<StateT> |
getOperandStack()
Returns the operand stack.
|
StateT |
getVariableOrDefault(int index,
StateT defaultState)
Returns an abstract state at the
indexth position of the variable array or defaultState if there is no entry. |
int |
hashCode() |
boolean |
isLessOrEqual(JvmFrameAbstractState<StateT> abstractState)
Compares itself to the
abstractState (i.e., compare the states on the partial order
provided by the domain of the analysis). |
JvmFrameAbstractState<StateT> |
join(JvmFrameAbstractState<StateT> abstractState)
Computes a join over itself and another abstract state
abstractState (i.e., finds the
least upper bound on the semilattice). |
StateT |
peek(int index)
Returns the
indexth element from the top of the operand stack. |
StateT |
peekOrDefault(int index,
StateT defaultState)
Returns the
indexth element from the top of the operand stack or returns defaultState if the stack does not have enough elements. |
StateT |
pop()
Removes the top element of the operand stack end returns it.
|
StateT |
popOrDefault(StateT defaultState)
Removes the top element of the operand stack end returns it.
|
StateT |
push(StateT state)
Inserts
state to the top of the operand stack and returns it. |
java.util.List<StateT> |
pushAll(java.util.List<StateT> states)
Sequentially inserts elements of
states to the top of the operand stack and returns
states. |
StateT |
setVariable(int index,
StateT state,
StateT defaultState)
Sets the
indexth position of the variable array to state and returns state. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetPrecision, isLessprotected final ListAbstractState<StateT extends AbstractState<StateT>> localVariables
protected final StackAbstractState<StateT extends AbstractState<StateT>> operandStack
public JvmFrameAbstractState()
public JvmFrameAbstractState(ListAbstractState<StateT> localVariables, StackAbstractState<StateT> operandStack)
localVariables - a local variable arrayoperandStack - an operand stackpublic JvmFrameAbstractState<StateT> join(JvmFrameAbstractState<StateT> abstractState)
AbstractStateabstractState (i.e., finds the
least upper bound on the semilattice).join in interface AbstractState<JvmFrameAbstractState<StateT extends AbstractState<StateT>>>public boolean isLessOrEqual(JvmFrameAbstractState<StateT> abstractState)
AbstractStateabstractState (i.e., compare the states on the partial order
provided by the domain of the analysis).isLessOrEqual in interface AbstractState<JvmFrameAbstractState<StateT extends AbstractState<StateT>>>public JvmFrameAbstractState<StateT> copy()
AbstractStatecopy in interface AbstractState<JvmFrameAbstractState<StateT extends AbstractState<StateT>>>public boolean equals(java.lang.Object obj)
equals in interface AbstractState<JvmFrameAbstractState<StateT extends AbstractState<StateT>>>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface AbstractState<JvmFrameAbstractState<StateT extends AbstractState<StateT>>>hashCode in class java.lang.Objectpublic StateT peekOrDefault(int index, StateT defaultState)
indexth element from the top of the operand stack or returns defaultState if the stack does not have enough elements.public StateT peek(int index)
indexth element from the top of the operand stack.public StateT pop()
public StateT popOrDefault(StateT defaultState)
defaultState if
the stack is empty.public java.util.List<StateT> pushAll(java.util.List<StateT> states)
states to the top of the operand stack and returns
states.public StateT getVariableOrDefault(int index, StateT defaultState)
indexth position of the variable array or defaultState if there is no entry.public StateT setVariable(int index, StateT state, StateT defaultState)
indexth position of the variable array to state and returns state. If the array has to be extended, the added cells are padded with defaultState.public ListAbstractState<StateT> getLocalVariables()
public StackAbstractState<StateT> getOperandStack()