Package soot.jimple.spark.sets
Class PointsToSetInternal
- java.lang.Object
-
- soot.jimple.spark.sets.PointsToSetInternal
-
- All Implemented Interfaces:
EqualsSupportingPointsToSet,PointsToSet
- Direct Known Subclasses:
BitPointsToSet,DoublePointsToSet,EmptyPointsToSet,HashPointsToSet,HybridPointsToSet,SharedHybridSet,SharedListSet,SortedArraySet
public abstract class PointsToSetInternal extends Object implements PointsToSet, EqualsSupportingPointsToSet
Abstract base class for implementations of points-to sets.- Author:
- Ondrej Lhotak
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPointsToSetInternal.P2SetVisitorDefaultTrueA P2SetVisitor with a default return value oftrue.static classPointsToSetInternal.P2SetVisitorIntA P2SetVisitor with an int value.
-
Constructor Summary
Constructors Constructor Description PointsToSetInternal(Type type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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.abstract booleancontains(Node n)Returns true iff the set contains n.voidflushNew()Sets all newly-added nodes to old nodes.abstract booleanforall(P2SetVisitor v)Calls v's visit method on all nodes in this set.protected BitVectorgetBitMask(PointsToSetInternal other, PAG pag)PointsToSetInternalgetNewSet()Returns set of newly-added nodes since last call to flushNew.PointsToSetInternalgetOldSet()Returns set of nodes already present before last call to flushNew.TypegetType()booleanhasNonEmptyIntersection(PointsToSet other)Returns true if this set shares some objects with other.voidmergeWith(PointsToSetInternal other)Merges other into this set.booleanpointsToSetEquals(Object other)Returnstrueif and only if other holds the same alloc nodes as this.intpointsToSetHashCode()Computes a hash code based on the contents of the points-to set.Set<ClassConstant>possibleClassConstants()If this points-to set consists entirely of objects of type java.lang.Class of a known class, returns a set of ClassConstant's that are these classes.Set<String>possibleStringConstants()If this points-to set consists entirely of string constants, returns a set of these constant strings.Set<Type>possibleTypes()Set of all possible run-time types of objects in the set.voidsetType(Type type)intsize()StringtoString()voidunFlushNew()Sets all nodes to newly-added nodes.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.PointsToSet
isEmpty
-
-
-
-
Field Detail
-
type
protected Type type
-
-
Constructor Detail
-
PointsToSetInternal
public PointsToSetInternal(Type type)
-
-
Method Detail
-
addAll
public boolean addAll(PointsToSetInternal other, PointsToSetInternal exclude)
Adds contents of other minus the contents of exclude into this set; returns true if this set changed.
-
forall
public abstract boolean forall(P2SetVisitor v)
Calls v's visit method on all nodes in this set.
-
add
public abstract boolean add(Node n)
Adds n to this set, returns true if n was not already in this set.
-
getNewSet
public PointsToSetInternal getNewSet()
Returns set of newly-added nodes since last call to flushNew.
-
getOldSet
public PointsToSetInternal getOldSet()
Returns set of nodes already present before last call to flushNew.
-
flushNew
public void flushNew()
Sets all newly-added nodes to old nodes.
-
unFlushNew
public void unFlushNew()
Sets all nodes to newly-added nodes.
-
mergeWith
public void mergeWith(PointsToSetInternal other)
Merges other into this set.
-
contains
public abstract boolean contains(Node n)
Returns true iff the set contains n.
-
hasNonEmptyIntersection
public boolean hasNonEmptyIntersection(PointsToSet other)
Description copied from interface:PointsToSetReturns true if this set shares some objects with other.- Specified by:
hasNonEmptyIntersectionin interfacePointsToSet
-
possibleTypes
public Set<Type> possibleTypes()
Description copied from interface:PointsToSetSet of all possible run-time types of objects in the set.- Specified by:
possibleTypesin interfacePointsToSet
-
getType
public Type getType()
-
setType
public void setType(Type type)
-
size
public int size()
-
possibleStringConstants
public Set<String> possibleStringConstants()
Description copied from interface:PointsToSetIf this points-to set consists entirely of string constants, returns a set of these constant strings. If this point-to set may contain something other than constant strings, returns null.- Specified by:
possibleStringConstantsin interfacePointsToSet
-
possibleClassConstants
public Set<ClassConstant> possibleClassConstants()
Description copied from interface:PointsToSetIf this points-to set consists entirely of objects of type java.lang.Class of a known class, returns a set of ClassConstant's that are these classes. If this point-to set may contain something else, returns null.- Specified by:
possibleClassConstantsin interfacePointsToSet
-
getBitMask
protected BitVector getBitMask(PointsToSetInternal other, PAG pag)
-
pointsToSetHashCode
public int pointsToSetHashCode()
Computes a hash code based on the contents of the points-to set. Note that hashCode() is not overwritten on purpose. This is because Spark relies on comparison by object identity.- Specified by:
pointsToSetHashCodein interfaceEqualsSupportingPointsToSet
-
pointsToSetEquals
public boolean pointsToSetEquals(Object other)
Returnstrueif and only if other holds the same alloc nodes as this. Note that equals() is not overwritten on purpose. This is because Spark relies on comparison by object identity.- Specified by:
pointsToSetEqualsin interfaceEqualsSupportingPointsToSet
-
-