public abstract class JvmTreeHeapAbstractState<StateT extends LatticeAbstractState<StateT>> extends java.lang.Object implements JvmHeapAbstractState<StateT>
HeapNode
s) which may refer other heap nodes in their fields.Modifier and Type | Field and Description |
---|---|
protected StateT |
defaultValue |
protected MapAbstractStateFactory<Reference,HeapNode<StateT>> |
heapMapAbstractStateFactory |
protected MapAbstractStateFactory<java.lang.String,StateT> |
heapNodeMapAbstractStateFactory |
protected MapAbstractState<Reference,HeapNode<StateT>> |
referenceToObject |
Modifier | Constructor and Description |
---|---|
protected |
JvmTreeHeapAbstractState(MapAbstractState<Reference,HeapNode<StateT>> referenceToObject,
MapAbstractStateFactory<Reference,HeapNode<StateT>> heapMapAbstractStateFactory,
MapAbstractStateFactory<java.lang.String,StateT> heapNodeMapAbstractStateFactory,
StateT defaultValue)
Create a tree heap abstract state from a given memory layout.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assignField(SetAbstractState<Reference> object,
java.lang.String descriptor,
StateT value)
Assigns the field value to the given one if the reference is unambiguous, joins otherwise.
|
boolean |
equals(java.lang.Object obj) |
void |
expand(JvmHeapAbstractState<StateT> otherState)
Expands the state with all the entries from another heap state with reference not already known
by the state.
|
protected StateT |
getArrayElementOrDefault(SetAbstractState<Reference> array,
StateT index,
StateT defaultValue)
Returns a join over all arrays aliased by the input
SetAbstractState . |
protected StateT |
getField(SetAbstractState<Reference> object,
java.lang.String descriptor,
StateT defaultValue)
Returns a join over all fields aliased by the input
SetAbstractState . |
HeapNode<StateT> |
getHeapNode(Reference reference)
Returns the heap node for the given
reference . |
int |
hashCode() |
boolean |
isLessOrEqual(JvmHeapAbstractState<StateT> abstractState)
Compares itself to the
abstractState . |
protected void |
mergeField(SetAbstractState<Reference> object,
java.lang.String descriptor,
StateT value)
Merges the field value to the given one.
|
protected void |
setArrayElement(SetAbstractState<Reference> array,
StateT index,
StateT value)
Joins the array elements with the given one for all aliases.
|
protected void |
setField(SetAbstractState<Reference> object,
java.lang.String descriptor,
StateT value)
Replaces the field value with the given one.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
copy, getArrayElementOrDefault, getFieldOrDefault, newArray, newObject, newObject, reduce, setArrayElement, setField
isLess, join
getPrecision, getStateByName
protected final MapAbstractState<Reference,HeapNode<StateT extends LatticeAbstractState<StateT>>> referenceToObject
protected final MapAbstractStateFactory<java.lang.String,StateT extends LatticeAbstractState<StateT>> heapNodeMapAbstractStateFactory
protected final MapAbstractStateFactory<Reference,HeapNode<StateT extends LatticeAbstractState<StateT>>> heapMapAbstractStateFactory
protected final StateT extends LatticeAbstractState<StateT> defaultValue
protected JvmTreeHeapAbstractState(MapAbstractState<Reference,HeapNode<StateT>> referenceToObject, MapAbstractStateFactory<Reference,HeapNode<StateT>> heapMapAbstractStateFactory, MapAbstractStateFactory<java.lang.String,StateT> heapNodeMapAbstractStateFactory, StateT defaultValue)
referenceToObject
- a mapping from references to their objects/arraysheapMapAbstractStateFactory
- 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 valuesdefaultValue
- a default value for undefined fieldsprotected StateT getField(SetAbstractState<Reference> object, java.lang.String descriptor, StateT defaultValue)
SetAbstractState
. The defaultValue
is used when there is no information available.protected void assignField(SetAbstractState<Reference> object, java.lang.String descriptor, StateT value)
protected void mergeField(SetAbstractState<Reference> object, java.lang.String descriptor, StateT value)
protected void setField(SetAbstractState<Reference> object, java.lang.String descriptor, StateT value)
protected StateT getArrayElementOrDefault(SetAbstractState<Reference> array, StateT index, StateT defaultValue)
SetAbstractState
. The defaultValue
is used when there is no information available.protected void setArrayElement(SetAbstractState<Reference> array, StateT index, StateT value)
public HeapNode<StateT> getHeapNode(Reference reference)
reference
.public void expand(JvmHeapAbstractState<StateT> otherState)
expand
in interface JvmHeapAbstractState<StateT extends LatticeAbstractState<StateT>>
otherState
- a heap state from which expanding the heap (e.g. the state calling a method
to recover information discarded from it)public boolean isLessOrEqual(JvmHeapAbstractState<StateT> abstractState)
LatticeAbstractState
abstractState
.isLessOrEqual
in interface LatticeAbstractState<JvmHeapAbstractState<StateT extends LatticeAbstractState<StateT>>>
public boolean equals(java.lang.Object obj)
equals
in interface AbstractState
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface AbstractState
hashCode
in class java.lang.Object