|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.regalloc.ScratchMap
public final class ScratchMap
This class holds information on scratch register usage, needed to adjust GC Maps.
Nested Class Summary | |
---|---|
private static class |
ScratchMap.Interval
Super class of physical and symbolic intervals |
(package private) static class |
ScratchMap.PhysicalInterval
An object that represents an interval where a physical register's contents are evicted so that the physical register can be used as a scratch. |
(package private) static class |
ScratchMap.SymbolicInterval
An object that represents an interval where a symbolic register resides in a scratch register. |
Field Summary | |
---|---|
private static boolean |
DEBUG
|
private HashMap<Instruction,HashSet<Register>> |
dirtyMap
For each GC Point s, a set of symbolic registers that are cached in dirty scratch registers before s. |
private HashMap<Register,ArrayList<ScratchMap.Interval>> |
map
For each register, the set of intervals describing the register. |
private HashMap<Register,ScratchMap.Interval> |
pending
For each register, a pending (incomplete) interval under construction. |
Constructor Summary | |
---|---|
ScratchMap()
|
Method Summary | |
---|---|
(package private) void |
beginScratchInterval(Register r,
Instruction begin)
Begin a new interval of scratch-ness for a physical register. |
(package private) void |
beginSymbolicInterval(Register r,
Register scratch,
Instruction begin)
Begin a new interval of scratch-ness for a symbolic register. |
void |
endScratchInterval(Register r,
Instruction end)
End an interval of scratch-ness for a physical register. |
void |
endSymbolicInterval(Register r,
Instruction end)
End an interval of scratch-ness for a symbolic register. |
private ArrayList<ScratchMap.Interval> |
findOrCreateIntervalSet(Register r)
Find or create the set of intervals corresponding to a register r. |
(package private) Register |
getScratch(Register r,
int n)
If a symbolic register resides in a scratch register at an instruction numbered n, then return the scratch register. |
boolean |
isDirty(Instruction s,
Register r)
At GC point s, is the value of register r cached in a dirty scratch register? |
boolean |
isEmpty()
Is this map empty? |
(package private) boolean |
isScratch(Register r,
int n)
Is the given physical register being used as a scratch register in the given instruction? |
void |
markDirty(Instruction s,
Register symb)
Note that at GC point s, the real value of register symb is cached in a dirty scratch register. |
String |
toString()
Return a String representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private final HashMap<Register,ArrayList<ScratchMap.Interval>> map
private final HashMap<Register,ScratchMap.Interval> pending
private final HashMap<Instruction,HashSet<Register>> dirtyMap
Constructor Detail |
---|
public ScratchMap()
Method Detail |
---|
void beginSymbolicInterval(Register r, Register scratch, Instruction begin)
r
- the symbolic register being moved into scratchscratch
- the physical register being used as a scratchbegin
- the instruction before which the physical register is
vacated.public void endSymbolicInterval(Register r, Instruction end)
r
- the symbolic register being moved into scratchend
- the instruction before which the scratch interval endsvoid beginScratchInterval(Register r, Instruction begin)
r
- the physical register being used as a scratchbegin
- the instruction before which the physical register is
vacated.public void endScratchInterval(Register r, Instruction end)
r
- the physical register being used as a scratchend
- the instruction before which the physical register is
vacated.private ArrayList<ScratchMap.Interval> findOrCreateIntervalSet(Register r)
boolean isScratch(Register r, int n)
r
- a physical registern
- the instruction's number
true
if the register is used as a scratch register
in the instruction, false
otherwiseRegister getScratch(Register r, int n)
public boolean isEmpty()
public void markDirty(Instruction s, Register symb)
public boolean isDirty(Instruction s, Register r)
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |