diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-05-11 12:01:41 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 12:52:43 +0200 |
commit | d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 (patch) | |
tree | 65f47e443efa9635a2634880c01dc439817f9566 /src/qml/qml/qqmlcompiler_p.h | |
parent | 0a3ff88f851771e52d119fab90c0254de6950585 (diff) |
Lazily create QMetaObjects
For internal QML built types, creating a metaobject each time is
just wasteful. Additionally, as the property caches were always
created from the intermediate QMetaObject, it was difficult to pass
information directly from the compiler to the property cache.
Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler_p.h')
-rw-r--r-- | src/qml/qml/qqmlcompiler_p.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h index a326344336..c5d319c0f0 100644 --- a/src/qml/qml/qqmlcompiler_p.h +++ b/src/qml/qml/qqmlcompiler_p.h @@ -76,8 +76,7 @@ class QQmlComponent; class QQmlContext; class QQmlContextData; -class Q_AUTOTEST_EXPORT QQmlCompiledData : public QQmlRefCount, - public QQmlCleanup +class Q_AUTOTEST_EXPORT QQmlCompiledData : public QQmlRefCount, public QQmlCleanup { public: QQmlCompiledData(QQmlEngine *engine); @@ -89,6 +88,10 @@ public: QUrl url; QQmlTypeNameCache *importCache; + int metaTypeId; + int listMetaTypeId; + bool isRegisteredWithEngine; + struct TypeReference { TypeReference() @@ -98,7 +101,6 @@ public: QQmlPropertyCache *typePropertyCache; QQmlCompiledData *component; - const QMetaObject *metaObject() const; QQmlPropertyCache *propertyCache() const; QQmlPropertyCache *createPropertyCache(QQmlEngine *); }; @@ -115,8 +117,6 @@ public: QList<V8Program> programs; - const QMetaObject *root; - QAbstractDynamicMetaObject rootData; QQmlPropertyCache *rootPropertyCache; QList<QString> primitives; QList<QByteArray> datas; @@ -161,8 +161,6 @@ private: void dump(QQmlInstruction *, int idx = -1); QQmlCompiledData(const QQmlCompiledData &other); QQmlCompiledData &operator=(const QQmlCompiledData &other); - QByteArray packData; - int pack(const char *, size_t); int indexForString(const QString &); int indexForByteArray(const QByteArray &); @@ -361,20 +359,16 @@ private: QQmlScript::Object *obj, QQmlScript::Value *value, bool *isAssignment); - enum DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation }; + enum DynamicMetaMode { Normal, ForceCreation }; bool mergeDynamicMetaProperties(QQmlScript::Object *obj); bool buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mode); + bool buildDynamicMetaAliases(QQmlScript::Object *obj); bool checkDynamicMeta(QQmlScript::Object *obj); bool buildBinding(QQmlScript::Value *, QQmlScript::Property *prop, const QQmlCompilerTypes::BindingContext &ctxt); bool buildLiteralBinding(QQmlScript::Value *, QQmlScript::Property *prop, const QQmlCompilerTypes::BindingContext &ctxt); bool buildComponentFromRoot(QQmlScript::Object *obj, const QQmlCompilerTypes::BindingContext &); - bool compileAlias(QFastMetaBuilder &, - QByteArray &data, - QQmlScript::Object *obj, - int propIndex, int aliasIndex, - QQmlScript::Object::DynamicProperty &); bool completeComponentBuild(); bool checkValidId(QQmlScript::Value *, const QString &); |