Class BamLocationDependentJvmMemoryLocation<AbstractStateT extends AbstractState & ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.domain.memory.BamLocationDependentJvmMemoryLocation<AbstractStateT>
-
- Type Parameters:
AbstractStateT
- The type of the abstract states in the BAM cache.
- All Implemented Interfaces:
BamLocationDependent<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature>
,ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>
public class BamLocationDependentJvmMemoryLocation<AbstractStateT extends AbstractState & ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>> extends java.lang.Object implements ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>, BamLocationDependent<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature>
This class wraps aJvmMemoryLocation
adding information on its program location and source reached set.
-
-
Constructor Summary
Constructors Constructor Description BamLocationDependentJvmMemoryLocation(JvmMemoryLocation memoryLocation)
BamLocationDependentJvmMemoryLocation(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature> sourceReachedSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BamLocationDependentJvmMemoryLocation<AbstractStateT>
copy()
boolean
equals(java.lang.Object obj)
<T extends LatticeAbstractState<T>>
TextractFirstValue(T defaultValue)
Extract the value from the first state from the reached state corresponding to the program, memory location, and BAM cache entry represented by this object.JvmMemoryLocation
getMemoryLocation()
JvmCfaNode
getProgramLocation()
Returns the program location.ProgramLocationDependentReachedSet<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature>
getSourceReachedSet()
Returns the reached set the abstract state belongs to.int
hashCode()
void
setProgramLocation(JvmCfaNode programLocation)
Sets the program location.void
setSourceReachedSet(ProgramLocationDependentReachedSet<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature> sourceReachedSet)
Sets the reached set the abstract state belongs to.java.lang.String
toString()
-
-
-
Constructor Detail
-
BamLocationDependentJvmMemoryLocation
public BamLocationDependentJvmMemoryLocation(JvmMemoryLocation memoryLocation)
-
BamLocationDependentJvmMemoryLocation
public BamLocationDependentJvmMemoryLocation(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature> sourceReachedSet)
-
-
Method Detail
-
getMemoryLocation
public JvmMemoryLocation getMemoryLocation()
-
copy
public BamLocationDependentJvmMemoryLocation<AbstractStateT> copy()
-
extractFirstValue
public <T extends LatticeAbstractState<T>> T extractFirstValue(T defaultValue)
Extract the value from the first state from the reached state corresponding to the program, memory location, and BAM cache entry represented by this object.Most analyses will have one state at most for each program location, and this method should be mostly used for this kind of analyses since it will return the only valid state. It's also possible that, for analyses where multiple states are possible, the returned value might be non-deterministic depending on the underlying reached set implementation.
- Returns:
- an empty optional if there is no analysis state in the cache entry and program location represented by this object. Otherwise, the content for the memory location specified by this object of the first state (there is usually only one state anyway, but this is analysis-dependent) for that program location.
-
getProgramLocation
public JvmCfaNode getProgramLocation()
Description copied from interface:ProgramLocationDependent
Returns the program location.- Specified by:
getProgramLocation
in interfaceProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>
-
setProgramLocation
public void setProgramLocation(JvmCfaNode programLocation)
Description copied from interface:ProgramLocationDependent
Sets the program location.- Specified by:
setProgramLocation
in interfaceProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>
-
getSourceReachedSet
public ProgramLocationDependentReachedSet<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature> getSourceReachedSet()
Description copied from interface:BamLocationDependent
Returns the reached set the abstract state belongs to.- Specified by:
getSourceReachedSet
in interfaceBamLocationDependent<JvmCfaNode,JvmCfaEdge,AbstractStateT extends AbstractState & ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>,MethodSignature>
-
setSourceReachedSet
public void setSourceReachedSet(ProgramLocationDependentReachedSet<JvmCfaNode,JvmCfaEdge,AbstractStateT,MethodSignature> sourceReachedSet)
Description copied from interface:BamLocationDependent
Sets the reached set the abstract state belongs to.- Specified by:
setSourceReachedSet
in interfaceBamLocationDependent<JvmCfaNode,JvmCfaEdge,AbstractStateT extends AbstractState & ProgramLocationDependent<JvmCfaNode,JvmCfaEdge,MethodSignature>,MethodSignature>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-