aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2013-09-10 10:15:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 12:42:41 +0200
commit565c9b7661768eadf0ea205ed23557d7a31fc56d (patch)
tree9aaa19571374a822bbe1db49b558cb06c2c0c312 /src/qml/compiler/qv4isel_moth.cpp
parent857b135d77221769dadec54daa6540f431245c7a (diff)
V4 interpreter: add hints for unop/binop targets
Change-Id: Ic1230170a89557ad25f0e37261f98819a42a2b47 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 60945aa3b0..a3f159fcf9 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -159,6 +159,8 @@ public:
}
int stackSlotFor(V4IR::Temp *t, V4IR::Stmt *currentStmt) {
+ Q_ASSERT(t->kind == V4IR::Temp::VirtualRegister);
+ Q_ASSERT(t->scope == 0);
int idx = _slotForTemp.value(*t, -1);
if (idx == -1)
idx = allocateSlot(t, currentStmt);
@@ -172,7 +174,7 @@ private:
const V4IR::LifeTimeInterval &interval = _intervals[*t];
int idx = _hints.value(*t, -1);
- if (idx != -1 && _activeSlots[idx] <= currentStmt->id) {
+ if (idx != -1 && _activeSlots[idx] == currentStmt->id) {
_slotForTemp[*t] = idx;
_activeSlots[idx] = interval.end();
return idx;
@@ -497,6 +499,9 @@ void InstructionSelection::swapValues(V4IR::Temp *sourceTemp, V4IR::Temp *target
void InstructionSelection::unop(V4IR::AluOp oper, V4IR::Temp *sourceTemp, V4IR::Temp *targetTemp)
{
+ if (_stackSlotAllocator)
+ _stackSlotAllocator->addHint(*sourceTemp, *targetTemp);
+
QV4::UnaryOpName op = 0;
switch (oper) {
case V4IR::OpIfTrue: assert(!"unreachable"); break;
@@ -560,6 +565,9 @@ Param InstructionSelection::binopHelper(V4IR::AluOp oper, V4IR::Expr *leftSource
//Q_ASSERT(leftSource->asTemp() && rightSource->asTemp());
#endif // USE_TYPE_INFO
+ if (_stackSlotAllocator && target && leftSource->asTemp())
+ _stackSlotAllocator->addHint(*leftSource->asTemp(), *target);
+
if (oper == V4IR::OpInstanceof || oper == V4IR::OpIn || oper == V4IR::OpAdd) {
Instruction::BinopContext binop;
if (oper == V4IR::OpInstanceof)