Package jminusminus
Class NRegisterAllocator
java.lang.Object
jminusminus.NRegisterAllocator
- Direct Known Subclasses:
NGraphRegisterAllocator
,NLinearRegisterAllocator
,NNaiveRegisterAllocator
The abstract base class for a register allocator that maps virtual registers (from LIR code) to
physical registers on the target (MIPS) machine.
-
Field Summary
Modifier and TypeFieldDescriptionprotected NControlFlowGraph
The control flow graph for a method. -
Constructor Summary
ModifierConstructorDescriptionprotected
Constructs an NRegisterAllocator object. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
The work horse that does the allocation, implemented in the sub-classes of this class.protected void
Builds the intervals for a control flow graph.protected void
Preprocesses information needed for naive, linear, and graph register allocation schemes.void
Prints the local and global live sets to standard output.
-
Field Details
-
cfg
The control flow graph for a method.
-
-
Constructor Details
-
NRegisterAllocator
Constructs an NRegisterAllocator object.- Parameters:
cfg
- control flow graph for a method.
-
-
Method Details
-
buildIntervals
protected void buildIntervals()Builds the intervals for a control flow graph. -
preprocess
protected void preprocess()Preprocesses information needed for naive, linear, and graph register allocation schemes. -
allocation
public abstract void allocation()The work horse that does the allocation, implemented in the sub-classes of this class. -
writeLivenessInfoToStdOut
Prints the local and global live sets to standard output.- Parameters:
p
- for pretty printing with indentation.
-