public interface JvmHeapAbstractState<StateT extends LatticeAbstractState<StateT>> extends LatticeAbstractState<JvmHeapAbstractState<StateT>>
JvmHeapAbstractState
provides the interfaces for heap operations over objects and
arrays.Modifier and Type | Method and 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 an
array element at the specified index or the defaultValue , if
the element is unset. |
<T> StateT |
getFieldOrDefault(T object,
java.lang.String fqn,
StateT defaultValue)
Returns a field
fqn from a reference object . |
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.
|
default StateT |
newObject(Clazz clazz,
JvmCfaNode creationCite)
Creates a new object of a given
Clazz 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 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 the
array element value at the specified index . |
<T> void |
setField(T object,
java.lang.String fqn,
StateT value)
Sets a
value to a field fqn of a referenced object . |
isLess, isLessOrEqual, join
equals, getPrecision, getStateByName, hashCode
JvmHeapAbstractState<StateT> copy()
AbstractState
copy
in interface AbstractState
StateT newArray(java.lang.String type, java.util.List<StateT> dimensions, JvmCfaNode creationCite)
StateT newObject(java.lang.String className, JvmCfaNode creationCite)
default StateT newObject(Clazz clazz, JvmCfaNode creationCite)
Clazz
at a specific program point and returns a
reference to it.<T> StateT getFieldOrDefault(T object, java.lang.String fqn, StateT defaultValue)
fqn
from a reference object
. If there is no abstract state
representing the field, returns the defaultValue
<T> void setField(T object, java.lang.String fqn, StateT value)
value
to a field fqn
of a referenced object
.<T> StateT getArrayElementOrDefault(T array, StateT index, StateT defaultValue)
array
element at the specified index
or the defaultValue
, if
the element is unset.<T> void setArrayElement(T array, StateT index, StateT value)
array
element value
at the specified index
.default void reduce(java.util.Set<java.lang.Object> references)
This can be overridden to model discarding heap portions at call sites.
references
- information on the references to keep or discard, based on the
implementation. Unused in the default implementationdefault void expand(JvmHeapAbstractState<StateT> otherState)
This can be overridden to model recovering information discarded at call sites when analyzing a return site.
otherState
- a heap state from which expanding the heap (e.g. the state calling a method
to recover information discarded from it)