From 9768792381d660e46db58c0c0e0fe9f2f6f9e836 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Wed, 22 Jan 2020 15:35:51 +0100 Subject: QQmlPropertyData: Save some bits There are some flags which are only used when the type equals FunctionType and respectively some which are only used when the type does not equal FunctionType. By reusing those bits and changing there semantics depending on type, we can grow BitsLeftInFlags by 50%. Change-Id: I7099d6e87826a49aae5f283160c488004ac5b0e1 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlpropertycachecreator_p.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/qml/qml/qqmlpropertycachecreator_p.h') diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h index 1f636c8347..e8178603cf 100644 --- a/src/qml/qml/qqmlpropertycachecreator_p.h +++ b/src/qml/qml/qqmlpropertycachecreator_p.h @@ -428,7 +428,7 @@ inline QQmlJS::DiagnosticMessage QQmlPropertyCacheCreator::crea auto flags = QQmlPropertyData::defaultSignalFlags(); if (paramCount) - flags.hasArguments = true; + flags.setHasArguments(true); QString signalName = stringAt(s->nameIndex); if (seenSignals.contains(signalName)) @@ -457,7 +457,7 @@ inline QQmlJS::DiagnosticMessage QQmlPropertyCacheCreator::crea auto formal = function->formalsBegin(); auto end = function->formalsEnd(); for ( ; formal != end; ++formal) { - flags.hasArguments = true; + flags.setHasArguments(true); parameterNames << stringAt(formal->nameIndex).toUtf8(); int type = metaTypeForParameter(formal->type); if (type == QMetaType::UnknownType) @@ -539,7 +539,7 @@ inline QQmlJS::DiagnosticMessage QQmlPropertyCacheCreator::crea } if (!p->isReadOnly && !p->isList) - propertyFlags.isWritable = true; + propertyFlags.setIsWritable(true); QString propertyName = stringAt(p->nameIndex); @@ -721,7 +721,7 @@ inline QQmlJS::DiagnosticMessage QQmlPropertyCacheAliasCreator: bool writable = false; bool resettable = false; - propertyFlags->isAlias = true; + propertyFlags->setIsAlias(true); if (alias.aliasToLocalAlias) { const QV4::CompiledData::Alias *lastAlias = &alias; @@ -823,8 +823,8 @@ inline QQmlJS::DiagnosticMessage QQmlPropertyCacheAliasCreator: } } - propertyFlags->isWritable = !(alias.flags & QV4::CompiledData::Alias::IsReadOnly) && writable; - propertyFlags->isResettable = resettable; + propertyFlags->setIsWritable(!(alias.flags & QV4::CompiledData::Alias::IsReadOnly) && writable); + propertyFlags->setIsResettable(resettable); return QQmlJS::DiagnosticMessage(); } -- cgit v1.2.3