|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.regalloc.GenericRegisterRestrictions
public abstract class GenericRegisterRestrictions
An instance of this class provides a mapping from symbolic register to a set of restricted registers.
Each architecture will subclass this in a class RegisterRestrictions.
Nested Class Summary | |
---|---|
private static class |
GenericRegisterRestrictions.RestrictedRegisterSet
An instance of this class represents restrictions on physical register assignment. |
Field Summary | |
---|---|
private HashMap<Register,GenericRegisterRestrictions.RestrictedRegisterSet> |
hash
|
private HashSet<Register> |
noSpill
|
protected ArchitectureSpecificOpt.PhysicalRegisterSet |
phys
|
Constructor Summary | |
---|---|
protected |
GenericRegisterRestrictions(ArchitectureSpecificOpt.PhysicalRegisterSet phys)
Default Constructor |
Method Summary | |
---|---|
void |
addArchRestrictions(BasicBlock bb,
ArrayList<LiveIntervalElement> symbolics)
Add architecture-specific register restrictions for a basic block. |
protected void |
addRestriction(Register symb,
Register p)
Record that it is illegal to assign a symbolic register symb to a physical register p |
protected void |
addRestrictions(Register symb,
BitSet set)
Record that it is illegal to assign a symbolic register symb to any of a set of physical registers |
boolean |
allVolatilesForbidden(Register symb)
Is it forbidden to assign symbolic register symb to any volatile register? |
protected boolean |
contains(LiveIntervalElement R,
int n)
Does a live range R contain an instruction with number n? |
(package private) void |
forbidAllVolatiles(Register symb)
Record that it is illegal to assign a symbolic register symb to any volatile physical registers |
(package private) GenericRegisterRestrictions.RestrictedRegisterSet |
getRestrictions(Register symb)
Return the set of restricted physical register for a given symbolic register. |
void |
init(IR ir)
Record all the register restrictions dictated by an IR. |
boolean |
isForbidden(Register symb,
Register phys)
Is it forbidden to assign symbolic register symb to physical register phys? |
abstract boolean |
isForbidden(Register symb,
Register r,
Instruction s)
Is it forbidden to assign symbolic register symb to physical register r in instruction s? |
boolean |
mustNotSpill(Register r)
Is spilling a register forbidden? |
protected void |
noteMustNotSpill(Register r)
Record that the register allocator must not spill a symbolic register. |
private boolean |
overlaps(LiveIntervalElement li1,
LiveIntervalElement li2)
Do two live ranges overlap? |
private void |
processBlock(BasicBlock bb)
Record all the register restrictions dictated by live ranges on a particular basic block. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final HashMap<Register,GenericRegisterRestrictions.RestrictedRegisterSet> hash
private final HashSet<Register> noSpill
protected final ArchitectureSpecificOpt.PhysicalRegisterSet phys
Constructor Detail |
---|
protected GenericRegisterRestrictions(ArchitectureSpecificOpt.PhysicalRegisterSet phys)
Method Detail |
---|
protected final void noteMustNotSpill(Register r)
public final boolean mustNotSpill(Register r)
public final void init(IR ir)
scratch
field.
private void processBlock(BasicBlock bb)
PRECONDITION: the instructions in each basic block are numbered in
increasing order before calling this. The number for each
instruction is stored in its scratch
field.
public void addArchRestrictions(BasicBlock bb, ArrayList<LiveIntervalElement> symbolics)
bb
- the basic blocksymbolics
- the live intervals for symbolic registers on this
blockprotected final boolean contains(LiveIntervalElement R, int n)
PRECONDITION: the instructions in each basic block are numbered in
increasing order before calling this. The number for each
instruction is stored in its scratch
field.
private boolean overlaps(LiveIntervalElement li1, LiveIntervalElement li2)
PRECONDITION: the instructions in each basic block are numbered in
increasing order before calling this. The number for each
instruction is stored in its scratch
field.
final void forbidAllVolatiles(Register symb)
protected final void addRestrictions(Register symb, BitSet set)
protected final void addRestriction(Register symb, Register p)
final GenericRegisterRestrictions.RestrictedRegisterSet getRestrictions(Register symb)
null
if no restrictions.
public final boolean allVolatilesForbidden(Register symb)
true
: yes, all volatiles are forbidden.
false
:maybe, maybe notpublic final boolean isForbidden(Register symb, Register phys)
public abstract boolean isForbidden(Register symb, Register r, Instruction s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |