diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-13 09:42:55 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-17 08:10:07 +0100 |
commit | 2b00cb4fc62f64b75c906a9f65cfc2b60ecfcb43 (patch) | |
tree | b9a8f9b9f6c5f552028468a9fdaeefe64ae22754 /src/qml/compiler/qqmltypecompiler_p.h | |
parent | 4005c0e29cea1bbcb35c480866418ba01f019756 (diff) |
[new compiler] Clean up property cache / meta object builder
Move the outter loop into the builder class itself, use a vector instead
of a list (we know that it's a fixed size and we only do indexed access)
Change-Id: I933f0496ea47b3bc7c2bebde7f1a14b4f603b4c3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler_p.h')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler_p.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h index 9f055f4376..7f7adf1c86 100644 --- a/src/qml/compiler/qqmltypecompiler_p.h +++ b/src/qml/compiler/qqmltypecompiler_p.h @@ -84,8 +84,10 @@ struct QQmlTypeCompiler QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes(); QList<QtQml::QmlObject*> *qmlObjects(); int rootObjectIndex() const; - const QList<QQmlPropertyCache *> &propertyCaches() const; - QList<QByteArray> *vmeMetaObjects() const; + void setPropertyCaches(const QVector<QQmlPropertyCache *> &caches); + const QVector<QQmlPropertyCache *> &propertyCaches() const; + void setVMEMetaObjects(const QVector<QByteArray> &metaObjects); + QVector<QByteArray> *vmeMetaObjects() const; QHash<int, int> *objectIndexToIdForRoot(); QHash<int, QHash<int, int> > *objectIndexToIdPerComponent(); QHash<int, QByteArray> *customParserData(); @@ -101,6 +103,8 @@ private: struct QQmlCompilePass { + virtual ~QQmlCompilePass() {} + QQmlCompilePass(QQmlTypeCompiler *typeCompiler); QList<QQmlError> errors; @@ -117,13 +121,18 @@ class QQmlPropertyCacheCreator : public QQmlCompilePass Q_DECLARE_TR_FUNCTIONS(QQmlPropertyCacheCreator) public: QQmlPropertyCacheCreator(QQmlTypeCompiler *typeCompiler); + ~QQmlPropertyCacheCreator(); - bool create(const QtQml::QmlObject *obj, QQmlPropertyCache **cache, QByteArray *vmeMetaObjectData); - + bool buildMetaObjects(); protected: + bool createMetaObject(int objectIndex, const QtQml::QmlObject *obj, QQmlPropertyCache *baseTypeCache); + QQmlEnginePrivate *enginePrivate; + const QList<QtQml::QmlObject*> &qmlObjects; const QQmlImports *imports; QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes; + QVector<QByteArray> vmeMetaObjects; + QVector<QQmlPropertyCache*> propertyCaches; }; class QQmlComponentAndAliasResolver : public QQmlCompilePass @@ -157,8 +166,8 @@ protected: QList<int> _objectsWithAliases; QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes; - const QList<QQmlPropertyCache *> propertyCaches; - QList<QByteArray> *vmeMetaObjectData; + const QVector<QQmlPropertyCache *> propertyCaches; + QVector<QByteArray> *vmeMetaObjectData; QHash<int, int> *objectIndexToIdForRoot; QHash<int, QHash<int, int> > *objectIndexToIdPerComponent; }; @@ -178,7 +187,7 @@ private: const QV4::CompiledData::QmlUnit *qmlUnit; const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes; - const QList<QQmlPropertyCache *> &propertyCaches; + const QVector<QQmlPropertyCache *> &propertyCaches; const QHash<int, QHash<int, int> > objectIndexToIdPerComponent; QHash<int, QByteArray> *customParserData; }; |