Interface JvmHeapAbstractState<StateT extends AbstractState<StateT>>
- All Superinterfaces:
AbstractState<JvmHeapAbstractState<StateT>>
- All Known Implementing Classes:
JvmForgetfulHeapAbstractState,JvmShallowHeapAbstractState
public interface JvmHeapAbstractState<StateT extends AbstractState<StateT>>
extends AbstractState<JvmHeapAbstractState<StateT>>
The
JvmHeapAbstractState provides the interfaces for heap operations over objects and
arrays.-
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of itself.default voidexpand(JvmHeapAbstractState<StateT> otherState) Expands the heap with references present in another state.<T> StateTgetArrayElementOrDefault(T array, StateT index, StateT defaultValue) Returns anarrayelement at the specifiedindexor thedefaultValue, if the element is unset.<T> StateTgetFieldOrDefault(T object, String fqn, StateT defaultValue) Returns a fieldfqnfrom a referenceobject.newArray(String type, 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(String className, JvmCfaNode creationCite) Creates a new object of a given class at a specific program point and returns a reference to it.default StateTnewObject(Clazz clazz, JvmCfaNode creationCite) Creates a new object of a givenClazzat a specific program point and returns a reference to it.default voidDiscards unused parts of the heap.<T> voidsetArrayElement(T array, StateT index, StateT value) Sets thearrayelementvalueat the specifiedindex.<T> voidSets avalueto a fieldfqnof a referencedobject.Methods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
equals, getPrecision, hashCode, isLess, isLessOrEqual, join
-
Method Details
-
copy
JvmHeapAbstractState<StateT> copy()Description copied from interface:AbstractStateCreates a copy of itself.- Specified by:
copyin interfaceAbstractState<StateT extends AbstractState<StateT>>
-
newArray
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
Creates a new object of a given class at a specific program point and returns a reference to it. -
newObject
Creates a new object of a givenClazzat a specific program point and returns a reference to it. -
getFieldOrDefault
Returns a fieldfqnfrom a referenceobject. If there is no abstract state representing the field, returns thedefaultValue -
setField
Sets avalueto a fieldfqnof a referencedobject. -
getArrayElementOrDefault
Returns anarrayelement at the specifiedindexor thedefaultValue, if the element is unset. -
setArrayElement
Sets thearrayelementvalueat the specifiedindex. -
reduce
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
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)
-