Package soot.jimple.spark.sets
Class SharedHybridSet
- java.lang.Object
-
- soot.jimple.spark.sets.PointsToSetInternal
-
- soot.jimple.spark.sets.SharedHybridSet
-
- All Implemented Interfaces:
EqualsSupportingPointsToSet,PointsToSet
public class SharedHybridSet extends PointsToSetInternal
A shared representation of a points-to set which uses a bit vector + a list of extra elements, an "overflow list", to make adding single elements fast in most cases. The bit vector may be shared by multiple points-to sets, while the overflow list is specific to each points-to set. To facilitate sharing of the bitvectors, there is a "hash table" of all existing bitvectors kept, called BitVectorLookupMap, where the ith element contains a list of all existing bitvectors of cardinality i (i.e. has i one bits).- Author:
- Adam Richard
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.jimple.spark.sets.PointsToSetInternal
PointsToSetInternal.P2SetVisitorDefaultTrue, PointsToSetInternal.P2SetVisitorInt
-
-
Field Summary
Fields Modifier and Type Field Description static intOVERFLOW_SIZEstatic intOVERFLOW_THRESHOLDThe max number of elements allowed in the set before creating a new bitvector for it.-
Fields inherited from class soot.jimple.spark.sets.PointsToSetInternal
type
-
-
Constructor Summary
Constructors Constructor Description SharedHybridSet(Type type, PAG pag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Node n)Adds n to this set, returns true if n was not already in this set.booleanaddAll(PointsToSetInternal other, PointsToSetInternal exclude)Adds contents of other minus the contents of exclude into this set; returns true if this set changed.booleancontains(Node n)When the overflow list overflows, the maximum number of elements that may remain in the overflow list (the rest are moved into the base bit vector)booleanforall(P2SetVisitor v)Calls v's visit method on all nodes in this set.static P2SetFactorygetFactory()booleanisEmpty()Returns true if this set contains no run-time objects.intsize()-
Methods inherited from class soot.jimple.spark.sets.PointsToSetInternal
flushNew, getBitMask, getNewSet, getOldSet, getType, hasNonEmptyIntersection, mergeWith, pointsToSetEquals, pointsToSetHashCode, possibleClassConstants, possibleStringConstants, possibleTypes, setType, toString, unFlushNew
-
-
-
-
Field Detail
-
OVERFLOW_SIZE
public static final int OVERFLOW_SIZE
- See Also:
- Constant Field Values
-
OVERFLOW_THRESHOLD
public static final int OVERFLOW_THRESHOLD
The max number of elements allowed in the set before creating a new bitvector for it.- See Also:
- Constant Field Values
-
-
Method Detail
-
contains
public boolean contains(Node n)
When the overflow list overflows, the maximum number of elements that may remain in the overflow list (the rest are moved into the base bit vector)- Specified by:
containsin classPointsToSetInternal
-
isEmpty
public boolean isEmpty()
Description copied from interface:PointsToSetReturns true if this set contains no run-time objects.
-
add
public boolean add(Node n)
Description copied from class:PointsToSetInternalAdds n to this set, returns true if n was not already in this set.- Specified by:
addin classPointsToSetInternal
-
addAll
public boolean addAll(PointsToSetInternal other, PointsToSetInternal exclude)
Description copied from class:PointsToSetInternalAdds contents of other minus the contents of exclude into this set; returns true if this set changed.- Overrides:
addAllin classPointsToSetInternal
-
forall
public boolean forall(P2SetVisitor v)
Description copied from class:PointsToSetInternalCalls v's visit method on all nodes in this set.- Specified by:
forallin classPointsToSetInternal
-
getFactory
public static final P2SetFactory getFactory()
-
size
public int size()
- Overrides:
sizein classPointsToSetInternal
-
-