edu.ustc.cs.compile.arch.mips.regalloc
类 DataFlowGraph

java.lang.Object
  继承者 edu.ustc.cs.compile.arch.mips.regalloc.DataFlowGraph

public class DataFlowGraph
extends java.lang.Object

Represents the data flow graph.

The method we use to build the DFG is very simple: just one statement one basic block.


字段摘要
private  java.util.ArrayList<BasicBlock> bbs
           
private  BasicBlock end
           
private  BasicBlock start
           
 
构造函数摘要
DataFlowGraph(int regVarNo)
          Constructor.
 
方法摘要
static DataFlowGraph buildDFG(java.util.List<AssemblyElement> assemblyStmts, int startPos, int regVarNo)
          Build the data flow graph from assembly elements.
private static void compress(DataFlowGraph dfg)
          Compress the DFG built by method buildDFG().
 java.util.List<BasicBlock> getBBs()
          Get all basic blocks in this DFG.
 BasicBlock getEndBB()
          Get the end basic block in this DFG.
 BasicBlock getStartBB()
          Get the start basic block in this DFG.
private static boolean isCondGoto(MIPSOpcode opcode)
           
private static boolean isUnCondGoto(MIPSOpcode opcode)
           
 java.lang.String toString()
          Get the string representation of this DFG.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

start

private BasicBlock start

end

private BasicBlock end

bbs

private java.util.ArrayList<BasicBlock> bbs
构造函数详细信息

DataFlowGraph

public DataFlowGraph(int regVarNo)

Constructor.

参数:
regVarNo - the number of pseudo register appears in the DFG.
方法详细信息

buildDFG

public static DataFlowGraph buildDFG(java.util.List<AssemblyElement> assemblyStmts,
                                     int startPos,
                                     int regVarNo)

Build the data flow graph from assembly elements.

参数:
assemblyStmts - a list of assembly elements
startPos - the start position
regVarNo - the number of pseudo register appears in the assembly elements

compress

private static void compress(DataFlowGraph dfg)
Compress the DFG built by method buildDFG().


getStartBB

public BasicBlock getStartBB()

Get the start basic block in this DFG.

返回:
the start basic block

getEndBB

public BasicBlock getEndBB()

Get the end basic block in this DFG.

返回:
the end basic block

getBBs

public java.util.List<BasicBlock> getBBs()

Get all basic blocks in this DFG.

返回:
a list of all basic blocks in this DFG

toString

public java.lang.String toString()

Get the string representation of this DFG.

覆盖:
java.lang.Object 中的 toString
返回:
the string representation of this DFG

isUnCondGoto

private static boolean isUnCondGoto(MIPSOpcode opcode)

isCondGoto

private static boolean isCondGoto(MIPSOpcode opcode)