aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-01-30 13:15:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-31 10:34:23 +0100
commit445c15c3e52192d64b28a3d22ee4aeedbe715ba0 (patch)
tree3e052e69817f24b7ca38cfdae32553135313c444 /src
parent2d95e67ff4f00260d491255ed0b2af454235a047 (diff)
V4: fix range sorting
When a life-time interval is split from another interval, it has to come before an interval that starts at the same position but is not split. This also means that a means that the all ranges in a split interval are uses, which is important for allocation: all incoming parameters for an operation need to be allocated before allocating a register for the result as the result will only start its life "at the end" of the operation. This patch fixes a problem register allocation is done in a function where register pressure is high (e.g. on platforms that have few registers to start with). Specifically, crypto.js on x86 triggered it. Change-Id: Iee3e5d82a887b8de573dfc23513844143d0c8073 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4ssa.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 44c93df4c9..594c38d109 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -3705,9 +3705,12 @@ void LifeTimeInterval::dump(QTextStream &out) const {
}
bool LifeTimeInterval::lessThan(const LifeTimeInterval &r1, const LifeTimeInterval &r2) {
- if (r1._ranges.first().start == r2._ranges.first().start)
- return r1._ranges.last().end < r2._ranges.last().end;
- else
+ 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;
}