diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-01-14 12:00:56 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-01-16 12:46:52 +0100 |
commit | 291aea14636a0e779d874a01630524facb1397dd (patch) | |
tree | 044ff4131a9b3f5a3edb00e6a807d0609c04a182 /src/qml/compiler | |
parent | 39f1e0d66dc434e764731fbfed29c8fd98d217aa (diff) | |
parent | 88e87647c3b7d651dba2c8e61f945d47ecdd02c4 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
.qmake.conf
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4debugging.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4functionobject_p.h
src/qml/jsruntime/qv4qobjectwrapper.cpp
src/quick/scenegraph/shaders/visualization.frag
tests/auto/qml/qjsengine/tst_qjsengine.cpp
Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler.cpp | 2 | ||||
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 26 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index c2d123c96f..84e6c76cc4 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -1138,7 +1138,7 @@ bool QQmlEnumTypeResolver::tryQualifiedEnumAssignment(const QmlIR::Object *obj, if (!prop->isWritable() && !(binding->flags & QV4::CompiledData::Binding::InitializerForReadOnlyDeclaration)) COMPILE_EXCEPTION(binding, tr("Invalid property assignment: \"%1\" is a read-only property").arg(stringAt(binding->propertyNameIndex))); - Q_ASSERT(binding->type = QV4::CompiledData::Binding::Type_Script); + Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Script); const QString string = compiler->bindingAsString(obj, binding->value.compiledScriptIndex); if (!string.constData()->isUpper()) return true; diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index d89ea07087..c0a14a5c80 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2543,17 +2543,21 @@ public: } else if (m->source->asConvert()) { break; } else if (Binop *b = m->source->asBinop()) { + bool iterateOnOperands = true; + switch (b->op) { + case OpSub: + case OpMul: case OpAdd: - if (b->left->type & NumberType || b->right->type & NumberType) + if (b->left->type == SInt32Type && b->right->type == SInt32Type) { + iterateOnOperands = false; break; - else + } else { continue; + } case OpBitAnd: case OpBitOr: case OpBitXor: - case OpSub: - case OpMul: case OpLShift: case OpRShift: case OpURShift: @@ -2561,10 +2565,13 @@ public: default: continue; } - if (Temp *lt = b->left->asTemp()) - candidates.append(*lt); - if (Temp *rt = b->right->asTemp()) - candidates.append(*rt); + + if (iterateOnOperands) { + if (Temp *lt = b->left->asTemp()) + candidates.append(*lt); + if (Temp *rt = b->right->asTemp()) + candidates.append(*rt); + } } else if (Unop *u = m->source->asUnop()) { if (u->op == OpCompl || u->op == OpUPlus) { if (Temp *t = u->expr->asTemp()) @@ -4033,8 +4040,7 @@ void optimizeSSA(StatementWorklist &W, DefUses &defUses, DominatorTree &df) default: break; } - if (casted) { - Q_ASSERT(casted->type == SInt32Type); + if (casted && casted->type == SInt32Type) { m->source = casted; W += m; continue; |