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 Object
implements AbstractState<JvmFrameAbstractState<StateT>>
The
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ListAbstractState<StateT>protected final StackAbstractState<StateT> -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty frame.JvmFrameAbstractState(ListAbstractState<StateT> localVariables, StackAbstractState<StateT> operandStack) Create a frame from a local variable array and an operand stack. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of itself.booleanReturns the variable array.Returns the operand stack.getVariableOrDefault(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).join(JvmFrameAbstractState<StateT> abstractState) Computes a join over itself and another abstract stateabstractState(i.e., finds the least upper bound on the semilattice).peek(int index) Returns theindexth element from the top of the operand stack.peekOrDefault(int index, StateT defaultState) Returns theindexth element from the top of the operand stack or returnsdefaultStateif the stack does not have enough elements.pop()Removes the top element of the operand stack end returns it.popOrDefault(StateT defaultState) Removes the top element of the operand stack end returns it.Insertsstateto the top of the operand stack and returns it.Sequentially inserts elements ofstatesto the top of the operand stack and returnsstates.setVariable(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, waitMethods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
getPrecision, isLess
-
Field Details
-
localVariables
-
operandStack
-
-
Constructor Details
-
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 Details
-
join
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
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
Description copied from interface:AbstractStateCreates a copy of itself.- Specified by:
copyin interfaceAbstractState<StateT extends AbstractState<StateT>>
-
equals
- Specified by:
equalsin interfaceAbstractState<StateT extends AbstractState<StateT>>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceAbstractState<StateT extends AbstractState<StateT>>- Overrides:
hashCodein classObject
-
peekOrDefault
Returns theindexth element from the top of the operand stack or returnsdefaultStateif the stack does not have enough elements. -
peek
Returns theindexth element from the top of the operand stack. -
pop
Removes the top element of the operand stack end returns it. -
popOrDefault
Removes the top element of the operand stack end returns it. ReturnsdefaultStateif the stack is empty. -
push
Insertsstateto the top of the operand stack and returns it. -
pushAll
Sequentially inserts elements ofstatesto the top of the operand stack and returnsstates. -
getVariableOrDefault
Returns an abstract state at theindexth position of the variable array ordefaultStateif there is no entry. -
setVariable
Sets theindexth position of the variable array tostateand returnsstate. If the array has to be extended, the added cells are padded withdefaultState. -
getLocalVariables
Returns the variable array. -
getOperandStack
Returns the operand stack.
-