Package jminusminus
Class NNaiveRegisterAllocator
java.lang.Object
jminusminus.NRegisterAllocator
jminusminus.NNaiveRegisterAllocator
Implements a naive register allocation method. Each interval is considered live for the entire
cfg. Intervals are assigned physical registers on a first come basis. When we run out of
registers, we reuse the ones already assigned and spill.
-
Field Summary
Fields inherited from class jminusminus.NRegisterAllocator
cfg
-
Constructor Summary
ConstructorDescriptionConstructs an NNaiveRegisterAllocator object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
The work horse that does the allocation, implemented in the sub-classes of this class.Methods inherited from class jminusminus.NRegisterAllocator
buildIntervals, preprocess, writeLivenessInfoToStdOut
-
Constructor Details
-
NNaiveRegisterAllocator
Constructs an NNaiveRegisterAllocator object.- Parameters:
cfg
- an instance of a control flow graph.
-
-
Method Details
-
allocation
public void allocation()The work horse that does the allocation, implemented in the sub-classes of this class.- Specified by:
allocation
in classNRegisterAllocator
-