sofya.apps.dejavu
Class CFEdgeSelector

java.lang.Object
  extended by sofya.apps.dejavu.EdgeSelector
      extended by sofya.apps.dejavu.CFEdgeSelector
All Implemented Interfaces:
SConstants

public class CFEdgeSelector
extends EdgeSelector
implements SConstants

Implementation of the edge selection module in the DejaVu graph traversal algorithm which understands the control flow edges found in Sofya control flow graphs.

This module can perform the appropriate type casting of edges returned by the traversal algorithm to control flow edges. It also understands and implements certain special edge selection behaviors related to the representation of exceptional control flow and finally blocks in Sofya control flow graphs.

Version:
11/30/2004
Author:
Alex Kinneer

Nested Class Summary
 
Nested classes/interfaces inherited from class sofya.apps.dejavu.EdgeSelector
EdgeSelector.EdgeMatchData, EdgeSelector.EdgeTraversal
 
Nested classes/interfaces inherited from interface sofya.base.SConstants
SConstants.BlockLabel, SConstants.BlockObjectType, SConstants.BlockSubType, SConstants.BlockType, SConstants.BranchObjectType, SConstants.BranchType, SConstants.EDObjectType, SConstants.TraceObjectType
 
Field Summary
 
Fields inherited from class sofya.apps.dejavu.EdgeSelector
newGraph, oldGraph
 
Fields inherited from interface sofya.base.SConstants
DEFAULT_PORT, INST_COMPATIBLE, INST_OLD_UNSUPPORTED, INST_OPT_NORMAL, INST_OPT_SEQUENCE, SIG_CHKALIVE, SIG_ECHO
 
Constructor Summary
CFEdgeSelector()
          Creates a new edge selector.
 
Method Summary
 EdgeSelector.EdgeMatchData beginVisit(Node oldNode, Node newNode)
          Event raised by the traverser when it reaches a node in the graph which has not been visited.
 void newEdges(Node oldNode, java.util.List newEdges, EdgeSelector.EdgeMatchData edgeData, java.util.Set dangerousEdges)
          Event raised by the traverser when it has determined that the graph for the new version of the method contains new edges out of a given node.
 EdgeSelector.EdgeTraversal nodesCompared(Edge oldEdge, Edge newEdge)
          Event raised by the traverser immediately after comparison of two successor nodes when it is in the process of following all outgoing edges from a node.
 void setGraphs(Graph oldGraph, Graph newGraph)
          Sets the graphs for the old and new versions of the methods.
 
Methods inherited from class sofya.apps.dejavu.EdgeSelector
findEdge, findEdges, getGraphs, matchLabelToEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFEdgeSelector

public CFEdgeSelector()
Creates a new edge selector.

Method Detail

setGraphs

public void setGraphs(Graph oldGraph,
                      Graph newGraph)
Description copied from class: EdgeSelector
Sets the graphs for the old and new versions of the methods.

Overrides:
setGraphs in class EdgeSelector
Parameters:
oldGraph - Graph corresponding to the old version of the method.
newGraph - Graph corresponding to the new version of the method.

beginVisit

public EdgeSelector.EdgeMatchData beginVisit(Node oldNode,
                                             Node newNode)
Description copied from class: EdgeSelector
Event raised by the traverser when it reaches a node in the graph which has not been visited.

This event provides an opportunity for subclasses to produce edge data and control the traversal based on information that may be available from specific types of edges contained in the graphs.

Specified by:
beginVisit in class EdgeSelector
Parameters:
oldNode - Node in the graph for the old version of the method.
newNode - Node in the graph for the new version of the method which has been determined to correspond to oldNode.
Returns:
A data object containing outgoing edges from the given nodes in each graph and an object instructing the traverser how to proceed.

nodesCompared

public EdgeSelector.EdgeTraversal nodesCompared(Edge oldEdge,
                                                Edge newEdge)
Description copied from class: EdgeSelector
Event raised by the traverser immediately after comparison of two successor nodes when it is in the process of following all outgoing edges from a node.

This event provides an opportunity for subclasses to provide special case control over the traversal based on information that may be available from specific types of edges and nodes contained in the graphs.

Specified by:
nodesCompared in class EdgeSelector
Parameters:
oldEdge - Edge which was followed in the old graph to reach the node from that graph which was used in the comparison.
newEdge - Edge which was followed in the new graph to reach the node from that graph which was used in the comparison.
Returns:
An object instruction the traverser how to proceed.

newEdges

public void newEdges(Node oldNode,
                     java.util.List newEdges,
                     EdgeSelector.EdgeMatchData edgeData,
                     java.util.Set dangerousEdges)
Description copied from class: EdgeSelector
Event raised by the traverser when it has determined that the graph for the new version of the method contains new edges out of a given node.

This event provides an opportunity for subclasses to specify how the new edges impact the dangerous edge set based on information that may be available from specific types of edges and nodes contained in the graphs.

Specified by:
newEdges in class EdgeSelector
Parameters:
oldNode - Node from the graph of the old version of the method from which new outgoing edges were found in the graph for the new version of the method.
newEdges - List of the new outgoing edges found in the graph for the new version of the method at the given node.
edgeData - Data about outgoing edges in both graphs, as determined by the last call to EdgeSelector.beginVisit(sofya.graphs.Node, sofya.graphs.Node).
dangerousEdges - Set containing the dangerous edges identified by the traversal up to the current point.