diff options
Diffstat (limited to 'src/qml/common/qv4compileddata_p.h')
-rw-r--r-- | src/qml/common/qv4compileddata_p.h | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h index 1480df2817..7d6ef14854 100644 --- a/src/qml/common/qv4compileddata_p.h +++ b/src/qml/common/qv4compileddata_p.h @@ -57,6 +57,7 @@ #include <QtCore/qvector.h> #include <QtCore/qstringlist.h> #include <QtCore/qhash.h> +#include <QtCore/qversionnumber.h> #if QT_CONFIG(temporaryfile) #include <QtCore/qsavefile.h> @@ -76,7 +77,7 @@ QT_BEGIN_NAMESPACE // Also change the comment behind the number to describe the latest change. This has the added // benefit that if another patch changes the version too, it will result in a merge conflict, and // not get removed silently. -#define QV4_DATA_STRUCTURE_VERSION 0x28// support inline components +#define QV4_DATA_STRUCTURE_VERSION 0x30// support additional required property features class QIODevice; class QQmlTypeNameCache; @@ -671,6 +672,12 @@ struct Property }; static_assert(sizeof(Property) == 12, "Property structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +struct RequiredPropertyExtraData { + quint32_le nameIndex; +}; + +static_assert (sizeof(RequiredPropertyExtraData) == 4, "RequiredPropertyExtraData structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); + struct Alias { enum Flags : unsigned int { IsReadOnly = 0x1, @@ -741,13 +748,16 @@ struct Object Location locationOfIdProperty; quint32_le offsetToInlineComponents; quint16_le nInlineComponents; + quint32_le offsetToRequiredPropertyExtraData; + quint16_le nRequiredPropertyExtraData; // Function[] // Property[] // Signal[] // Binding[] // InlineComponent[] +// RequiredPropertyExtraData[] - static int calculateSizeExcludingSignalsAndEnums(int nFunctions, int nProperties, int nAliases, int nEnums, int nSignals, int nBindings, int nNamedObjectsInComponent, int nInlineComponents) + static int calculateSizeExcludingSignalsAndEnums(int nFunctions, int nProperties, int nAliases, int nEnums, int nSignals, int nBindings, int nNamedObjectsInComponent, int nInlineComponents, int nRequiredPropertyExtraData) { return ( sizeof(Object) + nFunctions * sizeof(quint32) @@ -758,6 +768,7 @@ struct Object + nBindings * sizeof(Binding) + nNamedObjectsInComponent * sizeof(int) + nInlineComponents * sizeof(InlineComponent) + + nRequiredPropertyExtraData * sizeof(RequiredPropertyExtraData) + 0x7 ) & ~0x7; } @@ -811,6 +822,16 @@ struct Object return reinterpret_cast<const InlineComponent*>(reinterpret_cast<const char *>(this) + offsetToInlineComponents); } + const RequiredPropertyExtraData *requiredPropertyExtraDataAt(int idx) const + { + return requiredPropertyExtraDataTable() + idx; + } + + const RequiredPropertyExtraData *requiredPropertyExtraDataTable() const + { + return reinterpret_cast<const RequiredPropertyExtraData*>(reinterpret_cast<const char *>(this) + offsetToRequiredPropertyExtraData); + } + // --- QQmlPropertyCacheCreator interface int propertyCount() const { return nProperties; } int aliasCount() const { return nAliases; } @@ -839,10 +860,14 @@ struct Object InlineComponentIterator inlineComponentsBegin() const {return InlineComponentIterator(this, 0);} InlineComponentIterator inlineComponentsEnd() const {return InlineComponentIterator(this, nInlineComponents);} + typedef TableIterator<RequiredPropertyExtraData, Object, &Object::requiredPropertyExtraDataAt> RequiredPropertyExtraDataIterator; + RequiredPropertyExtraDataIterator requiredPropertyExtraDataBegin() const {return RequiredPropertyExtraDataIterator(this, 0); }; + RequiredPropertyExtraDataIterator requiredPropertyExtraDataEnd() const {return RequiredPropertyExtraDataIterator(this, nRequiredPropertyExtraData); }; + int namedObjectsInComponentCount() const { return nNamedObjectsInComponent; } // --- }; -static_assert(sizeof(Object) == 76, "Object structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(Object) == 84, "Object structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct Import { @@ -857,14 +882,16 @@ struct Import quint32_le uriIndex; quint32_le qualifierIndex; - qint32_le majorVersion; - qint32_le minorVersion; - Location location; + QTypeRevision version; + quint16_le reserved; - Import() { type = 0; uriIndex = 0; qualifierIndex = 0; majorVersion = 0; minorVersion = 0; } + Import() + { + type = 0; uriIndex = 0; qualifierIndex = 0; version = QTypeRevision::zero(); reserved = 0; + } }; -static_assert(sizeof(Import) == 24, "Import structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(Import) == 20, "Import structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct QmlUnit { |