aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/common')
-rw-r--r--src/qml/common/qv4compileddata_p.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h
index 8a89c4ab28..8636fa4fbe 100644
--- a/src/qml/common/qv4compileddata_p.h
+++ b/src/qml/common/qv4compileddata_p.h
@@ -43,7 +43,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 0x3A // Dropped CallElement instruction
+#define QV4_DATA_STRUCTURE_VERSION 0x3B // Add isList flag to method parameters and return types
class QIODevice;
class QQmlTypeNameCache;
@@ -276,9 +276,17 @@ enum class BuiltinType : unsigned int {
struct ParameterType
{
- void set(bool indexIsBuiltinType, quint32 typeNameIndexOrBuiltinType)
+ enum Flag {
+ NoFlag = 0x0,
+ Builtin = 0x1,
+ List = 0x2,
+ };
+ Q_DECLARE_FLAGS(Flags, Flag);
+
+ void set(Flags flags, quint32 typeNameIndexOrBuiltinType)
{
- m_data.set<IndexIsBuiltinTypeField>(indexIsBuiltinType ? 1 : 0);
+ m_data.set<IsListField>(flags.testFlag(List) ? 1 : 0);
+ m_data.set<IndexIsBuiltinTypeField>(flags.testFlag(Builtin) ? 1 : 0);
m_data.set<TypeNameIndexOrBuiltinTypeField>(typeNameIndexOrBuiltinType);
}
@@ -287,6 +295,11 @@ struct ParameterType
return m_data.get<IndexIsBuiltinTypeField>() != 0;
}
+ bool isList() const
+ {
+ return m_data.get<IsListField>() != 0;
+ }
+
quint32 typeNameIndexOrBuiltinType() const
{
return m_data.get<TypeNameIndexOrBuiltinTypeField>();
@@ -294,8 +307,9 @@ struct ParameterType
private:
using IndexIsBuiltinTypeField = quint32_le_bitfield_member<0, 1>;
- using TypeNameIndexOrBuiltinTypeField = quint32_le_bitfield_member<1, 31>;
- quint32_le_bitfield_union<IndexIsBuiltinTypeField, TypeNameIndexOrBuiltinTypeField> m_data;
+ using IsListField = quint32_le_bitfield_member<1, 1>;
+ using TypeNameIndexOrBuiltinTypeField = quint32_le_bitfield_member<2, 30>;
+ quint32_le_bitfield_union<IndexIsBuiltinTypeField, IsListField, TypeNameIndexOrBuiltinTypeField> m_data;
};
static_assert(sizeof(ParameterType) == 4, "ParameterType structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target");
@@ -1642,6 +1656,7 @@ private:
} // CompiledData namespace
} // QV4 namespace
+Q_DECLARE_OPERATORS_FOR_FLAGS(QV4::CompiledData::ParameterType::Flags);
Q_DECLARE_TYPEINFO(QV4::CompiledData::JSClassMember, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE