Package proguard.analysis.cpa.jvm.state
Class JvmFrameAbstractState<StateT extends AbstractState<StateT>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.state.JvmFrameAbstractState<StateT>
-
- All Implemented Interfaces:
AbstractState<JvmFrameAbstractState<StateT>>
public class JvmFrameAbstractState<StateT extends AbstractState<StateT>> extends java.lang.Object implements AbstractState<JvmFrameAbstractState<StateT>>
TheJvmFrameAbstractStatecombines the operand stack as theStackAbstractStateand the local variable array as theListAbstractState. 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected ListAbstractState<StateT>localVariablesprotected StackAbstractState<StateT>operandStack
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JvmFrameAbstractState<StateT>copy()Creates a copy of itself.booleanequals(java.lang.Object obj)ListAbstractState<StateT>getLocalVariables()Returns the variable array.StackAbstractState<StateT>getOperandStack()Returns the operand stack.StateTgetVariableOrDefault(int index, StateT defaultState)Returns an abstract state at theindexth position of the variable array ordefaultStateif there is no entry.inthashCode()booleanisLessOrEqual(JvmFrameAbstractState<StateT> abstractState)Compares itself to theabstractState(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 stateabstractState(i.e., finds the least upper bound on the semilattice).StateTpeek(int index)Returns theindexth element from the top of the operand stack.StateTpeekOrDefault(int index, StateT defaultState)Returns theindexth element from the top of the operand stack or returnsdefaultStateif the stack does not have enough elements.StateTpop()Removes the top element of the operand stack end returns it.StateTpopOrDefault(StateT defaultState)Removes the top element of the operand stack end returns it.StateTpush(StateT state)Insertsstateto the top of the operand stack and returns it.java.util.List<StateT>pushAll(java.util.List<StateT> states)Sequentially inserts elements ofstatesto the top of the operand stack and returnsstates.StateTsetVariable(int index, StateT state, StateT defaultState)Sets theindexth position of the variable array tostateand returnsstate.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
getPrecision, isLess
-
-
-
-
Field Detail
-
localVariables
protected final ListAbstractState<StateT extends AbstractState<StateT>> localVariables
-
operandStack
protected final StackAbstractState<StateT extends AbstractState<StateT>> operandStack
-
-
Constructor Detail
-
JvmFrameAbstractState
public JvmFrameAbstractState()
Create an empty frame.
-
JvmFrameAbstractState
public JvmFrameAbstractState(ListAbstractState<StateT> localVariables, StackAbstractState<StateT> operandStack)
Create a frame from a local variable array and an operand stack.- Parameters:
localVariables- a local variable arrayoperandStack- an operand stack
-
-
Method Detail
-
join
public JvmFrameAbstractState<StateT> join(JvmFrameAbstractState<StateT> abstractState)
Description copied from interface:AbstractStateComputes a join over itself and another abstract stateabstractState(i.e., finds the least upper bound on the semilattice).- Specified by:
joinin interfaceAbstractState<StateT extends AbstractState<StateT>>
-
isLessOrEqual
public boolean isLessOrEqual(JvmFrameAbstractState<StateT> abstractState)
Description copied from interface:AbstractStateCompares itself to theabstractState(i.e., compare the states on the partial order provided by the domain of the analysis).- Specified by:
isLessOrEqualin interfaceAbstractState<StateT extends AbstractState<StateT>>
-
copy
public JvmFrameAbstractState<StateT> copy()
Description copied from interface:AbstractStateCreates a copy of itself.- Specified by:
copyin interfaceAbstractState<StateT extends AbstractState<StateT>>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceAbstractState<StateT extends AbstractState<StateT>>- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceAbstractState<StateT extends AbstractState<StateT>>- Overrides:
hashCodein classjava.lang.Object
-
peekOrDefault
public StateT peekOrDefault(int index, StateT defaultState)
Returns theindexth element from the top of the operand stack or returnsdefaultStateif the stack does not have enough elements.
-
peek
public StateT peek(int index)
Returns theindexth element from the top of the operand stack.
-
pop
public StateT pop()
Removes the top element of the operand stack end returns it.
-
popOrDefault
public StateT popOrDefault(StateT defaultState)
Removes the top element of the operand stack end returns it. ReturnsdefaultStateif the stack is empty.
-
push
public StateT push(StateT state)
Insertsstateto the top of the operand stack and returns it.
-
pushAll
public java.util.List<StateT> pushAll(java.util.List<StateT> states)
Sequentially inserts elements ofstatesto the top of the operand stack and returnsstates.
-
getVariableOrDefault
public StateT getVariableOrDefault(int index, StateT defaultState)
Returns an abstract state at theindexth position of the variable array ordefaultStateif there is no entry.
-
setVariable
public StateT setVariable(int index, StateT state, StateT defaultState)
Sets theindexth position of the variable array tostateand returnsstate. If the array has to be extended, the added cells are padded withdefaultState.
-
getLocalVariables
public ListAbstractState<StateT> getLocalVariables()
Returns the variable array.
-
getOperandStack
public StackAbstractState<StateT> getOperandStack()
Returns the operand stack.
-
-