summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-06 11:41:21 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-08 18:59:02 +0000
commit64a20f9277f5461640e531a6dc1ca28ae91afa39 (patch)
tree6f4020b49ce8e16231216f05e71264b3225c4312 /src/qml/compiler/qv4codegen.cpp
parentd24da7f9497834f982e5cd6e29ff53b73fbac1a3 (diff)
downloadqtdeclarative-64a20f9277f5461640e531a6dc1ca28ae91afa39.tar.gz
Use the accumulator for the rhs of CmpJmp instructions
Change-Id: Ib7923863a88aacab93b06fa3c75d788fcfc0bf4e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 1ad7e59203..d00e29bc09 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -991,7 +991,7 @@ static QSOperator::Op invert(QSOperator::Op oper)
Codegen::Reference Codegen::jumpBinop(QSOperator::Op oper, Reference &left, Reference &right)
{
left = left.storeOnStack();
- right = right.storeOnStack();
+ right.loadInAccumulator();
const BytecodeGenerator::Label *jumpTarget = _expr.iftrue();
if (_expr.trueBlockFollowsCondition()) {
oper = invert(oper);
@@ -1002,42 +1002,36 @@ Codegen::Reference Codegen::jumpBinop(QSOperator::Op oper, Reference &left, Refe
case QSOperator::Equal: {
Instruction::CmpJmpEq cjump;
cjump.lhs = left.stackSlot();
- cjump.rhs = right.stackSlot();
bytecodeGenerator->addJumpInstruction(cjump).link(*jumpTarget);
break;
}
case QSOperator::NotEqual: {
Instruction::CmpJmpNe cjump;
cjump.lhs = left.stackSlot();
- cjump.rhs = right.stackSlot();
bytecodeGenerator->addJumpInstruction(cjump).link(*jumpTarget);
break;
}
case QSOperator::Gt: {
Instruction::CmpJmpGt cjump;
cjump.lhs = left.stackSlot();
- cjump.rhs = right.stackSlot();
bytecodeGenerator->addJumpInstruction(cjump).link(*jumpTarget);
break;
}
case QSOperator::Ge: {
Instruction::CmpJmpGe cjump;
cjump.lhs = left.stackSlot();
- cjump.rhs = right.stackSlot();
bytecodeGenerator->addJumpInstruction(cjump).link(*jumpTarget);
break;
}
case QSOperator::Lt: {
Instruction::CmpJmpLt cjump;
cjump.lhs = left.stackSlot();
- cjump.rhs = right.stackSlot();
bytecodeGenerator->addJumpInstruction(cjump).link(*jumpTarget);
break;
}
case QSOperator::Le: {
Instruction::CmpJmpLe cjump;
cjump.lhs = left.stackSlot();
- cjump.rhs = right.stackSlot();
bytecodeGenerator->addJumpInstruction(cjump).link(*jumpTarget);
break;
}