diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-09 10:23:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-21 06:36:47 +0000 |
commit | 3db3c38b1055cc8b41a9aa951c33f5621babb5d0 (patch) | |
tree | 8ba17669737ab0bd06cae7ac8366c5709614c5a0 /src/qml/qml/qqmlobjectcreator_p.h | |
parent | a41dc6147436f3c1c977ff8c04379ff4bde3f0a6 (diff) |
Speed up property binding initialization on object creation
Avoid repeated string hashing and lookups in the property cache in order to
retrieve the property details when initializing literal and script bindings.
Instead we now cache the property data at type validation time, similar to how
the property data was encoded in the VME instructions in the old engine.
Change-Id: I3957c7c4c3e26dfa97c4880b23940a3755ee90e4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator_p.h')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator_p.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index fcf247be5a..60fefe494f 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -94,12 +94,12 @@ private: QObject *createInstance(int index, QObject *parent = 0, bool isContextObject = false); bool populateInstance(int index, QObject *instance, - QObject *bindingTarget, QQmlPropertyData *valueTypeProperty, + QObject *bindingTarget, const QQmlPropertyData *valueTypeProperty, const QBitArray &bindingsToSkip = QBitArray()); void setupBindings(const QBitArray &bindingsToSkip); - bool setPropertyBinding(QQmlPropertyData *property, const QV4::CompiledData::Binding *binding); - void setPropertyValue(QQmlPropertyData *property, const QV4::CompiledData::Binding *binding); + bool setPropertyBinding(const QQmlPropertyData *property, const QV4::CompiledData::Binding *binding); + void setPropertyValue(const QQmlPropertyData *property, const QV4::CompiledData::Binding *binding); void setupFunctions(); QString stringAt(int idx) const { return qmlUnit->stringAt(idx); } @@ -136,7 +136,8 @@ private: QObject *_scopeObject; QObject *_bindingTarget; - QQmlPropertyData *_valueTypeProperty; // belongs to _qobjectForBindings's property cache + const QQmlPropertyData *_valueTypeProperty; // belongs to _qobjectForBindings's property cache + int _compiledObjectIndex; const QV4::CompiledData::Object *_compiledObject; QQmlData *_ddata; QQmlRefPointer<QQmlPropertyCache> _propertyCache; |