Class GeomPointsTo

  • All Implemented Interfaces:
    PointsToAnalysis

    public class GeomPointsTo
    extends PAG
    The main interface for the points-to analysis with geometric encodings. Since we need SPARK to bootstrap our analysis, thus, we identify ourself to be a subclass of SPARK.
    Author:
    xiao
    • Constructor Detail

    • Method Detail

      • parametrize

        public void parametrize​(double spark_run_time)
        Using the user specified arguments to parameterize the geometric points-to solver.
        Parameters:
        spark_run_time -
      • transformToCIResult

        public void transformToCIResult()
        For many applications, they only need the context insensitive points-to result. We provide a way to transfer our result back to SPARK. After the transformation, we discard the context sensitive points-to information. Therefore, if context sensitive queries are needed in future, please call ddSolve() for queried pointers first.
      • solve

        public void solve()
        The starting point of the geometric points-to analysis engine. This function computes the whole program points-to information.
      • ddSolve

        public void ddSolve​(Set<Node> qryNodes)
        The demand-driven mode for precisely computing points-to information for given pointers. Call graph will not be updated in this mode.
        Parameters:
        qryNodes - : the set of nodes that would be refined by geomPA.
      • cleanResult

        public void cleanResult()
        We thoroughly delete the geometric points-to result for space saving. Some applications such as those needing the call graph only may want to clean the points-to result.
      • keepOnly

        public void keepOnly​(Set<IVarAbstraction> usefulPointers)
        Keep only the pointers the users are interested in. Just used for reducing memory occupation.
      • getIDFromSootMethod

        public int getIDFromSootMethod​(SootMethod sm)
        Get Internal ID for soot method @param sm
        Returns:
        -1 if the given method is unreachable
      • getSootMethodFromID

        public SootMethod getSootMethodFromID​(int fid)
        Get soot method from given internal ID @param fid
        Returns:
        null if such ID is illegal.
      • isReachableMethod

        public boolean isReachableMethod​(int fid)
        Deciding if the given method represented by @param fid is reachable.
      • isReachableMethod

        public boolean isReachableMethod​(SootMethod sm)
        Deciding if the given method represented by @param sm is reachable.
      • isValidMethod

        public boolean isValidMethod​(SootMethod sm)
        Telling if the given method is in the file given by the option "cg.spark geom-verify-name".
      • outputNotEvaluatedMethods

        public void outputNotEvaluatedMethods()
      • getAllReachableMethods

        public Set<SootMethod> getAllReachableMethods()
        A replacement of the Scene.v().getReachableMethods.
        Returns:
      • getCallEgesOutFrom

        public CgEdge getCallEgesOutFrom​(int fid)
        Get the call edges calling from the method @param fid.
      • getCallEdgesInto

        public LinkedList<CgEdge> getCallEdgesInto​(int fid)
        Get the call edges calling into the method @param fid.
      • getMethodIDFromPtr

        public int getMethodIDFromPtr​(IVarAbstraction pn)
        Get the index of the enclosing function of the specified node.
      • makeInternalNode

        public IVarAbstraction makeInternalNode​(Node v)
        Transform the SPARK node @param v representation to our representation.
      • findInternalNode

        public IVarAbstraction findInternalNode​(Node v)
        Find our representation for the SPARK node @param v. We don't create a new node if nothing found.
      • castNeverFails

        public boolean castNeverFails​(Type src,
                                      Type dst)
        Type compatibility test.
        Parameters:
        src -
        dst -
      • getNumberOfPointers

        public int getNumberOfPointers()
        Get the number of valid pointers currently reachable by geomPTA.
      • getNumberOfObjects

        public int getNumberOfObjects()
        Get the number of valid objects current in the container.
        Returns:
      • getNumberOfSparkMethods

        public int getNumberOfSparkMethods()
        Return the number of functions that are reachable by SPARK.
      • getNumberOfMethods

        public int getNumberOfMethods()
        Return the number of functions that are reachable after the geometric points-to analysis.
      • getWorklist

        public IWorklist getWorklist()
      • findAndInsertInstanceField

        public IVarAbstraction findAndInsertInstanceField​(AllocNode obj,
                                                          SparkField field)
        Obtain or create an internal representation of an object field.
      • getInternalEdgeFromSootEdge

        public CgEdge getInternalEdgeFromSootEdge​(Edge e)
        Obtain the edge representation internal to geomPTA.
      • isExceptionPointer

        public boolean isExceptionPointer​(Node v)
      • isValidGeometricNode

        public boolean isValidGeometricNode​(Node sparkNode)
        Given a valid SPARK node, we test if it is still valid after the geometric analysis.
      • hasGeomExecuted

        public boolean hasGeomExecuted()
        Is this a Spark or Geom?
        Returns: