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

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

public class RegAllocator
extends java.lang.Object

MIPS register allocator.

The register allocation algorithm used here is described in "M Poletto, V Sarkar, Linear scan register allocation, ACM Transactions on Programming Languages and Systems, 1999.10".


构造函数摘要
RegAllocator()
           
 
方法摘要
private static LiveInterval[] computeLiveIntervals(DataFlowGraph dfg, int regVarNo)
          computeLiveIntervals()
private static void computeLiveVariables(DataFlowGraph dfg, int regVarNo)
          computeLiveVariables()
private static void copyBitSet(java.util.BitSet src, java.util.BitSet dest)
           
private static void expireOldIntervals(LiveInterval interval, Active active, RegPool pool)
           
static java.util.ArrayList<AllocateResult> globalRegAlloc(AssemblySequence stmts, int regVarNum)
          Register allocator.
private static java.util.BitSet negBitSet(java.util.BitSet bits)
           
private static void number(DataFlowGraph dfg)
          number() numbers the instructs in depth-start order.
private static RegPool prepareRegPool()
           
private static int spill(LiveInterval interval, Active active, int top)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造函数详细信息

RegAllocator

public RegAllocator()
方法详细信息

globalRegAlloc

public static java.util.ArrayList<AllocateResult> globalRegAlloc(AssemblySequence stmts,
                                                                 int regVarNum)

Register allocator.

参数:
stmts - the statements of the assembly
regVarNum - the number of pseudo register appears in the program
返回:
a list of AllocateResult objects. The n'th (from 0) element is the allocation result of the n'th pseudo register.

number

private static void number(DataFlowGraph dfg)
number() numbers the instructs in depth-start order.


computeLiveVariables

private static void computeLiveVariables(DataFlowGraph dfg,
                                         int regVarNo)
computeLiveVariables()


computeLiveIntervals

private static LiveInterval[] computeLiveIntervals(DataFlowGraph dfg,
                                                   int regVarNo)
computeLiveIntervals()


expireOldIntervals

private static void expireOldIntervals(LiveInterval interval,
                                       Active active,
                                       RegPool pool)

spill

private static int spill(LiveInterval interval,
                         Active active,
                         int top)

copyBitSet

private static void copyBitSet(java.util.BitSet src,
                               java.util.BitSet dest)

negBitSet

private static java.util.BitSet negBitSet(java.util.BitSet bits)

prepareRegPool

private static RegPool prepareRegPool()