|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> java.util.TreeSet<LinearScan.BasicInterval> org.jikesrvm.compilers.opt.regalloc.LinearScan.IntervalSet org.jikesrvm.compilers.opt.regalloc.LinearScan.IncreasingEndMappedIntervalSet org.jikesrvm.compilers.opt.regalloc.LinearScan.ActiveSet
static final class LinearScan.ActiveSet
"Active set" for linear scan register allocation. This version is maintained sorted in order of increasing live interval end point.
Field Summary | |
---|---|
private IR |
ir
Governing ir |
(package private) static long |
serialVersionUID
Support for Set serialization |
private SpillCostEstimator |
spillCost
An object to help estimate spill costs |
private boolean |
spilled
Have we spilled anything? |
private LinearScan.SpillLocationManager |
spillManager
Manager of spill locations; |
Fields inherited from class org.jikesrvm.compilers.opt.regalloc.LinearScan.IncreasingEndMappedIntervalSet |
---|
c |
Constructor Summary | |
---|---|
LinearScan.ActiveSet(IR ir,
LinearScan.SpillLocationManager sm)
Default constructor |
Method Summary | |
---|---|
(package private) void |
allocate(LinearScan.BasicInterval newInterval,
LinearScan.CompoundInterval container)
Assign a basic interval to either a register or a spill location. |
private boolean |
allocateNewSymbolicToPhysical(Register symb,
Register p)
Check whether it's ok to allocate symbolic register to a physical register p. |
private boolean |
allocateToPhysical(LinearScan.CompoundInterval i,
Register p)
Check whether it's ok to allocate an interval i to physical register p. |
private boolean |
checkAssignmentIfSpilled(LinearScan.CompoundInterval i,
LinearScan.CompoundInterval spill)
Check whether, if we spilled interval spill, we could then assign interval i to physical register spill.getRegister(). |
(package private) boolean |
currentlyActive(Register r)
Is a particular physical register currently allocated to an interval in the active set? |
(package private) void |
expireOldIntervals(LinearScan.BasicInterval newInterval)
For each new basic interval, we scan the list of active basic intervals in order of increasing end point. |
(package private) Register |
findAvailableRegister(LinearScan.CompoundInterval ci)
try to find a free physical register to allocate to the compound interval. |
(package private) Register |
findAvailableRegister(Register symb)
Try to find a free physical register to allocate to a symbolic register. |
(package private) void |
freeInterval(LinearScan.MappedBasicInterval bi)
Take action when a basic interval becomes inactive |
(package private) LinearScan.BasicInterval |
getBasicInterval(Register r,
Instruction s)
Find the basic interval for register r containing instruction s. |
(package private) LinearScan.CompoundInterval |
getCurrentInterval(Register r)
Given that a physical register r is currently allocated to an interval in the active set, return the interval. |
private Register |
getPhysicalPreference(LinearScan.CompoundInterval ci)
Given the current state of the register allocator, compute the available physical register to which an interval has the highest preference. |
private Register |
getPhysicalPreference(Register r)
Given the current state of the register allocator, compute the available physical register to which a symbolic register has the highest preference. |
private LinearScan.CompoundInterval |
getSpillCandidate(LinearScan.CompoundInterval newInterval)
choose one of the active intervals or the newInterval to spill. |
(package private) boolean |
spilledSomething()
Have we spilled anything? |
private LinearScan.CompoundInterval |
spillMinUnitCost(LinearScan.CompoundInterval newInterval)
Choose the interval with the min unit cost (defined as the number of defs and uses) |
private void |
updatePhysicalInterval(Register p,
LinearScan.BasicInterval i)
Update the interval representing the allocations of a physical register p to include a new interval i |
private void |
updatePhysicalInterval(Register p,
LinearScan.CompoundInterval c,
LinearScan.BasicInterval stop)
Update the interval representing the allocations of a physical register p to include a new compound interval c. |
Methods inherited from class org.jikesrvm.compilers.opt.regalloc.LinearScan.IntervalSet |
---|
toString |
Methods inherited from class java.util.TreeSet |
---|
add, addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, subSet, subSet, tailSet, tailSet |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
static final long serialVersionUID
private final IR ir
private final LinearScan.SpillLocationManager spillManager
private final transient SpillCostEstimator spillCost
private boolean spilled
Constructor Detail |
---|
LinearScan.ActiveSet(IR ir, LinearScan.SpillLocationManager sm)
Method Detail |
---|
boolean spilledSomething()
void expireOldIntervals(LinearScan.BasicInterval newInterval)
newInterval
- the new intervalvoid freeInterval(LinearScan.MappedBasicInterval bi)
void allocate(LinearScan.BasicInterval newInterval, LinearScan.CompoundInterval container)
private void updatePhysicalInterval(Register p, LinearScan.BasicInterval i)
private void updatePhysicalInterval(Register p, LinearScan.CompoundInterval c, LinearScan.BasicInterval stop)
boolean currentlyActive(Register r)
LinearScan.CompoundInterval getCurrentInterval(Register r)
Register findAvailableRegister(LinearScan.CompoundInterval ci)
Register findAvailableRegister(Register symb)
private Register getPhysicalPreference(Register r)
r
- the symbolic register in question.
private Register getPhysicalPreference(LinearScan.CompoundInterval ci)
private boolean allocateToPhysical(LinearScan.CompoundInterval i, Register p)
private boolean allocateNewSymbolicToPhysical(Register symb, Register p)
private LinearScan.CompoundInterval getSpillCandidate(LinearScan.CompoundInterval newInterval)
private LinearScan.CompoundInterval spillMinUnitCost(LinearScan.CompoundInterval newInterval)
private boolean checkAssignmentIfSpilled(LinearScan.CompoundInterval i, LinearScan.CompoundInterval spill)
LinearScan.BasicInterval getBasicInterval(Register r, Instruction s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |