aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmltypecompiler_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-05-26 11:17:31 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-05-26 19:58:11 +0000
commit777aac3005feb01aed21df9e135d5470182bc6ce (patch)
treeec4b36e1fca9ffda5b28292ac3f562729791ef3e /src/qml/compiler/qqmltypecompiler_p.h
parent18f96551629346599e0b74c3d093697ef494819a (diff)
Small type compilation data structure cleanup
After the removal of the named object hash tables in the persistent compilation unit data, we can also eliminate them from the temporary internal type compilation structures. We have everything we need in the object naming table in the CompiledData::Object - the only thing missing are the component roots. Change-Id: Ia2a7b3894310cfdb5cfecf1c2a921fb51e2a883b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler_p.h')
-rw-r--r--src/qml/compiler/qqmltypecompiler_p.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h
index 2b84bc7ebe..5fbc1d370a 100644
--- a/src/qml/compiler/qqmltypecompiler_p.h
+++ b/src/qml/compiler/qqmltypecompiler_p.h
@@ -101,8 +101,8 @@ public:
int rootObjectIndex() const;
void setPropertyCaches(const QQmlPropertyCacheVector &caches);
const QQmlPropertyCacheVector &propertyCaches() const;
- QVector<quint32> *namedObjectsInRootScope();
- QHash<int, QVector<quint32> > *namedObjectsPerComponent();
+ void setComponentRoots(const QVector<quint32> &roots) { m_componentRoots = roots; }
+ const QVector<quint32> &componentRoots() const { return m_componentRoots; }
QHash<int, QBitArray> *customParserBindings();
QQmlJS::MemoryPool *memoryPool();
QStringRef newStringRef(const QString &string);
@@ -124,8 +124,7 @@ private:
QHash<int, QQmlCustomParser*> customParsers;
// index in first hash is component index, vector inside contains object indices of objects with id property
- QHash<int, QVector<quint32>> m_namedObjectsPerComponent;
- QVector<quint32> m_namedObjectsInRootScope;
+ QVector<quint32> m_componentRoots;
};
struct QQmlCompilePass
@@ -272,17 +271,14 @@ protected:
const int indexOfRootObject;
// indices of the objects that are actually Component {}
- QVector<int> componentRoots;
+ QVector<quint32> componentRoots;
int _componentIndex;
QHash<int, int> _idToObjectIndex;
- QVector<quint32> *_namedObjectsInScope;
QList<int> _objectsWithAliases;
QHash<int, QQmlCompiledData::TypeReference*> *resolvedTypes;
QQmlPropertyCacheVector propertyCaches;
- QVector<quint32> *namedObjectsInRootScope;
- QHash<int, QVector<quint32>> *namedObjectsPerComponent;
};
class QQmlPropertyValidator : public QQmlCompilePass
@@ -325,7 +321,7 @@ public:
bool generateCodeForComponents();
private:
- bool compileComponent(int componentRoot, const QVector<quint32> &namedObjects);
+ bool compileComponent(int componentRoot);
bool compileJavaScriptCodeInObjectsRecursively(int objectIndex, int scopeObjectIndex);
const QHash<int, QQmlCompiledData::TypeReference*> &resolvedTypes;