soot.jimple.spark.ondemand
Class LazyContextSensitivePointsToSet

java.lang.Object
  extended by soot.jimple.spark.ondemand.LazyContextSensitivePointsToSet
All Implemented Interfaces:
EqualsSupportingPointsToSet, PointsToSet

public class LazyContextSensitivePointsToSet
extends Object
implements EqualsSupportingPointsToSet

This is a lazy points-to set that is potentially context sensitive. It is created by the DemandCSPointsTo analysis. The idea is that the points-to set is usually context-insensitive. However, when compared with another points-to set and the intersection of these points-to sets is non-empty, then context information is computed for this points-to set and also for the other one, if applicable. Then the test is repeated. Once context information is computed it is stored in this wrapper object so that it does not have to be computed again. Objects of this type should only be compared to other LazyContextSensitivePointsToSet objects using the equals method. Checking for non-empty intersection with points-to sets of other types should be possible but it is recommended to consistently use LazyContextSensitivePointsToSet nevertheless.

Author:
Eric Bodden

Constructor Summary
LazyContextSensitivePointsToSet(Local l, EqualsSupportingPointsToSet contextInsensitiveSet, DemandCSPointsTo demandCSPointsTo)
           
 
Method Summary
 void computeContextSensitiveInfo()
           
 EqualsSupportingPointsToSet getDelegate()
           
 boolean hasNonEmptyIntersection(PointsToSet other)
          Returns true if this set shares some objects with other.
 boolean isContextSensitive()
           
 boolean isEmpty()
          Returns true if this set contains no run-time objects.
 boolean pointsToSetEquals(Object other)
          Returns true if and only if other holds the same alloc nodes as this.
 int pointsToSetHashCode()
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyContextSensitivePointsToSet

public LazyContextSensitivePointsToSet(Local l,
                                       EqualsSupportingPointsToSet contextInsensitiveSet,
                                       DemandCSPointsTo demandCSPointsTo)
Method Detail

isContextSensitive

public boolean isContextSensitive()

hasNonEmptyIntersection

public boolean hasNonEmptyIntersection(PointsToSet other)
Description copied from interface: PointsToSet
Returns true if this set shares some objects with other.

Specified by:
hasNonEmptyIntersection in interface PointsToSet

computeContextSensitiveInfo

public void computeContextSensitiveInfo()

isEmpty

public boolean isEmpty()
Description copied from interface: PointsToSet
Returns true if this set contains no run-time objects.

Specified by:
isEmpty in interface PointsToSet

possibleClassConstants

public Set<ClassConstant> possibleClassConstants()
Description copied from interface: PointsToSet
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. If this point-to set may contain something else, returns null.

Specified by:
possibleClassConstants in interface PointsToSet

possibleStringConstants

public Set<String> possibleStringConstants()
Description copied from interface: PointsToSet
If 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:
possibleStringConstants in interface PointsToSet

possibleTypes

public Set<Type> possibleTypes()
Description copied from interface: PointsToSet
Set of all possible run-time types of objects in the set.

Specified by:
possibleTypes in interface PointsToSet

pointsToSetEquals

public boolean pointsToSetEquals(Object other)
Description copied from interface: EqualsSupportingPointsToSet
Returns true if 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:
pointsToSetEquals in interface EqualsSupportingPointsToSet

pointsToSetHashCode

public int pointsToSetHashCode()
Description copied from interface: EqualsSupportingPointsToSet
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:
pointsToSetHashCode in interface EqualsSupportingPointsToSet

getDelegate

public EqualsSupportingPointsToSet getDelegate()