diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-26 16:26:33 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-30 07:16:17 +0000 |
commit | f27d058c11b54b3c5f72d41c25cb00657b49a37b (patch) | |
tree | 9210b7c5f9af1016c495086470582b69fadc9e85 /src/qml/compiler/qqmltypecompiler_p.h | |
parent | 515efdb8a65dc8ba22a56a02ee6d7056f39619cb (diff) |
Centralize deferred binding bit information in CompiledData::Binding
Ultimately the decision which bindings to initialize in a deferred way depends
on the data in the meta-object (deferred property names entry). The hash in
QQmlCompiledData is just caching this information. We are better off storing
this single bit right in the binding itself instead of in a parallel data
structure.
Change-Id: Ib66d3550210af1f882b98b0ba9089391813d69ad
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.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h index 5fbc1d370a..9cdac03896 100644 --- a/src/qml/compiler/qqmltypecompiler_p.h +++ b/src/qml/compiler/qqmltypecompiler_p.h @@ -107,7 +107,6 @@ public: QQmlJS::MemoryPool *memoryPool(); QStringRef newStringRef(const QString &string); const QV4::Compiler::StringTableGenerator *stringPool() const; - void setDeferredBindingsPerObject(const QHash<int, QBitArray> &deferredBindingsPerObject); void setBindingPropertyDataPerObject(const QVector<QV4::CompiledData::BindingPropertyData> &propertyData); const QHash<int, QQmlCustomParser*> &customParserCache() const { return customParsers; } @@ -281,6 +280,22 @@ protected: QQmlPropertyCacheVector propertyCaches; }; +class QQmlDeferredBindingScanner : public QQmlCompilePass +{ +public: + QQmlDeferredBindingScanner(QQmlTypeCompiler *typeCompiler); + + bool scanObject(); + +private: + bool scanObject(int objectIndex); + + QList<QmlIR::Object*> *qmlObjects; + QQmlPropertyCacheVector propertyCaches; + + bool _seenObjectWithId; +}; + class QQmlPropertyValidator : public QQmlCompilePass { Q_DECLARE_TR_FUNCTIONS(QQmlPropertyValidator) @@ -307,8 +322,6 @@ private: QHash<int, QBitArray> *customParserBindingsPerObject; // collected state variables, essentially write-only - mutable QHash<int, QBitArray> _deferredBindingsPerObject; - mutable bool _seenObjectWithId; mutable QVector<QV4::CompiledData::BindingPropertyData> _bindingPropertyDataPerObject; }; |