use of org.graalvm.compiler.lir.alloc.lsra.Interval.UsePosList in project graal by oracle.
the class LinearScanIntervalDumper method printInterval.
private static void printInterval(Interval interval, IntervalVisitor visitor) {
Value hint = interval.locationHint(false) != null ? interval.locationHint(false).operand : null;
AllocatableValue operand = interval.operand;
String type = isRegister(operand) ? "fixed" : operand.getValueKind().getPlatformKind().toString();
visitor.visitIntervalStart(interval.splitParent().operand, operand, interval.location(), hint, type);
// print ranges
Range cur = interval.first();
while (!cur.isEndMarker()) {
visitor.visitRange(cur.from, cur.to);
cur = cur.next;
assert cur != null : "range list not closed with range sentinel";
}
// print use positions
int prev = -1;
UsePosList usePosList = interval.usePosList();
for (int i = usePosList.size() - 1; i >= 0; --i) {
assert prev < usePosList.usePos(i) : "use positions not sorted";
visitor.visitUsePos(usePosList.usePos(i), usePosList.registerPriority(i));
prev = usePosList.usePos(i);
}
visitor.visitIntervalEnd(interval.spillState());
}
Aggregations