Improve component boundary detect in new compiler
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 30 Sep 2013 06:38:55 +0000 (08:38 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 30 Sep 2013 16:21:48 +0000 (18:21 +0200)
Instead of going through the property cache and the potential creation
of a dynamic meta object to determine inequality with QQmlComponent::staticMetaObject,
we can simply use the QQmlType and its know metaObject directly to perform
the check. That's faster and more reliably.

Change-Id: If6484b059ec2bed234009755adf2fa3aa19b2b9f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/qqmlobjectcreator.cpp

index 8cc0246..1882d35 100644 (file)
@@ -1430,9 +1430,10 @@ bool QQmlComponentAndAliasResolver::resolve()
         if (stringAt(obj->inheritedTypeNameIndex).isEmpty())
             continue;
 
-        QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.value(i);
-        if (!cache || isComponentType(obj->inheritedTypeNameIndex)
-            || cache->metaObject() != &QQmlComponent::staticMetaObject)
+        QQmlCompiledData::TypeReference tref = resolvedTypes.value(obj->inheritedTypeNameIndex);
+        if (!tref.type)
+            continue;
+        if (tref.type->metaObject() != &QQmlComponent::staticMetaObject)
             continue;
 
         componentRoots.append(i);