diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-27 14:30:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-04 15:22:58 +0100 |
commit | 186f8e2f76dc6995d14e6632d9b9d704198feda2 (patch) | |
tree | 6213cee17297940c46c9ff0a52160a42152d0b4a /src/qml/compiler/qqmltypecompiler.cpp | |
parent | b02bed1caae6966925b9efb04e1db79c3e9ef687 (diff) |
[new compiler] Fix some qqmlincubator tests
We need to track the objects created and pass them over to the VME guard used in the
incubator. The incremental build nature of the incubator requires that to avoid crashes.
For nested incubators we need to set the activeVMEData field in the root QQmlContext, to allow
child incubators to locate the parent.
Lastly we need can emulate most of the VME behavior in terms of build states when running with
QQmlInstantiationInterrupt by presenting four build steps: The initial state, two build steps,
a finalization step and the state when we're done.
Change-Id: I16cd7f71744decb9d4735ec77e9d944fad18e88d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler.cpp')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index 2a8536a065..6dcf15f24e 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -133,9 +133,8 @@ bool QQmlTypeCompiler::compile() // Build property caches and VME meta object data - const int objectCount = parsedQML->objects.count(); - compiledData->datas.reserve(objectCount); - compiledData->propertyCaches.reserve(objectCount); + compiledData->datas.reserve(parsedQML->objects.count()); + compiledData->propertyCaches.reserve(parsedQML->objects.count()); { QQmlPropertyCacheCreator propertyCacheBuilder(this); @@ -244,6 +243,7 @@ bool QQmlTypeCompiler::compile() // Collect some data for instantiation later. int bindingCount = 0; int parserStatusCount = 0; + int objectCount = 0; for (quint32 i = 0; i < qmlUnit->nObjects; ++i) { const QV4::CompiledData::Object *obj = qmlUnit->objectAt(i); bindingCount += obj->nBindings; @@ -255,12 +255,15 @@ bool QQmlTypeCompiler::compile() if (typeRef->component) { bindingCount += typeRef->component->totalBindingsCount; parserStatusCount += typeRef->component->totalParserStatusCount; - } + objectCount += typeRef->component->totalObjectCount; + } else + ++objectCount; } } compiledData->totalBindingsCount = bindingCount; compiledData->totalParserStatusCount = parserStatusCount; + compiledData->totalObjectCount = objectCount; return errors.isEmpty(); } |