Class DominanceAnalysis
- java.lang.Object
-
- com.ensoftcorp.open.commons.codemap.PrioritizedCodemapStage
-
- com.ensoftcorp.open.commons.algorithms.DominanceAnalysis
-
public class DominanceAnalysis extends PrioritizedCodemapStage
Primary interface for computing dominance relationships. This also acts as a code map stage to pre-compute dominance relationships for control flow graphs.- Author:
- Ben Holland
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDOMINANCE_FRONTIER_EDGEUsed to tag the edges from a node that identify the node's dominance frontier.static java.lang.StringDOMINATOR_TREE_EDGEThe immediate dominator or idom of a node n is the unique node that strictly dominates n but does not strictly dominate any other node that strictly dominates n.static java.lang.StringIDENTIFIERThe unique identifier for the PDG codemap stagestatic java.lang.StringPOST_DOMINANCE_FRONTIER_EDGEUsed to tag the edges from a node that identify the node's post-dominance frontier.static java.lang.StringPOST_DOMINATOR_TREE_EDGEUsed to tag the edges from a node that post-dominate a node.
-
Constructor Summary
Constructors Constructor Description DominanceAnalysis()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.ensoftcorp.atlas.core.db.graph.GraphcomputeDominance(UniqueEntryExitGraph ucfg)Returns a graph of all dominance relationship edgesstatic com.ensoftcorp.atlas.core.db.graph.GraphcomputeDominanceFrontier(UniqueEntryExitGraph ucfg)Returns the dominance frontierstatic com.ensoftcorp.atlas.core.db.graph.GraphcomputeDominanceTree(UniqueEntryExitGraph ucfg)Returns the immediate dominance treestatic com.ensoftcorp.atlas.core.db.graph.GraphcomputePostDominanceFrontier(UniqueEntryExitGraph ucfg)Returns the post-dominance frontierstatic com.ensoftcorp.atlas.core.db.graph.GraphcomputePostDominanceTree(UniqueEntryExitGraph ucfg)Returns the post dominance graphstatic SandboxGraphcomputeSandboxedDominance(Sandbox sandbox, UniqueEntryExitGraph ucfg)Returns a graph of all dominance relationship edgesstatic SandboxGraphcomputeSandboxedDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)Returns the dominance frontier (each edge represents a frontier node for a given from node)static SandboxGraphcomputeSandboxedDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)Returns the immediate dominator treestatic SandboxGraphcomputeSandboxedPostDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)Returns the post-dominance frontier (each edge represents a frontier node for a given from node)static SandboxGraphcomputeSandboxedPostDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)Returns the post dominator treejava.lang.String[]getCodemapStageDependencies()Returns a set of prioritized codemap stage identifier strings that should perform indexing before this prioritized codemap stage Note: this should represent a conservative set of the worst case dependencies.java.lang.StringgetDisplayName()Returns the display name of the codemap stagestatic com.ensoftcorp.atlas.core.query.QgetDominanceFrontierEdges()static com.ensoftcorp.atlas.core.query.QgetDominatorTreeEdges()java.lang.StringgetIdentifier()A unique string that serves as the identity of this PrioritizedCodemapStagestatic com.ensoftcorp.atlas.core.query.QgetPostDominanceFrontierEdges()static com.ensoftcorp.atlas.core.query.QgetPostDominatorTreeEdges()booleanperformIndexing(org.eclipse.core.runtime.IProgressMonitor monitor)The codemap stage indexing task to be performed.-
Methods inherited from class com.ensoftcorp.open.commons.codemap.PrioritizedCodemapStage
equals, hashCode, toString
-
-
-
-
Field Detail
-
IDENTIFIER
public static final java.lang.String IDENTIFIER
The unique identifier for the PDG codemap stage- See Also:
- Constant Field Values
-
DOMINATOR_TREE_EDGE
public static final java.lang.String DOMINATOR_TREE_EDGE
The immediate dominator or idom of a node n is the unique node that strictly dominates n but does not strictly dominate any other node that strictly dominates n. Every node, except the entry node, has an immediate dominator. Because the immediate dominator is unique, it is a tree. The start node is the root of the tree.- See Also:
- Constant Field Values
-
POST_DOMINATOR_TREE_EDGE
public static final java.lang.String POST_DOMINATOR_TREE_EDGE
Used to tag the edges from a node that post-dominate a node. Wikipedia: Analogous to the definition of dominance above, a node z is said to post-dominate a node n if all paths to the exit node of the graph starting at n must go through z. Similarly, the immediate post-dominator of a node n is the postdominator of n that doesn't strictly postdominate any other strict postdominators of n.- See Also:
- Constant Field Values
-
DOMINANCE_FRONTIER_EDGE
public static final java.lang.String DOMINANCE_FRONTIER_EDGE
Used to tag the edges from a node that identify the node's dominance frontier. Wikipedia: The dominance frontier of a node d is the set of all nodes n such that d dominates an immediate predecessor of n, but d does not strictly dominate n. It is the set of nodes where d's dominance stops.- See Also:
- Constant Field Values
-
POST_DOMINANCE_FRONTIER_EDGE
public static final java.lang.String POST_DOMINANCE_FRONTIER_EDGE
Used to tag the edges from a node that identify the node's post-dominance frontier. Wikipedia: The dominance frontier of a node d is the set of all nodes n such that d dominates an immediate predecessor of n, but d does not strictly dominate n. It is the set of nodes where d's dominance stops. Note that analogous to the definition of dominance above, a node z is said to post-dominate a node n if all paths to the exit node of the graph starting at n must go through z. Similarly, the immediate post-dominator of a node n is the postdominator of n that doesn't strictly postdominate any other strict postdominators of n.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDominatorTreeEdges
public static com.ensoftcorp.atlas.core.query.Q getDominatorTreeEdges()
-
getPostDominatorTreeEdges
public static com.ensoftcorp.atlas.core.query.Q getPostDominatorTreeEdges()
-
getDominanceFrontierEdges
public static com.ensoftcorp.atlas.core.query.Q getDominanceFrontierEdges()
-
getPostDominanceFrontierEdges
public static com.ensoftcorp.atlas.core.query.Q getPostDominanceFrontierEdges()
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from class:PrioritizedCodemapStageReturns the display name of the codemap stage- Specified by:
getDisplayNamein classPrioritizedCodemapStage- Returns:
-
getIdentifier
public java.lang.String getIdentifier()
Description copied from class:PrioritizedCodemapStageA unique string that serves as the identity of this PrioritizedCodemapStage- Specified by:
getIdentifierin classPrioritizedCodemapStage- Returns:
-
getCodemapStageDependencies
public java.lang.String[] getCodemapStageDependencies()
Description copied from class:PrioritizedCodemapStageReturns a set of prioritized codemap stage identifier strings that should perform indexing before this prioritized codemap stage Note: this should represent a conservative set of the worst case dependencies. That is, if it is possible that under some configuration of the toolbox that the toolbox could depend on a prioritized codemap stage, then it should be listed here. Note: mutual dependencies are not supported!- Specified by:
getCodemapStageDependenciesin classPrioritizedCodemapStage- Returns:
-
performIndexing
public boolean performIndexing(org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from class:PrioritizedCodemapStageThe codemap stage indexing task to be performed.- Specified by:
performIndexingin classPrioritizedCodemapStage- Returns:
- Returns true if the codemap stage was actually run.
-
computeSandboxedDominatorTree
public static SandboxGraph computeSandboxedDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the immediate dominator tree- Parameters:
ucfg-- Returns:
-
computeSandboxedPostDominatorTree
public static SandboxGraph computeSandboxedPostDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the post dominator tree- Parameters:
ucfg-- Returns:
-
computeSandboxedDominanceFrontier
public static SandboxGraph computeSandboxedDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the dominance frontier (each edge represents a frontier node for a given from node)- Parameters:
ucfg-- Returns:
-
computeSandboxedPostDominanceFrontier
public static SandboxGraph computeSandboxedPostDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the post-dominance frontier (each edge represents a frontier node for a given from node)- Parameters:
ucfg-- Returns:
-
computeSandboxedDominance
public static SandboxGraph computeSandboxedDominance(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns a graph of all dominance relationship edges- Parameters:
ucfg-- Returns:
-
computeDominanceTree
public static com.ensoftcorp.atlas.core.db.graph.Graph computeDominanceTree(UniqueEntryExitGraph ucfg)
Returns the immediate dominance tree- Parameters:
ucfg-- Returns:
-
computeDominanceFrontier
public static com.ensoftcorp.atlas.core.db.graph.Graph computeDominanceFrontier(UniqueEntryExitGraph ucfg)
Returns the dominance frontier- Parameters:
ucfg-- Returns:
-
computePostDominanceTree
public static com.ensoftcorp.atlas.core.db.graph.Graph computePostDominanceTree(UniqueEntryExitGraph ucfg)
Returns the post dominance graph- Parameters:
ucfg-- Returns:
-
computePostDominanceFrontier
public static com.ensoftcorp.atlas.core.db.graph.Graph computePostDominanceFrontier(UniqueEntryExitGraph ucfg)
Returns the post-dominance frontier- Parameters:
ucfg-- Returns:
-
computeDominance
public static com.ensoftcorp.atlas.core.db.graph.Graph computeDominance(UniqueEntryExitGraph ucfg)
Returns a graph of all dominance relationship edges- Parameters:
ucfg-- Returns:
-
-