From 186f8e2f76dc6995d14e6632d9b9d704198feda2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 27 Feb 2014 14:30:09 +0100 Subject: [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 --- src/qml/compiler/qqmltypecompiler.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/qml/compiler/qqmltypecompiler.cpp') 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(); } -- cgit v1.2.3