diff options
Diffstat (limited to 'src/qml/compiler/qv4ssa_p.h')
-rw-r--r-- | src/qml/compiler/qv4ssa_p.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4ssa_p.h b/src/qml/compiler/qv4ssa_p.h index 5d4b12e275..3a787f0347 100644 --- a/src/qml/compiler/qv4ssa_p.h +++ b/src/qml/compiler/qv4ssa_p.h @@ -75,7 +75,7 @@ public: bool covers(int position) const { return start <= position && position <= end; } }; - typedef QVector<Range> Ranges; + typedef QVarLengthArray<Range, 4> Ranges; private: Temp _temp; @@ -89,7 +89,7 @@ public: enum { InvalidPosition = -1 }; enum { InvalidRegister = -1 }; - explicit LifeTimeInterval(int rangeCapacity = 2) + explicit LifeTimeInterval(int rangeCapacity = 4) : _end(InvalidPosition) , _reg(InvalidRegister) , _isFixedInterval(0) @@ -146,6 +146,17 @@ public: } }; +inline bool LifeTimeInterval::lessThan(const LifeTimeInterval *r1, const LifeTimeInterval *r2) +{ + if (r1->_ranges.first().start == r2->_ranges.first().start) { + if (r1->isSplitFromInterval() == r2->isSplitFromInterval()) + return r1->_ranges.last().end < r2->_ranges.last().end; + else + return r1->isSplitFromInterval(); + } else + return r1->_ranges.first().start < r2->_ranges.first().start; +} + class LifeTimeIntervals { Q_DISABLE_COPY(LifeTimeIntervals) @@ -379,7 +390,7 @@ protected: _unhandled.removeLast(); } - s->accept(this); + visit(s); } if (IR::Jump *jump = s->asJump()) { @@ -402,7 +413,7 @@ protected: moves.order(); QList<IR::Move *> newMoves = moves.insertMoves(_currentBasicBlock, _function, true); foreach (IR::Move *move, newMoves) - move->accept(this); + visit(move); } } |