Class PegGraph

  • All Implemented Interfaces:
    Iterable, DirectedGraph

    public class PegGraph
    extends Object
    implements DirectedGraph
    Oct. 7, 2003 modify buildPegChain() for building chain without inliner. June 19, 2003 add begin node to peg June 18, 2003 modify the iterator() to be iterator for all nodes of PEG and mainIterator() to be the iterator for main chain. June 12, 2003 add monitor Map, notifyAll Map, waitingNodes Map.
    • Constructor Detail

      • PegGraph

        public PegGraph​(CallGraph callGraph,
                        Hierarchy hierarchy,
                        PAG pag,
                        Set<Object> methodsNeedingInlining,
                        Set<AllocNode> allocNodes,
                        List inlineSites,
                        Map synchObj,
                        Set<AllocNode> multiRunAllocNodes,
                        Map allocNodeToObj,
                        Body unitBody,
                        SootMethod sm,
                        boolean addExceptionEdges,
                        boolean dontAddEdgeFromStmtBeforeAreaOfProtectionToCatchBlock)
        Constructs a graph for the units found in the provided Body instance. Each node in the graph corresponds to a unit. The edges are derived from the control flow.
        Parameters:
        Body - The underlying body of main thread
        addExceptionEdges - If true then the control flow edges associated with exceptions are added.
        Hierarchy - Using class hierarchy analysis to find the run method of started thread
        PointsToAnalysis - Using point to analysis (SPARK package) to improve the precision of results
      • PegGraph

        public PegGraph​(CallGraph callGraph,
                        Hierarchy hierarchy,
                        PAG pag,
                        Set methodsNeedingInlining,
                        Set allocNodes,
                        List<List> inlineSites,
                        Map<SootMethod,​String> synchObj,
                        Set multiRunAllocNodes,
                        Map<AllocNode,​String> allocNodeToObj,
                        Body unitBody,
                        String threadName,
                        SootMethod sm,
                        boolean addExceEdge,
                        boolean dontAddEdgeFromStmtBeforeAreaOfProtectionToCatchBlock)
        Constructs a graph for the units found in the provided Body instance. Each node in the graph corresponds to a unit. The edges are derived from the control flow.
        Parameters:
        body - The underlying body we want to make a graph for.
        addExceptionEdges - If true then the control flow edges associated with exceptions are added.
        dontAddEdgeFromStmtBeforeAreaOfProtectionToCatchBlock - This was added for Dava. If true, edges are not added from statement before area of protection to catch. If false, edges ARE added. For Dava, it should be true. For flow analyses, it should be false.
        Hierarchy - Using class hierarchy analysis to find the run method of started thread
        PointsToAnalysis - Using point to analysis (SPARK package) to improve the precision of results
    • Method Detail

      • getStartToBeginNodes

        protected Map getStartToBeginNodes()
      • getUnitToPegMap

        protected Map getUnitToPegMap()
      • addMonitorStmt

        protected void addMonitorStmt()
      • buildSuccsForInlining

        protected void buildSuccsForInlining​(JPegStmt stmt,
                                             Chain chain,
                                             PegGraph inlinee)
      • buildMaps

        protected void buildMaps​(PegGraph pg)
      • buildPreds

        protected void buildPreds()
      • computeMonitorObjs

        public void computeMonitorObjs()
      • getNeedInlining

        protected boolean getNeedInlining()
      • getAllNodes

        protected FlowSet getAllNodes()
      • getUnitToSuccs

        protected HashMap getUnitToSuccs()
      • getUnitToPreds

        protected HashMap getUnitToPreds()
      • getBody

        public Body getBody()
      • getCanNotBeCompacted

        public Set getCanNotBeCompacted()
      • size

        public int size()
        Description copied from interface: DirectedGraph
        Returns the node count for this graph.
        Specified by:
        size in interface DirectedGraph
      • mainIterator

        public Iterator mainIterator()
      • getExceHandlers

        protected Set<Unit> getExceHandlers()
      • getMonitorObjs

        public Set<Object> getMonitorObjs()
      • getThreadAllocSites

        protected Set getThreadAllocSites()
      • getSpecialJoin

        protected Set<JPegStmt> getSpecialJoin()
      • getStartToAllocNodes

        public Map getStartToAllocNodes()
      • getThreadNameToStart

        protected Map getThreadNameToStart()
      • getMainPegChain

        public PegChain getMainPegChain()
      • getMethodsNeedingInlining

        public Set getMethodsNeedingInlining()
      • testIterator

        protected void testIterator()
      • testWaitingNodes

        public void testWaitingNodes()
      • testStartToThread

        protected void testStartToThread()
      • testUnitToPeg

        protected void testUnitToPeg​(HashMap unitToPeg)
      • testUnitToSucc

        protected void testUnitToSucc()
      • testUnitToPred

        protected void testUnitToPred()
      • addTag

        protected void addTag()
      • testSynch

        protected void testSynch()
      • testThreadNameToStart

        protected void testThreadNameToStart()
      • testJoinStmtToThread

        protected void testJoinStmtToThread()
      • testPegChain

        protected void testPegChain​(Chain chain)
      • computeEdgeAndThreadNo

        protected void computeEdgeAndThreadNo()
      • testList

        protected void testList​(List list)
      • testSet

        protected void testSet​(Set set,
                               String name)
      • testMonitor

        public void testMonitor()