diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-04-01 11:00:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-02 14:04:17 +0200 |
commit | c494da09794209d120c8df6b78074c07ad594a15 (patch) | |
tree | dd3c689c102ab05fc3d603ee33bc534a530cec46 /src/qml/compiler/qqmltypecompiler_p.h | |
parent | 4e012093462f07e7ffd42d4061539c54b4f43ace (diff) |
Reduce memory consumption of runtime compiled QML types
Don't store the string of binding scripts in the compiled data. The only
exception to the rule are properties of type QQmlScriptString as well as types
with custom parsers.
Change-Id: I7f53262bf957b442bac4db71d0a2c0bed74a9b54
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 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h index 3b449bf9bd..fb8ac94fcd 100644 --- a/src/qml/compiler/qqmltypecompiler_p.h +++ b/src/qml/compiler/qqmltypecompiler_p.h @@ -105,6 +105,8 @@ public: const QHash<int, QQmlCustomParser*> &customParserCache() const { return customParsers; } + QString bindingAsString(const QmlIR::Object *object, int scriptIndex) const; + private: QList<QQmlError> errors; QQmlEnginePrivate *engine; @@ -195,6 +197,20 @@ private: QHash<int, QQmlCompiledData::TypeReference *> *resolvedTypes; }; +class QQmlCustomParserScriptIndexer: public QQmlCompilePass +{ +public: + QQmlCustomParserScriptIndexer(QQmlTypeCompiler *typeCompiler); + + void annotateBindingsWithScriptStrings(); + +private: + void scanObjectRecursively(int objectIndex, bool annotateScriptBindings = false); + + const QList<QmlIR::Object*> &qmlObjects; + const QHash<int, QQmlCustomParser*> &customParsers; +}; + // Annotate properties bound to aliases with a flag class QQmlAliasAnnotator : public QQmlCompilePass { @@ -267,6 +283,7 @@ public: // Re-implemented for QQmlCustomParser virtual const QQmlImports &imports() const; virtual QQmlBinding::Identifier bindingIdentifier(const QV4::CompiledData::Binding *binding, QQmlCustomParser *parser); + virtual QString bindingAsString(int objectIndex, const QV4::CompiledData::Binding *binding) const; private: bool validateObject(int objectIndex, const QV4::CompiledData::Binding *instantiatingBinding, bool populatingValueTypeGroupProperty = false); |