| Modifier and Type | Class and Description |
|---|---|
| public static class | SsaBasicBlock.
Label comparator. |
| public static interface | SsaBasicBlock.
Visitor interface for basic blocks. |
| Modifier and Type | Field and Description |
|---|---|
| private final ArrayList | domChildren
list of dom children |
| private int | index
our index into parent.getBlock() |
| private ArrayList | insns
|
| public static final Comparator | LABEL_COMPARATOR
|
| private IntSet | liveIn
|
| private IntSet | liveOut
|
| private int | movesFromPhisAtBeginning
the number of moves added to the beginning of the block during the phi-removal process. |
| private int | movesFromPhisAtEnd
the number of moves added to the end of the block during the phi-removal process. |
| private SsaMethod | parent
|
| private BitSet | predecessors
|
| private int | primarySuccessor
block list index of primary successor, or |
| private int | reachable
contains last computed value of reachability of this block, or -1 if reachability hasn't been calculated yet |
| private int | ropLabel
label of block in rop form |
| private IntList | successorList
|
| private BitSet | successors
|
| Access | Constructor and Description |
|---|---|
| public | SsaBasicBlock(final int
index this block will have basicBlockIndex, final int original rop-form label ropLabel, final SsaMethod method of this block parent)Creates a new empty basic block. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addDomChild(SsaBasicBlock
non-null; new dom childAdds a basic block as a dom child for this block. |
| public void | addInsnToHead(Insn
non-null; rop-form insn to addAdds an insn to the head of this basic block, just after any phi insns. |
| public void | addLiveIn(int
register that is live-in for this block. regV)Adds |
| public void | addLiveOut(int
register that is live-out for this block. regV)Adds |
| public void | addMoveToBeginning(RegisterSpec
move destination result, RegisterSpec move source source)Adds a move instruction after the phi insn block. |
| public void | addMoveToEnd(RegisterSpec
move destination result, RegisterSpec move source source)Adds a move instruction to the end of this basic block, just before the last instruction. |
| public void | |
| public void | addPhiInsnForReg(RegisterSpec
non-null; regAdds a phi insn to the beginning of this block. |
| private static boolean | Returns: true if register is fully or partially (for the case of wide registers) used.set, indexed by register number regsUsed, RegisterSpec register to mark as used rs)Checks to see if the register is used in a bitset, taking into account its category/width. |
| public void | exitBlockFixup(SsaBasicBlock
non-null; exit blockAttaches block to an exit block if necessary. |
| public void | |
| public void | |
| private int | Returns: count of phi insnsGets the number of phi insns at the top of this basic block. |
| public ArrayList | |
| public int | |
| public ArrayList | Returns: non-null; the (mutable) instruction list for this block,
with phi insns at the beginning
|
| public IntSet | |
| public IntSet | |
| public SsaMethod | |
| public List | |
| public BitSet | |
| public SsaBasicBlock | |
| public int | Returns: >= -1; block index of primary successor or
-1 if no primary successor
|
| public int | |
| public int | |
| public String | |
| public IntList | |
| public IntList | |
| public BitSet | |
| public SsaBasicBlock | Returns: non-null; an appropriately-constructed instanceInserts a new empty GOTO block as a predecessor to this block. |
| public SsaBasicBlock | Returns: non-null; an appropriately-constructed instancecurrent successor (B) other)Constructs and inserts a new empty GOTO block |
| public boolean | |
| public boolean | Returns: true if reachableReturns true if this block was last calculated to be reachable. |
| public static SsaBasicBlock | Returns: new instanceoriginal method rmeth, int index this block will have basicBlockIndex, final SsaMethod method of this block predecessor set will be
updated parent)Creates a new SSA basic block from a ROP form basic block. |
| public void | |
| public void | removeSuccessor(int
index of successor block to remove oldIndex)Removes a successor from this block's successor list. |
| public void | replaceLastInsn(Insn
non-null; rop-form insn to add, which must branch.Replaces the last insn in this block. |
| public void | replaceSuccessor(int
index of old successor block oldIndex, int index of new successor block newIndex)Replaces an old successor with a new successor. |
| public void | scheduleMovesFromPhis()
Sorts move instructions added via |
| private void | scheduleUseBeforeAssigned(List<SsaInsn>
List of instructions. Must consist only of moves. toSchedule)Ensures that all move operations in this block occur such that reads of any register happen before writes to that register. |
| public void | setReachable(int
new value of reachability for block reach)Sets reachability of block to specified value |
| private static void | setRegsUsed(BitSet
set, indexed by register number regsUsed, RegisterSpec register to mark as used rs)Sets the register as used in a bitset, taking into account its category/width. |
| public String |
| domChildren | back to summary |
|---|---|
| private final ArrayList<SsaBasicBlock> domChildren list of dom children | |
| index | back to summary |
|---|---|
| private int index our index into parent.getBlock() | |
| insns | back to summary |
|---|---|
| private ArrayList<SsaInsn> insns
| |
| LABEL_COMPARATOR | back to summary |
|---|---|
| public static final Comparator<SsaBasicBlock> LABEL_COMPARATOR
| |
| liveIn | back to summary |
|---|---|
| private IntSet liveIn
| |
| liveOut | back to summary |
|---|---|
| private IntSet liveOut
| |
| movesFromPhisAtBeginning | back to summary |
|---|---|
| private int movesFromPhisAtBeginning the number of moves added to the beginning of the block during the phi-removal process. Retained for subsequent move scheduling. | |
| movesFromPhisAtEnd | back to summary |
|---|---|
| private int movesFromPhisAtEnd the number of moves added to the end of the block during the phi-removal process. Retained for subsequent move scheduling. | |
| parent | back to summary |
|---|---|
| private SsaMethod parent
| |
| predecessors | back to summary |
|---|---|
| private BitSet predecessors
| |
| primarySuccessor | back to summary |
|---|---|
| private int primarySuccessor block list index of primary successor, or | |
| reachable | back to summary |
|---|---|
| private int reachable contains last computed value of reachability of this block, or -1 if reachability hasn't been calculated yet | |
| ropLabel | back to summary |
|---|---|
| private int ropLabel label of block in rop form | |
| successorList | back to summary |
|---|---|
| private IntList successorList
| |
| successors | back to summary |
|---|---|
| private BitSet successors
| |
| SsaBasicBlock | back to summary |
|---|---|
| public SsaBasicBlock(final int basicBlockIndex, final int ropLabel, final SsaMethod parent) Creates a new empty basic block.
| |
| addDomChild | back to summary |
|---|---|
| public void addDomChild(SsaBasicBlock child) Adds a basic block as a dom child for this block. Used when constructing the dom tree.
| |
| addInsnToHead | back to summary |
|---|---|
| public void addInsnToHead(Insn insn) Adds an insn to the head of this basic block, just after any phi insns.
| |
| addLiveIn | back to summary |
|---|---|
| public void addLiveIn(int regV) Adds
| |
| addLiveOut | back to summary |
|---|---|
| public void addLiveOut(int regV) Adds
| |
| addMoveToBeginning | back to summary |
|---|---|
| public void addMoveToBeginning(RegisterSpec result, RegisterSpec source) Adds a move instruction after the phi insn block.
| |
| addMoveToEnd | back to summary |
|---|---|
| public void addMoveToEnd(RegisterSpec result, RegisterSpec source) Adds a move instruction to the end of this basic block, just before the last instruction. If the result of the final instruction is the source in question, then the move is placed at the beginning of the primary successor block. This is for unversioned registers.
| |
| addPhiInsnForReg | back to summary |
|---|---|
| public void addPhiInsnForReg(int reg) Adds a phi insn to the beginning of this block. The result type of the phi will be set to void, to indicate that it's currently unknown.
| |
| addPhiInsnForReg | back to summary |
|---|---|
| public void addPhiInsnForReg(RegisterSpec resultSpec) Adds a phi insn to the beginning of this block. This is to be used when the result type or local-association can be determined at phi insert time.
| |
| checkRegUsed | back to summary |
|---|---|
| private static boolean checkRegUsed(BitSet regsUsed, RegisterSpec rs) Checks to see if the register is used in a bitset, taking into account its category/width.
| |
| exitBlockFixup | back to summary |
|---|---|
| public void exitBlockFixup(SsaBasicBlock exitBlock) Attaches block to an exit block if necessary. If this block
is not an exit predecessor or is the exit block, this block does
nothing. For use by
| |
| forEachInsn | back to summary |
|---|---|
| public void forEachInsn(SsaInsn. Visits all insns in this block. | |
| forEachPhiInsn | back to summary |
|---|---|
| public void forEachPhiInsn(PhiInsn. Visits each phi insn. | |
| getCountPhiInsns | back to summary |
|---|---|
| private int getCountPhiInsns() Gets the number of phi insns at the top of this basic block.
| |
| getDomChildren | back to summary |
|---|---|
| public ArrayList Gets the dom children for this node. Don't modify this list.
| |
| getIndex | back to summary |
|---|---|
public int getIndex()
| |
| getInsns | back to summary |
|---|---|
| public ArrayList | |
| getLiveInRegs | back to summary |
|---|---|
| public IntSet getLiveInRegs() Returns the set of live-in registers. Valid after register interference graph has been generated, otherwise empty.
| |
| getLiveOutRegs | back to summary |
|---|---|
| public IntSet getLiveOutRegs() Returns the set of live-out registers. Valid after register interference graph has been generated, otherwise empty.
| |
| getParent | back to summary |
|---|---|
public SsaMethod getParent()
| |
| getPhiInsns | back to summary |
|---|---|
| public List | |
| getPredecessors | back to summary |
|---|---|
public BitSet getPredecessors()
| |
| getPrimarySuccessor | back to summary |
|---|---|
public SsaBasicBlock getPrimarySuccessor()
| |
| getPrimarySuccessorIndex | back to summary |
|---|---|
public int getPrimarySuccessorIndex()
| |
| getPrimarySuccessorRopLabel | back to summary |
|---|---|
public int getPrimarySuccessorRopLabel()
| |
| getRopLabel | back to summary |
|---|---|
public int getRopLabel()
| |
| getRopLabelString | back to summary |
|---|---|
public String getRopLabelString()
| |
| getRopLabelSuccessorList | back to summary |
|---|---|
public IntList getRopLabelSuccessorList()
| |
| getSuccessorList | back to summary |
|---|---|
public IntList getSuccessorList()
| |
| getSuccessors | back to summary |
|---|---|
public BitSet getSuccessors()
| |
| insertNewPredecessor | back to summary |
|---|---|
| public SsaBasicBlock insertNewPredecessor() Inserts a new empty GOTO block as a predecessor to this block. All previous predecessors will be predecessors to the new block.
| |
| insertNewSuccessor | back to summary |
|---|---|
| public SsaBasicBlock insertNewSuccessor(SsaBasicBlock other) Constructs and inserts a new empty GOTO block
| |
| isExitBlock | back to summary |
|---|---|
public boolean isExitBlock()
| |
| isReachable | back to summary |
|---|---|
| public boolean isReachable() Returns true if this block was last calculated to be reachable. Recalculates reachability if value has never been computed.
| |
| newFromRop | back to summary |
|---|---|
| public static SsaBasicBlock newFromRop(RopMethod rmeth, int basicBlockIndex, final SsaMethod parent) Creates a new SSA basic block from a ROP form basic block.
| |
| removeAllPhiInsns | back to summary |
|---|---|
| public void removeAllPhiInsns() Deletes all phi insns. Do this after adding appropriate move insns. | |
| removeSuccessor | back to summary |
|---|---|
| public void removeSuccessor(int oldIndex) Removes a successor from this block's successor list.
| |
| replaceLastInsn | back to summary |
|---|---|
| public void replaceLastInsn(Insn insn) Replaces the last insn in this block. The provided insn must have some branchingness.
| |
| replaceSuccessor | back to summary |
|---|---|
| public void replaceSuccessor(int oldIndex, int newIndex) Replaces an old successor with a new successor. This will throw
RuntimeException if
| |
| scheduleMovesFromPhis | back to summary |
|---|---|
| public void scheduleMovesFromPhis() Sorts move instructions added via This is necessary because copy-propogation may have left us in a state where the same basic block has the same register as a phi operand and a result. In this case, the register in the phi operand always refers value before any other phis have executed. | |
| scheduleUseBeforeAssigned | back to summary |
|---|---|
| private void scheduleUseBeforeAssigned(List<SsaInsn> toSchedule) Ensures that all move operations in this block occur such that reads of any register happen before writes to that register. Note caller is expected to returnSpareRegisters()! TODO: See Briggs, et al "Practical Improvements to the Construction and Destruction of Static Single Assignment Form" section 5. a) This can be done in three passes. | |
| setReachable | back to summary |
|---|---|
| public void setReachable(int reach) Sets reachability of block to specified value
| |
| setRegsUsed | back to summary |
|---|---|
| private static void setRegsUsed(BitSet regsUsed, RegisterSpec rs) Sets the register as used in a bitset, taking into account its category/width.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(SsaBasicBlock
the first object to be compared. b1, SsaBasicBlock the second object to be compared. b2)Implements java. |
| LabelComparator | back to summary |
|---|---|
| public LabelComparator() | |
| compare | back to summary |
|---|---|
| public int compare(SsaBasicBlock b1, SsaBasicBlock b2) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | visitBlock(SsaBasicBlock
non-null; block visitednull-ok; parent node if applicableIndicates a block has been visited by an iterator method. |
| visitBlock | back to summary |
|---|---|
| public void visitBlock(SsaBasicBlock v, SsaBasicBlock parent) Indicates a block has been visited by an iterator method.
| |