|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.opt.util.Tree
org.jikesrvm.compilers.opt.controlflow.DominatorTree
public class DominatorTree
This class provides the abstraction of a dominator tree TODO: we do not support IRs with exception handlers.
| Field Summary | |
|---|---|
private DominatorTreeNode[] |
dominatorInfoMap
A structure used to quickly index into the DominatorVertex tree |
private boolean |
forward
True if we are computing regular dominators, false for post-dominators |
private IR |
ir
The governing IR |
| Constructor Summary | |
|---|---|
DominatorTree(IR ir,
boolean forward)
Build a dominator tree from an IR. |
|
| Method Summary | |
|---|---|
private void |
addNode(BasicBlock b)
Creates domniator tree nodes for the passed block and adds them to the map. |
BasicBlock |
deepestCommonAncestor(BasicBlock a,
BasicBlock b)
Return the deepest common dominance ancestor of blocks a and b |
int |
depth(BasicBlock b)
Return the distance from the root of the dominator tree to a given basic block |
boolean |
dominates(BasicBlock master,
BasicBlock slave)
Does basic block number "master" dominate basic block number "slave"? |
boolean |
dominates(int b,
BitVector bits)
Does basic block number b dominate all basic blocks in a set? |
boolean |
dominates(int master,
int slave)
Does basic block number "master" dominate basic block number "slave"? |
Enumeration<TreeNode> |
getChildren(BasicBlock bb)
Enumerate the children of the vertex corresponding to a basic block |
BitVector |
getDominanceFrontier(BasicBlock bb)
Return the (already calculated) dominance frontier for a basic block |
BitVector |
getDominanceFrontier(int number)
Return the (already calculated) dominance frontier for a basic block |
private BasicBlock |
getFirstNode()
Get the first node, either entry or exit depending on which way we are viewing the graph |
BasicBlock |
getParent(BasicBlock bb)
Return the parent of the vertex corresponding to a basic block |
static void |
perform(IR ir,
boolean forward)
Build a dominator tree from an IR. |
| Methods inherited from class org.jikesrvm.compilers.opt.util.Tree |
|---|
elements, getBottomUpEnumerator, getRoot, getTopDownEnumerator, isEmpty, numberOfNodes, setRoot, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final boolean forward
private final IR ir
private DominatorTreeNode[] dominatorInfoMap
| Constructor Detail |
|---|
public DominatorTree(IR ir,
boolean forward)
ir - the governing IRforward - are we building regular dominators or post-dominators?| Method Detail |
|---|
public static void perform(IR ir,
boolean forward)
ir - the governing IRforward - are we building regular dominators or post-dominators?private BasicBlock getFirstNode()
public Enumeration<TreeNode> getChildren(BasicBlock bb)
bb - the basic block
public BasicBlock getParent(BasicBlock bb)
bb - the basic block
public BitVector getDominanceFrontier(BasicBlock bb)
bb - the basic block
public BitVector getDominanceFrontier(int number)
number - the number of the basic block
public boolean dominates(int b,
BitVector bits)
b - the number of the basic block to testbits - BitVector representation of the set of basic blocks to test
public boolean dominates(int master,
int slave)
master - the number of the proposed "master" basic blockslave - the number of the proposed "slave block
public boolean dominates(BasicBlock master,
BasicBlock slave)
master - the number of the proposed "master" basic blockslave - the number of the proposed "slave block
private void addNode(BasicBlock b)
b - the basic blockpublic int depth(BasicBlock b)
b - the basic block in question
b's depth
public BasicBlock deepestCommonAncestor(BasicBlock a,
BasicBlock b)
a and b
a - The first basic blockb - The second basic block
a
and b
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||