class CompoundInterval extends IncreasingStartIntervalSet
The order that this set imposes is inconsistent with equals.
This class is designed for use by a single thread.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
_infrequent
Is this compound interval fully contained in infrequent code?
|
private Register |
reg
The register this compound interval represents or
null
if this interval is not associated with a register (i.e. if it
represents a spill location). |
(package private) static long |
serialVersionUID
Support for Set serialization
|
private SpillLocationInterval |
spillInterval
A spill location assigned for this interval.
|
c| Modifier | Constructor and Description |
|---|---|
(package private) |
CompoundInterval(BasicInterval i,
Register register)
Creates a new compound interval of a single Basic interval.
|
(package private) |
CompoundInterval(int dfnBegin,
int dfnEnd,
Register register)
Creates a new compound interval of a single Basic interval.
|
protected |
CompoundInterval(Register r)
Dangerous constructor: use with care.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addNonIntersectingInterval(CompoundInterval i,
BasicInterval stop)
Merges this interval with another, non-intersecting interval.
|
(package private) BasicInterval |
addRange(RegisterAllocatorState regAllocState,
LiveIntervalElement live,
BasicBlock bb)
Add a new live range to this compound interval.
|
(package private) void |
assign(Register r)
Assign this compound interval to a physical register.
|
(package private) CompoundInterval |
copy(Register r)
Copies the ranges from this interval into a new interval associated
with a register.
|
(package private) CompoundInterval |
copy(Register r,
BasicInterval stop)
Copies the basic intervals up to and including stop into a new interval.
|
(package private) Register |
getAssignment(RegisterAllocatorState regAllocState) |
(package private) BasicInterval |
getBasicInterval(int n) |
(package private) BasicInterval |
getBasicInterval(RegisterAllocatorState dfnNumbers,
Instruction s) |
(package private) int |
getLowerBound() |
(package private) Register |
getRegister() |
(package private) SpillLocationInterval |
getSpillInterval() |
(package private) int |
getUpperBound() |
(package private) SortedSet<BasicInterval> |
headSetInclusive(BasicInterval upperBound)
Computes the headSet() [from java.util.SortedSet] but includes all
elements less than upperBound inclusive.
|
(package private) SortedSet<BasicInterval> |
headSetInclusive(int upperBound)
Computes the headSet() [from java.util.SortedSet] but includes all
elements less than upperBound inclusive.
|
(package private) boolean |
intersects(CompoundInterval i) |
(package private) boolean |
isAssigned(RegisterAllocatorState regAllocState) |
(package private) boolean |
isInfrequent() |
(package private) boolean |
isSpilled(RegisterAllocatorState regAllocState) |
(package private) CompoundInterval |
removeIntervalsAndCache(CompoundInterval other)
Removes some basic intervals from this compound interval, and returns
the intervals actually removed.
|
(package private) void |
setFrequent() |
private boolean |
shouldConcatenate(RegisterAllocatorState regAllocState,
LiveIntervalElement live,
BasicBlock bb)
Should we simply merge the live interval
live into a
previous BasicInterval? |
(package private) void |
spill(SpillLocationManager spillManager,
RegisterAllocatorState regAllocState)
Assign this compound interval to a free spill location.
|
(package private) SortedSet<BasicInterval> |
tailSetInclusive(int lowerBound)
Computes the tailSet() [from java.util.SortedSet] but includes all
elements greater than lowerBound inclusive.
|
String |
toString() |
add, addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSetequals, hashCode, removeAllcontainsAll, retainAll, toArray, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, removeAll, retainAll, toArray, toArrayparallelStream, removeIf, streamstatic final long serialVersionUID
private boolean _infrequent
private final Register reg
null
if this interval is not associated with a register (i.e. if it
represents a spill location).private SpillLocationInterval spillInterval
CompoundInterval(int dfnBegin, int dfnEnd, Register register)
dfnBegin - interval's begindfnEnd - interval's endregister - the register for the compound intervalCompoundInterval(BasicInterval i, Register register)
i - interval providing start and end for the new intervalregister - the register for the compound intervalprotected CompoundInterval(Register r)
Creates a compound interval with a register but doesn't actually add any intervals to the compound interval.
r - a registerfinal void setFrequent()
final boolean isInfrequent()
SpillLocationInterval getSpillInterval()
Register getRegister()
CompoundInterval copy(Register r)
r - the register for the new intervalCompoundInterval copy(Register r, BasicInterval stop)
r - the register for the new intervalstop - the interval to stop atBasicInterval addRange(RegisterAllocatorState regAllocState, LiveIntervalElement live, BasicBlock bb)
regAllocState - depth-first numbers for for instructionslive - the new live rangebb - the basic block for liveprivate boolean shouldConcatenate(RegisterAllocatorState regAllocState, LiveIntervalElement live, BasicBlock bb)
live into a
previous BasicInterval?regAllocState - depth-first numbers for for instructionslive - the live interval being queriedbb - the basic block in which live resides.true if the interval should be concatenated, false
if it should'ntvoid spill(SpillLocationManager spillManager, RegisterAllocatorState regAllocState)
spillManager - governing spill location managerregAllocState - current state of the register allocatorboolean isSpilled(RegisterAllocatorState regAllocState)
void assign(Register r)
r - the register to assign toboolean isAssigned(RegisterAllocatorState regAllocState)
regAllocState - current state of the register allocatortrue if this interval has been assigned to
a physical registerRegister getAssignment(RegisterAllocatorState regAllocState)
regAllocState - current state of the register allocatornull
if none assignedvoid addNonIntersectingInterval(CompoundInterval i, BasicInterval stop)
Precondition: BasicInterval stop is an interval in i. This version will only merge basic intervals up to and including stop into this.
i - a non-intersecting interval for mergingstop - a interval to stop atSortedSet<BasicInterval> headSetInclusive(BasicInterval upperBound)
upperBound - the interval acting as upper boundSortedSet.headSet(Object)SortedSet<BasicInterval> headSetInclusive(int upperBound)
upperBound - the instruction number acting as upper boundSortedSet.headSet(Object)SortedSet<BasicInterval> tailSetInclusive(int lowerBound)
lowerBound - the instruction number acting as lower boundSortedSet.tailSet(Object)CompoundInterval removeIntervalsAndCache(CompoundInterval other)
PRECONDITION: All basic intervals in the other interval that have the
same begin as an interval in this compound interval must have the same
end. For example, for a compound interval [(1,2)(2,3)],
the other interval would be allowed to contain (1,2) and/or
(2,2) but not (1,3).
A violation of the precondition that would have an effect will trigger an assertion failure in assertion-enabled builds.
other - interval to check for intervals that we want to remove
from thisint getLowerBound()
int getUpperBound()
boolean intersects(CompoundInterval i)
BasicInterval getBasicInterval(RegisterAllocatorState dfnNumbers, Instruction s)
dfnNumbers - depth-first numbers for for instructionss - The instruction in questionnull if there is no such intervalBasicInterval getBasicInterval(int n)
n - The DFN of the instruction in questionnull if there is no such intervalpublic String toString()
toString in class IntervalSet