aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4regalloc.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-01-17 16:13:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-24 10:25:46 +0100
commitbeffe565e3511bdd01a967303066a5dce88022f4 (patch)
treebf6005ef972b3dd3dc6e0a3062a7095d22dae571 /src/qml/compiler/qv4regalloc.cpp
parent9262f8f1d66c44bd48080a1ecf961d5e28f455eb (diff)
V4: fix life-time hole check.
This check was incorrect when a jump happened from before (or after) the life-time interval into a life-time hole. Change-Id: Idacf304a96d39f372249a48e18b00891531d9859 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4regalloc.cpp')
-rw-r--r--src/qml/compiler/qv4regalloc.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp
index 048aad8497..b80e5d3ee8 100644
--- a/src/qml/compiler/qv4regalloc.cpp
+++ b/src/qml/compiler/qv4regalloc.cpp
@@ -857,7 +857,6 @@ private:
if (it->end() < successorStart)
continue;
- bool lifeTimeHole = false;
bool isPhiTarget = false;
Expr *moveFrom = 0;
@@ -903,9 +902,7 @@ private:
predIt->temp().type);
} else {
int spillSlot = _assignedSpillSlots.value(predIt->temp(), -1);
- if (spillSlot == -1)
- lifeTimeHole = true;
- else
+ if (spillSlot != -1)
moveFrom = createTemp(Temp::StackSlot, spillSlot, predIt->temp().type);
}
break;
@@ -913,9 +910,11 @@ private:
}
}
if (!moveFrom) {
-#if defined(QT_NO_DEBUG)
- Q_UNUSED(lifeTimeHole);
-#else
+#if !defined(QT_NO_DEBUG)
+ bool lifeTimeHole = false;
+ if (it->ranges().first().start <= successorStart && it->ranges().last().end >= successorStart)
+ lifeTimeHole = !it->covers(successorStart);
+
Q_ASSERT(!_info->isPhiTarget(it->temp()) || it->isSplitFromInterval() || lifeTimeHole);
if (_info->def(it->temp()) != successorStart && !it->isSplitFromInterval()) {
const int successorEnd = successor->statements.last()->id;