coins.backend.cfg
Class BasicBlk

java.lang.Object
  extended bycoins.backend.cfg.BasicBlk

public class BasicBlk
extends java.lang.Object

Represent basic block, a sequence of LIR instructions without intervening JUMPs.


Field Summary
(package private)  int dfn
          DFST Reverse postorder number
(package private)  int dfnPre
          DFST Preorder number
 FlowGraph flowGraph
          FlowGraph owning this block.
 int id
          Identifier of this block.
(package private)  BasicBlk parent
          Parent node in the DFST.
 
Constructor Summary
(package private) BasicBlk(FlowGraph g, int idnum, BiList instr)
          Create basic block with the fragment of instruction list.
 
Method Summary
 void addDummyEdge(BasicBlk toBlk)
          Add an dummy edge from this block to toBlk
 void addEdge(BasicBlk toBlk)
          Add an edge from this block to toBlk
 void clearDummyEdges()
          Remove all dummy edges from this block
 void clearEdges()
          Remove all edges from this block
(package private)  void depthFirstSearch(DfstHook h, BasicBlk from, int[] cpre, int[] crpost)
          Depth First Search
 int dfn()
          Deprecated. use DFST class instead.
 int dfnPre()
          Deprecated. use DFST class instead.
 BiList dummyPredList()
          Return list of dummy predecessors.
 BiList dummySuccList()
          Return list of dummy successors.
 BiList instrList()
          Return instruction list
 boolean isAncestorOf(BasicBlk x)
          Deprecated. use DFST class instead.
 boolean isDescendantOf(BasicBlk x)
          Deprecated. use DFST class instead.
 Label label()
          Return label of this block
 void maintEdges()
          Maintain edges from this block.
 BasicBlk parent()
          Deprecated. use DFST class instead.
 BiList predList()
          Return list of predecessors
 void printIt(java.io.PrintWriter output)
          Print this block
 void printIt(java.io.PrintWriter output, LocalAnalysis[] anals)
          Print this block with callback
 void printStandardForm(java.io.PrintWriter output, java.lang.String indent)
          Print this block in standard form
 void removeDummyEdge(BasicBlk toBlk)
          Remove the dummy edge from this block to toBlk
 void removeEdge(BasicBlk toBlk)
          Remove the edge from this block to toBlk
 void replaceSucc(BasicBlk x, BasicBlk y)
          Change successor x to y.
 void setInstrList(BiList list)
          Replace instruction list
 void setLabel(Label l)
          Replace label
 BiList succList()
          Return list of successors
 java.lang.Object toSexp()
          Convert to external LIR format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flowGraph

public final FlowGraph flowGraph
FlowGraph owning this block.


id

public final int id
Identifier of this block.


dfn

int dfn
DFST Reverse postorder number


dfnPre

int dfnPre
DFST Preorder number


parent

BasicBlk parent
Parent node in the DFST.

Constructor Detail

BasicBlk

BasicBlk(FlowGraph g,
         int idnum,
         BiList instr)
Create basic block with the fragment of instruction list. Called only by FlowGraph.

Method Detail

instrList

public BiList instrList()
Return instruction list


setInstrList

public void setInstrList(BiList list)
Replace instruction list


label

public Label label()
Return label of this block


setLabel

public void setLabel(Label l)
Replace label


succList

public BiList succList()
Return list of successors


predList

public BiList predList()
Return list of predecessors


dummySuccList

public BiList dummySuccList()
Return list of dummy successors.


dummyPredList

public BiList dummyPredList()
Return list of dummy predecessors.


dfn

public int dfn()
Deprecated. use DFST class instead.


dfnPre

public int dfnPre()
Deprecated. use DFST class instead.


parent

public BasicBlk parent()
Deprecated. use DFST class instead.


isAncestorOf

public boolean isAncestorOf(BasicBlk x)
Deprecated. use DFST class instead.


isDescendantOf

public boolean isDescendantOf(BasicBlk x)
Deprecated. use DFST class instead.


addEdge

public void addEdge(BasicBlk toBlk)
Add an edge from this block to toBlk


removeEdge

public void removeEdge(BasicBlk toBlk)
Remove the edge from this block to toBlk


addDummyEdge

public void addDummyEdge(BasicBlk toBlk)
Add an dummy edge from this block to toBlk


removeDummyEdge

public void removeDummyEdge(BasicBlk toBlk)
Remove the dummy edge from this block to toBlk


clearEdges

public void clearEdges()
Remove all edges from this block


clearDummyEdges

public void clearDummyEdges()
Remove all dummy edges from this block


maintEdges

public void maintEdges()
Maintain edges from this block. Automatically checks JUMP(/C/N) instructions


replaceSucc

public void replaceSucc(BasicBlk x,
                        BasicBlk y)
Change successor x to y. If do not have x, throw Error


depthFirstSearch

void depthFirstSearch(DfstHook h,
                      BasicBlk from,
                      int[] cpre,
                      int[] crpost)
Depth First Search


toSexp

public java.lang.Object toSexp()
Convert to external LIR format.


printStandardForm

public void printStandardForm(java.io.PrintWriter output,
                              java.lang.String indent)
Print this block in standard form


printIt

public void printIt(java.io.PrintWriter output)
Print this block


printIt

public void printIt(java.io.PrintWriter output,
                    LocalAnalysis[] anals)
Print this block with callback