public class JvmTreeHeapPrincipalAbstractState extends JvmTreeHeapAbstractState<SetAbstractState<Reference>>
o
is created on-the-fly, its field o.f
will be
aliased with o.f.f
.defaultValue, heapMapAbstractStateFactory, heapNodeMapAbstractStateFactory, referenceToObject
Constructor and Description |
---|
JvmTreeHeapPrincipalAbstractState(MapAbstractStateFactory<Reference,HeapNode<SetAbstractState<Reference>>> heapMapAbstractStateFactory,
MapAbstractStateFactory<java.lang.String,SetAbstractState<Reference>> heapNodeMapAbstractStateFactory)
Create an empty principal heap model.
|
Modifier and Type | Method and Description |
---|---|
JvmTreeHeapPrincipalAbstractState |
copy()
Creates a copy of itself.
|
<T> SetAbstractState<Reference> |
getArrayElementOrDefault(T array,
SetAbstractState<Reference> index,
SetAbstractState<Reference> defaultValue)
Returns an
array element at the specified index or the defaultValue , if
the element is unset. |
<T> SetAbstractState<Reference> |
getFieldOrDefault(T object,
java.lang.String fqn,
SetAbstractState<Reference> defaultValue)
Returns a field
fqn from a reference object . |
java.util.Set<java.lang.Object> |
getStaticCreationReferences()
Get all the references to nodes that have been created in a
JvmStaticFieldLocation . |
JvmTreeHeapPrincipalAbstractState |
join(JvmHeapAbstractState<SetAbstractState<Reference>> abstractState)
Computes a join over itself and the
abstractState . |
SetAbstractState<Reference> |
newArray(java.lang.String type,
java.util.List<SetAbstractState<Reference>> 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.
|
SetAbstractState<Reference> |
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.
|
void |
reduce(java.util.Set<java.lang.Object> roots)
Slices the principal heap tree starting from the specified roots.
|
<T> void |
setArrayElement(T array,
SetAbstractState<Reference> index,
SetAbstractState<Reference> value)
Sets the
array element value at the specified index . |
<T> void |
setField(T object,
java.lang.String fqn,
SetAbstractState<Reference> value)
Sets a
value to a field fqn of a referenced object . |
assignField, equals, expand, getArrayElementOrDefault, getField, getHeapNode, hashCode, isLessOrEqual, mergeField, setArrayElement, setField
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
newObject
isLess
getPrecision, getStateByName
public JvmTreeHeapPrincipalAbstractState(MapAbstractStateFactory<Reference,HeapNode<SetAbstractState<Reference>>> heapMapAbstractStateFactory, MapAbstractStateFactory<java.lang.String,SetAbstractState<Reference>> heapNodeMapAbstractStateFactory)
heapMapAbstractStateFactory
- a map abstract state factory used for constructing the
mapping from references to objectsheapNodeMapAbstractStateFactory
- a map abstract state factory used for constructing the
mapping from fields to valuespublic <T> SetAbstractState<Reference> getFieldOrDefault(T object, java.lang.String fqn, SetAbstractState<Reference> defaultValue)
JvmHeapAbstractState
fqn
from a reference object
. If there is no abstract state
representing the field, returns the defaultValue
public <T> void setField(T object, java.lang.String fqn, SetAbstractState<Reference> value)
JvmHeapAbstractState
value
to a field fqn
of a referenced object
.public <T> SetAbstractState<Reference> getArrayElementOrDefault(T array, SetAbstractState<Reference> index, SetAbstractState<Reference> defaultValue)
JvmHeapAbstractState
array
element at the specified index
or the defaultValue
, if
the element is unset.public <T> void setArrayElement(T array, SetAbstractState<Reference> index, SetAbstractState<Reference> value)
JvmHeapAbstractState
array
element value
at the specified index
.public SetAbstractState<Reference> newObject(java.lang.String className, JvmCfaNode creationCite)
JvmHeapAbstractState
public SetAbstractState<Reference> newArray(java.lang.String type, java.util.List<SetAbstractState<Reference>> dimensions, JvmCfaNode creationCite)
JvmHeapAbstractState
public java.util.Set<java.lang.Object> getStaticCreationReferences()
JvmStaticFieldLocation
.public void reduce(java.util.Set<java.lang.Object> roots)
roots
- information on the references to keep or discard, based on the
implementation. Unused in the default implementationpublic JvmTreeHeapPrincipalAbstractState join(JvmHeapAbstractState<SetAbstractState<Reference>> abstractState)
LatticeAbstractState
abstractState
.public JvmTreeHeapPrincipalAbstractState copy()
AbstractState