From 010e3e4f8d4045d3e807d612289886f3d709773c Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 31 Mar 2014 15:43:33 +0200 Subject: 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 --- src/qml/qml/qqmlbinding.cpp | 2 +- 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; -- cgit v1.2.3