aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlcodegenerator.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-11-17 18:07:06 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-28 15:12:06 +0100
commit4bf6969d8a1e17911a076ac470a38a464d7322a2 (patch)
tree5d2209c4d90cef64fac6f77bf3e86307de3f7f21 /src/qml/compiler/qqmlcodegenerator.cpp
parentd72adccd2727d55a8f0adb87cfa9ef22db27ff9e (diff)
Slightly accelerate access to value type properties
We can't do a fast property index based access on them, due to the inability to read individual fields from the original object (i.e. the logic in QQmlValueTypeWrapper). However what we can determine and propagate is the type information of the individual properties, i.e. that the x and y properties of a QPointF are always doubles. Change-Id: Iee71ece2117294b7bc0b93deb0a77d7c51148b11 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlcodegenerator.cpp')
-rw-r--r--src/qml/compiler/qqmlcodegenerator.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp
index 24755ee672..974de72858 100644
--- a/src/qml/compiler/qqmlcodegenerator.cpp
+++ b/src/qml/compiler/qqmlcodegenerator.cpp
@@ -1330,9 +1330,10 @@ QQmlPropertyData *JSCodeGen::lookupQmlCompliantProperty(QQmlPropertyCache *cache
static void initMetaObjectResolver(V4IR::MemberExpressionResolver *resolver, QQmlPropertyCache *metaObject);
enum MetaObjectResolverFlags {
- AllPropertiesAreFinal = 0x1,
- LookupsIncludeEnums = 0x2,
- LookupsExcludeProperties = 0x4
+ AllPropertiesAreFinal = 0x1,
+ LookupsIncludeEnums = 0x2,
+ LookupsExcludeProperties = 0x4,
+ ResolveTypeInformationOnly = 0x8
};
static void initMetaObjectResolver(V4IR::MemberExpressionResolver *resolver, QQmlPropertyCache *metaObject);
@@ -1464,7 +1465,9 @@ static V4IR::Type resolveMetaObjectProperty(QQmlEnginePrivate *qmlEngine, V4IR::
if (isFinalProperty && metaObject->isAllowedInRevision(candidate)) {
property = candidate;
- member->property = candidate; // Cache for next iteration and isel needs it.
+ member->inhibitTypeConversionOnWrite = true;
+ if (!(resolver->flags & ResolveTypeInformationOnly))
+ member->property = candidate; // Cache for next iteration and isel needs it.
}
}
}
@@ -1486,6 +1489,12 @@ static V4IR::Type resolveMetaObjectProperty(QQmlEnginePrivate *qmlEngine, V4IR::
initMetaObjectResolver(resolver, cache);
return V4IR::QObjectType;
}
+ } else if (QQmlValueType *valueType = QQmlValueTypeFactory::valueType(property->propType)) {
+ if (QQmlPropertyCache *cache = qmlEngine->cache(valueType->metaObject())) {
+ initMetaObjectResolver(resolver, cache);
+ resolver->flags |= ResolveTypeInformationOnly;
+ return V4IR::QObjectType;
+ }
}
break;
}