QHash<V4IR::Temp, V4IR::LifeTimeInterval> _intervals;
public:
- StackSlotAllocator(const QList<V4IR::LifeTimeInterval> &ranges, int maxTempCount)
+ StackSlotAllocator(const QVector<V4IR::LifeTimeInterval> &ranges, int maxTempCount)
: _activeSlots(maxTempCount)
{
_intervals.reserve(ranges.size());
namespace {
class ResolutionPhase: protected StmtVisitor, protected ExprVisitor {
- QList<LifeTimeInterval> _intervals;
+ QVector<LifeTimeInterval> _intervals;
Function *_function;
RegAllocInfo *_info;
const QHash<V4IR::Temp, int> &_assignedSpillSlots;
QHash<BasicBlock *, QList<LifeTimeInterval> > _liveAtEnd;
public:
- ResolutionPhase(const QList<LifeTimeInterval> &intervals, Function *function, RegAllocInfo *info,
+ ResolutionPhase(const QVector<LifeTimeInterval> &intervals, Function *function, RegAllocInfo *info,
const QHash<V4IR::Temp, int> &assignedSpillSlots,
const QVector<int> &intRegs, const QVector<int> &fpRegs)
: _intervals(intervals)
break;
if (i.temp() == *phi->targetTemp) {
activate(i);
- _intervals.removeAt(it);
+ _intervals.remove(it);
break;
}
}
if (it.end() < position) {
if (!it.isFixedInterval())
_handled += it;
- _active.removeAt(i);
+ _active.remove(i);
} else if (!it.covers(position)) {
_inactive += it;
- _active.removeAt(i);
+ _active.remove(i);
} else {
++i;
}
if (it.end() < position) {
if (!it.isFixedInterval())
_handled += it;
- _inactive.removeAt(i);
+ _inactive.remove(i);
} else if (it.covers(position)) {
if (it.reg() != LifeTimeInterval::Invalid) {
_active += it;
- _inactive.removeAt(i);
+ _inactive.remove(i);
} else {
// although this interval is now active, it has no register allocated (always
// spilled), so leave it in inactive.
return -1;
}
-static inline void insertSorted(QList<LifeTimeInterval> &intervals, const LifeTimeInterval &newInterval)
+static inline void insertSorted(QVector<LifeTimeInterval> &intervals, const LifeTimeInterval &newInterval)
{
for (int i = 0, ei = intervals.size(); i != ei; ++i) {
if (LifeTimeInterval::lessThan(newInterval, intervals.at(i))) {
QVector<LifeTimeInterval> _fixedRegisterRanges, _fixedFPRegisterRanges;
- QList<LifeTimeInterval> _unhandled, _active, _inactive, _handled;
+ QVector<LifeTimeInterval> _unhandled, _active, _inactive, _handled;
QHash<V4IR::Temp, int> _lastAssignedRegister;
QHash<V4IR::Temp, int> _assignedSpillSlots;
QHash<BasicBlock *, LiveRegs> _liveIn;
QHash<Temp, LifeTimeInterval> _intervals;
- QList<LifeTimeInterval> _sortedRanges;
+ QVector<LifeTimeInterval> _sortedRanges;
public:
LifeRanges(Function *function, const QHash<BasicBlock *, BasicBlock *> &startEndLoops)
std::sort(_sortedRanges.begin(), _sortedRanges.end(), LifeTimeInterval::lessThan);
}
- QList<LifeTimeInterval> ranges() const { return _sortedRanges; }
+ QVector<LifeTimeInterval> ranges() const { return _sortedRanges; }
void dump() const
{
}
}
-QList<LifeTimeInterval> Optimizer::lifeRanges() const
+QVector<LifeTimeInterval> Optimizer::lifeRanges() const
{
Q_ASSERT(isInSSA());
bool covers(int position) const { return start <= position && position <= end; }
};
- typedef QList<Range> Ranges;
+ typedef QVector<Range> Ranges;
private:
Temp _temp;
QHash<BasicBlock *, BasicBlock *> loopStartEndBlocks() const { return startEndLoops; }
- QList<LifeTimeInterval> lifeRanges() const;
+ QVector<LifeTimeInterval> lifeRanges() const;
static void showMeTheCode(Function *function);
} // V4IR namespace
} // QQmlJS namespace
+
+
+Q_DECLARE_TYPEINFO(QQmlJS::V4IR::LifeTimeInterval, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlJS::V4IR::LifeTimeInterval::Range, Q_PRIMITIVE_TYPE);
+
QT_END_NAMESPACE
#endif // QV4SSA_P_H