diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-01-22 15:35:51 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-01-23 09:04:42 +0100 |
commit | 9768792381d660e46db58c0c0e0fe9f2f6f9e836 (patch) | |
tree | 2495ebcdd749f11e438f54769c27f8b3fabb1ddf /src/qml/qml/qqmlpropertycachecreator_p.h | |
parent | bbea1b8a3a7742e8abf3e3c1c4a08828ec0f663a (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycachecreator_p.h')
-rw-r--r-- | src/qml/qml/qqmlpropertycachecreator_p.h | 12 |
1 files changed, 6 insertions, 6 deletions
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<ObjectContainer>::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<ObjectContainer>::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<ObjectContainer>::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<ObjectContainer>: 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<ObjectContainer>: } } - 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(); } |