Class JvmValueAbstractState
- java.lang.Object
-
- proguard.analysis.cpa.jvm.state.JvmAbstractState<ValueAbstractState>
-
- proguard.analysis.cpa.jvm.domain.value.JvmValueAbstractState
-
- All Implemented Interfaces:
LatticeAbstractState<JvmAbstractState<ValueAbstractState>>
,AbstractState
,ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>
public class JvmValueAbstractState extends JvmAbstractState<ValueAbstractState>
-
-
Field Summary
-
Fields inherited from class proguard.analysis.cpa.jvm.state.JvmAbstractState
DEFAULT_FIELD, frame, heap, programLocation, staticFields, topLocation
-
-
Constructor Summary
Constructors Constructor Description JvmValueAbstractState(ValueFactory valueFactory, ExecutingInvocationUnit executingInvocationUnit, JvmCfaNode programLocation, JvmFrameAbstractState<ValueAbstractState> frame, JvmHeapAbstractState<ValueAbstractState> heap, MapAbstractState<java.lang.String,ValueAbstractState> staticFields)
Create a JVM value abstract state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JvmValueAbstractState
copy()
Creates a copy of itself.boolean
equals(java.lang.Object obj)
ValueFactory
getValueFactory()
Returns theValueFactory
.ValueAbstractState
getVariableOrDefault(int index, ValueAbstractState defaultState)
Returns an abstract state at theindex
th position of the variable array, the corresponding heap value for anIdentifiedReferenceValue
ordefaultState
if there is no entry.JvmValueAbstractState
join(JvmAbstractState<ValueAbstractState> abstractState)
Computes a join over itself and theabstractState
.ValueAbstractState
newObject(java.lang.String className)
Returns anValueAbstractState
for a new object of the givenclassName
.ValueAbstractState
newObject(Clazz clazz)
Returns anValueAbstractState
state for a new object of the givenClazz
.<T> void
setField(T object, ValueAbstractState value)
Sets the default field of theobject
tovalue
.ValueAbstractState
setVariable(int index, ValueAbstractState state, ValueAbstractState defaultState)
Sets theindex
th position of the variable array tostate
and returnsstate
.java.lang.String
toString()
-
Methods inherited from class proguard.analysis.cpa.jvm.state.JvmAbstractState
clearOperandStack, getArrayElementOrDefault, getFieldOrDefault, getFieldOrDefault, getFrame, getHeap, getProgramLocation, getStaticFields, getStaticOrDefault, hashCode, isLessOrEqual, newArray, peek, peek, peekOrDefault, peekOrDefault, pop, popOrDefault, push, pushAll, setArrayElement, setField, setProgramLocation, setStatic
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
getPrecision, getStateByName
-
Methods inherited from interface proguard.analysis.cpa.defaults.LatticeAbstractState
isLess
-
-
-
-
Constructor Detail
-
JvmValueAbstractState
public JvmValueAbstractState(ValueFactory valueFactory, ExecutingInvocationUnit executingInvocationUnit, JvmCfaNode programLocation, JvmFrameAbstractState<ValueAbstractState> frame, JvmHeapAbstractState<ValueAbstractState> heap, MapAbstractState<java.lang.String,ValueAbstractState> staticFields)
Create a JVM value abstract state.- Parameters:
valueFactory
- a ValueFactory which is used to create abstract values.executingInvocationUnit
- an ExecutingInvocationUnit which is used to execute methods reflectively.programLocation
- a CFA nodeframe
- a frame abstract stateheap
- a heap abstract statestaticFields
- a static field table
-
-
Method Detail
-
getValueFactory
public ValueFactory getValueFactory()
Returns theValueFactory
.
-
getVariableOrDefault
public ValueAbstractState getVariableOrDefault(int index, ValueAbstractState defaultState)
Returns an abstract state at theindex
th position of the variable array, the corresponding heap value for anIdentifiedReferenceValue
ordefaultState
if there is no entry.- Overrides:
getVariableOrDefault
in classJvmAbstractState<ValueAbstractState>
-
setVariable
public ValueAbstractState setVariable(int index, ValueAbstractState state, ValueAbstractState defaultState)
Sets theindex
th position of the variable array tostate
and returnsstate
. If the array has to be extended, the added cells are padded withdefaultState
.If the value is an
IdentifiedReferenceValue
, the corresponding heap value is also updated.- Overrides:
setVariable
in classJvmAbstractState<ValueAbstractState>
-
newObject
public ValueAbstractState newObject(java.lang.String className)
Returns anValueAbstractState
for a new object of the givenclassName
.- Overrides:
newObject
in classJvmAbstractState<ValueAbstractState>
-
newObject
public ValueAbstractState newObject(Clazz clazz)
Returns anValueAbstractState
state for a new object of the givenClazz
.- Overrides:
newObject
in classJvmAbstractState<ValueAbstractState>
-
setField
public <T> void setField(T object, ValueAbstractState value)
Description copied from class:JvmAbstractState
Sets the default field of theobject
tovalue
.- Overrides:
setField
in classJvmAbstractState<ValueAbstractState>
-
join
public JvmValueAbstractState join(JvmAbstractState<ValueAbstractState> abstractState)
Description copied from interface:LatticeAbstractState
Computes a join over itself and theabstractState
.- Specified by:
join
in interfaceLatticeAbstractState<JvmAbstractState<ValueAbstractState>>
- Overrides:
join
in classJvmAbstractState<ValueAbstractState>
-
copy
public JvmValueAbstractState copy()
Description copied from interface:AbstractState
Creates a copy of itself.- Specified by:
copy
in interfaceAbstractState
- Overrides:
copy
in classJvmAbstractState<ValueAbstractState>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceAbstractState
- Overrides:
equals
in classJvmAbstractState<ValueAbstractState>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-