public class JvmFrameAbstractState<StateT extends LatticeAbstractState<StateT>> extends java.lang.Object implements LatticeAbstractState<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
index th position of the variable array or defaultState if there is no entry. |
int |
hashCode() |
boolean |
isLessOrEqual(JvmFrameAbstractState<StateT> abstractState)
Compares itself to the
abstractState . |
JvmFrameAbstractState<StateT> |
join(JvmFrameAbstractState<StateT> abstractState)
Computes a join over itself and the
abstractState . |
StateT |
peek(int index)
Returns the
index th element from the top of the operand stack. |
StateT |
peekOrDefault(int index,
StateT defaultState)
Returns the
index th 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
index th position of the variable array to state and returns state . |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isLess
getPrecision, getStateByName
protected final ListAbstractState<StateT extends LatticeAbstractState<StateT>> localVariables
protected final StackAbstractState<StateT extends LatticeAbstractState<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)
LatticeAbstractState
abstractState
.join
in interface LatticeAbstractState<JvmFrameAbstractState<StateT extends LatticeAbstractState<StateT>>>
public boolean isLessOrEqual(JvmFrameAbstractState<StateT> abstractState)
LatticeAbstractState
abstractState
.isLessOrEqual
in interface LatticeAbstractState<JvmFrameAbstractState<StateT extends LatticeAbstractState<StateT>>>
public JvmFrameAbstractState<StateT> copy()
AbstractState
copy
in interface AbstractState
public boolean equals(java.lang.Object obj)
equals
in interface AbstractState
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface AbstractState
hashCode
in class java.lang.Object
public StateT peekOrDefault(int index, StateT defaultState)
index
th element from the top of the operand stack or returns defaultState
if the stack does not have enough elements.public StateT peek(int index)
index
th 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)
index
th position of the variable array or defaultState
if there is no entry.public StateT setVariable(int index, StateT state, StateT defaultState)
index
th 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()