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

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

public class BasicBlock
extends java.lang.Object

Represents the basic block.


字段摘要
private  java.util.BitSet def
           
private  int id
           
private static int idSeed
           
private  java.util.BitSet inLiveVariables
           
private  boolean isCondGoto
           
private  boolean isVisited
           
private  java.util.ArrayList<BasicBlock> nextBlocks
           
private  int number
           
private  java.util.BitSet outLiveVariables
           
private  java.util.ArrayList<BasicBlock> preBlocks
           
private  java.util.ArrayList<AssemblyElement> stmts
           
private  java.util.BitSet use
           
 
构造函数摘要
BasicBlock(int regVarNo)
          Constructor.
 
方法摘要
 java.util.BitSet def()
          Get the def information of this basic block.
 int getID()
          Get the id of this basic block.
 java.util.List<BasicBlock> getNextBlocks()
          Get the list of successors of this basic block in the CFG.
 int getNumber()
          Get the number of this basic block.
 java.util.List<BasicBlock> getPreBlocks()
          Get the list of predecessors of this basic block in the CFG.
 java.util.List<AssemblyElement> getStmts()
          Get the statements in this basic block.
 java.util.BitSet inLiveVariables()
          Get live variables at the entrance of this basic block.
 boolean isCondGoto()
          Indicates whether this basic block contains conditional jump statement.
 boolean isVisited()
          Indicates whether this basic block has been visited.
 java.util.BitSet outLiveVariables()
          Get live variables at the exit of this basic block.
 void setCondGoto(boolean flag)
          Set the conditional jump flag of this basic block.
 void setNumber(int number)
          Set the number of this basic block.
 void setVisited(boolean flag)
          Set the visited flag of this basic block.
 java.lang.String toString()
          Get the string representation of this basic block.
 java.util.BitSet use()
          Get the use information of this basic block.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

preBlocks

private java.util.ArrayList<BasicBlock> preBlocks

nextBlocks

private java.util.ArrayList<BasicBlock> nextBlocks

stmts

private java.util.ArrayList<AssemblyElement> stmts

inLiveVariables

private java.util.BitSet inLiveVariables

outLiveVariables

private java.util.BitSet outLiveVariables

def

private java.util.BitSet def

use

private java.util.BitSet use

id

private int id

idSeed

private static int idSeed

number

private int number

isCondGoto

private boolean isCondGoto

isVisited

private boolean isVisited
构造函数详细信息

BasicBlock

public BasicBlock(int regVarNo)

Constructor.

参数:
regVarNo - the number of the pseudo registers that appear in this basic block.
方法详细信息

getPreBlocks

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

Get the list of predecessors of this basic block in the CFG.

返回:
the list of predecessors of this basic block in the CFG

getNextBlocks

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

Get the list of successors of this basic block in the CFG.

返回:
the list of successors of this basic block in the CFG.

getStmts

public java.util.List<AssemblyElement> getStmts()

Get the statements in this basic block.

返回:
the statements in this basic block.

getID

public int getID()

Get the id of this basic block.

返回:
the id of this basic block.

toString

public java.lang.String toString()

Get the string representation of this basic block.

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

isCondGoto

public boolean isCondGoto()

Indicates whether this basic block contains conditional jump statement.

返回:
true if this basic block contains conditional jump statement.

setCondGoto

public void setCondGoto(boolean flag)

Set the conditional jump flag of this basic block.

参数:
flag - if this basic block contains the conditional jump statement, the flag should be true.

isVisited

public boolean isVisited()

Indicates whether this basic block has been visited.

返回:
true if this basic block has been visited.

setVisited

public void setVisited(boolean flag)

Set the visited flag of this basic block.

参数:
flag - if this basic block has been visited, it should be true.

getNumber

public int getNumber()

Get the number of this basic block. NOTE: it's not the id of this basic block.

The number is used in the linear scan register allocation. See "M Poletto, V Sarkar, Linear scan register allocation, ACM Transactions on Programming Languages and Systems, 1999.10".


setNumber

public void setNumber(int number)

Set the number of this basic block.

参数:
number - the number of this basic block.

inLiveVariables

public java.util.BitSet inLiveVariables()

Get live variables at the entrance of this basic block.

返回:
a bit set. The n'th (from 0) bit is 1 if the n'th pesudo register is live at the entrance of this basic block.

outLiveVariables

public java.util.BitSet outLiveVariables()

Get live variables at the exit of this basic block.

返回:
a bit set. The n'th (from 0) bit is 1 if the n'th pesudo register is live at the exit of this basic block.

def

public java.util.BitSet def()

Get the def information of this basic block.

The definition of def is described in the "Red Dragon Book".

返回:
a bit set. The n'th (from 0) bit is 1 if the n'th pseudo register is defined in this basic block.

use

public java.util.BitSet use()

Get the use information of this basic block.

The definition of use is described in the "Red Dragon Book".

返回:
a bit set. The n'th (from 0) bit is 1 if the n'th pseudo register is used in this basic block.