Package iota
Class NInterval
java.lang.Object
iota.NInterval
Representation of a liveness interval.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given range to this interval.void
addUsePosition
(int lirId, UseType useType) Records whether the LIR instruction with the given id reads or writes to the register bound to this interval.void
firstRangeFrom
(int newStart) Changes the start value of the first range in this interval (if it is not empty) to the given value.boolean
intersects
(NInterval other) Returns true if this interval intersects the other interval, and false otherwise.toString()
Returns a string representation of this interval.
-
Field Details
-
regId
public int regIdId of the register (virtual or physical) that is attached to this interval. -
ranges
The sequence of ranges in this interval. -
usePositions
Maps LIR instruction id to use type (READ or WRITE).
-
-
Constructor Details
-
NInterval
public NInterval(int regId) Constructs an NInterval object.- Parameters:
regId
- id of the register (virtual or physical) that is attached to this interval.
-
-
Method Details
-
firstRangeFrom
public void firstRangeFrom(int newStart) Changes the start value of the first range in this interval (if it is not empty) to the given value.- Parameters:
newStart
- new start value for the first range.
-
addRange
Adds the given range to this interval. If this interval is empty, the given range is simply added to it. Otherwise, if range ends right where the first range begins or if the range intersects with the first range, then the first range's start value is set to that of the given range. Otherwise, the range is added as the new first range of this interval.- Parameters:
range
- the range to add.
-
addUsePosition
Records whether the LIR instruction with the given id reads or writes to the register bound to this interval.- Parameters:
lirId
- instruction id.useType
- READ or WRITE.
-
intersects
Returns true if this interval intersects the other interval, and false otherwise.- Parameters:
other
- the other interval.- Returns:
- true if this interval intersects the other interval, and false otherwise.
-
toString
Returns a string representation of this interval.
-