Interface JvmHeapAbstractState<StateT extends LatticeAbstractState<StateT>>
-
- All Superinterfaces:
AbstractState
,LatticeAbstractState<JvmHeapAbstractState<StateT>>
- All Known Implementing Classes:
JvmForgetfulHeapAbstractState
,JvmShallowHeapAbstractState
public interface JvmHeapAbstractState<StateT extends LatticeAbstractState<StateT>> extends LatticeAbstractState<JvmHeapAbstractState<StateT>>
TheJvmHeapAbstractState
provides the interfaces for heap operations over objects and arrays.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description JvmHeapAbstractState<StateT>
copy()
Creates a copy of itself.default void
expand(JvmHeapAbstractState<StateT> otherState)
Expands the heap with references present in another state.<T> StateT
getArrayElementOrDefault(T array, StateT index, StateT defaultValue)
Returns anarray
element at the specifiedindex
or thedefaultValue
, if the element is unset.<T> StateT
getFieldOrDefault(T object, java.lang.String fqn, StateT defaultValue)
Returns a fieldfqn
from a referenceobject
.StateT
newArray(java.lang.String type, java.util.List<StateT> dimensions, JvmCfaNode creationCite)
Creates a new array of a given class with the given dimension sizes at a specific program point and returns a reference to it.StateT
newObject(java.lang.String className, JvmCfaNode creationCite)
Creates a new object of a given class at a specific program point and returns a reference to it.default StateT
newObject(Clazz clazz, JvmCfaNode creationCite)
Creates a new object of a givenClazz
at a specific program point and returns a reference to it.default void
reduce(java.util.Set<java.lang.Object> references)
Discards unused parts of the heap.<T> void
setArrayElement(T array, StateT index, StateT value)
Sets thearray
elementvalue
at the specifiedindex
.<T> void
setField(T object, java.lang.String fqn, StateT value)
Sets avalue
to a fieldfqn
of a referencedobject
.-
Methods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
equals, getPrecision, getStateByName, hashCode
-
Methods inherited from interface proguard.analysis.cpa.defaults.LatticeAbstractState
isLess, isLessOrEqual, join
-
-
-
-
Method Detail
-
copy
JvmHeapAbstractState<StateT> copy()
Description copied from interface:AbstractState
Creates a copy of itself.- Specified by:
copy
in interfaceAbstractState
-
newArray
StateT newArray(java.lang.String type, java.util.List<StateT> dimensions, JvmCfaNode creationCite)
Creates a new array of a given class with the given dimension sizes at a specific program point and returns a reference to it.
-
newObject
StateT newObject(java.lang.String className, JvmCfaNode creationCite)
Creates a new object of a given class at a specific program point and returns a reference to it.
-
newObject
default StateT newObject(Clazz clazz, JvmCfaNode creationCite)
Creates a new object of a givenClazz
at a specific program point and returns a reference to it.
-
getFieldOrDefault
<T> StateT getFieldOrDefault(T object, java.lang.String fqn, StateT defaultValue)
Returns a fieldfqn
from a referenceobject
. If there is no abstract state representing the field, returns thedefaultValue
-
setField
<T> void setField(T object, java.lang.String fqn, StateT value)
Sets avalue
to a fieldfqn
of a referencedobject
.
-
getArrayElementOrDefault
<T> StateT getArrayElementOrDefault(T array, StateT index, StateT defaultValue)
Returns anarray
element at the specifiedindex
or thedefaultValue
, if the element is unset.
-
setArrayElement
<T> void setArrayElement(T array, StateT index, StateT value)
Sets thearray
elementvalue
at the specifiedindex
.
-
reduce
default void reduce(java.util.Set<java.lang.Object> references)
Discards unused parts of the heap. Does nothing in the default implementation.This can be overridden to model discarding heap portions at call sites.
- Parameters:
references
- information on the references to keep or discard, based on the implementation. Unused in the default implementation
-
expand
default void expand(JvmHeapAbstractState<StateT> otherState)
Expands the heap with references present in another state. Does nothing in the default implementation.This can be overridden to model recovering information discarded at call sites when analyzing a return site.
- Parameters:
otherState
- a heap state from which expanding the heap (e.g. the state calling a method to recover information discarded from it)
-
-