Package proguard.analysis.cpa.bam
Interface BamCache<SignatureT extends Signature>
-
- All Known Implementing Classes:
BamCacheImpl
public interface BamCache<SignatureT extends Signature>
Generic interface for the BAM cache, where the blocks represent a function identified with aSignatureT
. Along with theCfa
the signature can be used to retrieve the block (i.e. the respective CFA subgraph) as described in the BAM paper.A block abstraction is uniquely identified by a triple of an entry
AbstractState
(that may be call-context dependent, e.g. if the calling parameters or global variables are different), the correspondingPrecision
, and theSignature
of the function the block belongs to.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BlockAbstraction
get(AbstractState stateKey, Precision precisionKey, SignatureT blockKey)
Gets the block abstraction identified by the provided keys from the cache.java.util.Collection<BlockAbstraction>
get(Precision precision, SignatureT blockKey)
Returns a collection of all the cache entries for a specified method with a certain precision, empty in case there are not such entries.java.util.Collection<BlockAbstraction>
get(SignatureT blockKey)
Returns a collection of all the cache entries for a specified method, empty in case there are not such entries.java.util.Set<SignatureT>
getAllMethods()
Returns a set of all the methods that have an entry in the cache.void
put(AbstractState stateKey, Precision precisionKey, SignatureT blockKey, BlockAbstraction blockAbstraction)
Adds the block abstraction identified by the provided keys to the cache.int
size()
Returns the size of the cache.java.util.Collection<BlockAbstraction>
values()
Returns block abstractions stored in the cache.
-
-
-
Method Detail
-
put
void put(AbstractState stateKey, Precision precisionKey, SignatureT blockKey, BlockAbstraction blockAbstraction)
Adds the block abstraction identified by the provided keys to the cache.
-
get
BlockAbstraction get(AbstractState stateKey, Precision precisionKey, SignatureT blockKey)
Gets the block abstraction identified by the provided keys from the cache.- Returns:
- The requested block abstraction, null in case of cache-miss.
-
get
java.util.Collection<BlockAbstraction> get(SignatureT blockKey)
Returns a collection of all the cache entries for a specified method, empty in case there are not such entries.
-
get
java.util.Collection<BlockAbstraction> get(Precision precision, SignatureT blockKey)
Returns a collection of all the cache entries for a specified method with a certain precision, empty in case there are not such entries.
-
values
java.util.Collection<BlockAbstraction> values()
Returns block abstractions stored in the cache.
-
size
int size()
Returns the size of the cache.
-
getAllMethods
java.util.Set<SignatureT> getAllMethods()
Returns a set of all the methods that have an entry in the cache.
-
-