diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-02 15:14:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-03 08:52:11 +0200 |
commit | a0a037c4651902f43c686dd92b64c98800c0a3a7 (patch) | |
tree | 1d8a79cf0d5410997331a846148d3e9abb48ae03 /src/qml/compiler/qv4regalloc.cpp | |
parent | b5198ce221c67c9772b3a205fd3823a9c516a9ec (diff) |
Use a QVector instead of a QList
This makes the code go quite a bit faster (saves ~7-8% of the
total amount of instructions executed when running crypto.js
Change-Id: I6b3bd08eca98b45593262e2fc6e0ce5056257e76
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4regalloc.cpp')
-rw-r--r-- | src/qml/compiler/qv4regalloc.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp index 7fd5864af3..58c84add2e 100644 --- a/src/qml/compiler/qv4regalloc.cpp +++ b/src/qml/compiler/qv4regalloc.cpp @@ -589,7 +589,7 @@ using namespace QT_PREPEND_NAMESPACE(QQmlJS); namespace { class ResolutionPhase: protected StmtVisitor, protected ExprVisitor { - QList<LifeTimeInterval> _intervals; + QVector<LifeTimeInterval> _intervals; Function *_function; RegAllocInfo *_info; const QHash<V4IR::Temp, int> &_assignedSpillSlots; @@ -605,7 +605,7 @@ class ResolutionPhase: protected StmtVisitor, protected ExprVisitor { 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) @@ -709,7 +709,7 @@ private: break; if (i.temp() == *phi->targetTemp) { activate(i); - _intervals.removeAt(it); + _intervals.remove(it); break; } } @@ -1073,10 +1073,10 @@ void RegisterAllocator::linearScan() 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; } @@ -1088,11 +1088,11 @@ void RegisterAllocator::linearScan() 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. @@ -1380,7 +1380,7 @@ int RegisterAllocator::nextUse(const Temp &t, int startPosition) const 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))) { |