diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-31 15:43:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-02 14:04:01 +0200 |
commit | 010e3e4f8d4045d3e807d612289886f3d709773c (patch) | |
tree | 9ffa9286eb5c75ee11abcd26f15cdeda2a0d77fd | |
parent | 59ff5cd1f607eca41d7ef87364a0d6a112dca214 (diff) |
Fix performance regression for bindings from QtQuick state changes
This is a regression from the compiler change. We can and should try to
use the binding as it was compiled in the loader thread for things like
PropertyChanges {
target: foo
width: someExpresion + to + calculate * width;
}
It is already ensured that these expressions are compiled without type
optimizations.
Change-Id: Ib855d8a848fcab2524df008727eab436ac98514e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index e9c48baa86..e958b97f46 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -147,7 +147,7 @@ QQmlBinding::QQmlBinding(const QQmlScriptString &script, QObject *obj, QQmlConte setScopeObject(obj ? obj : scriptPrivate->scope); if (runtimeFunction) { - v4function = QV4::QmlBindingWrapper::createQmlCallableForFunction(ctxtdata, scopeObject(), runtimeFunction); + v4function = QV4::QmlBindingWrapper::createQmlCallableForFunction(engine->v4engine(), ctxtdata, scopeObject(), runtimeFunction); } else { QString code = scriptPrivate->script; v4function = qmlBinding(context(), scopeObject(), code, url, scriptPrivate->lineNumber); diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index ec42a714c9..f73210a7a8 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -275,7 +275,9 @@ QByteArray QQuickPropertyChangesParser::compile(const QV4::CompiledData::QmlUnit QQmlBinding::Identifier id = QQmlBinding::Invalid; switch (binding->type) { case QV4::CompiledData::Binding::Type_Script: - // ### pre-compile binding + id = bindingIdentifier(binding); + // Fall through as we also need the expression string. + // Signal handlers still need to be constructed by string ;( case QV4::CompiledData::Binding::Type_String: var = binding->valueAsString(&qmlUnit->header); break; |