diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-06-03 15:28:51 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-06-04 17:02:55 +0200 |
commit | 11a11d1280b1634628b9c4a92a0fc420ee8a3a81 (patch) | |
tree | b48d9608ef3f08123cdeea605068342131b32b44 /src/qml/compiler | |
parent | 52e07d564b65ed6ce26955a676c7692ad67686c1 (diff) | |
parent | fea26bb2941c3f24c4a5f3ad5efc1b85e0123ff3 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
The merge conflict is about the removal of "d1" from the register
set on ARM, but that was already done in dev in commit ddb33ee9ba9e1344caa9be5dbf4b534c3ede692e
The change in src/quick/scenegraph/coreapi/qsgrenderer.cpp with commit 2414f1675eab163b22dcc4e8ded80ed04d06369b
was reverted to what it was before, per Laszlo's advice.
Conflicts:
src/qml/jit/qv4isel_masm.cpp
Change-Id: I7bce546c5cdee01e37853a476d82279d4e72948b
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler.cpp | 21 | ||||
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 54 |
2 files changed, 47 insertions, 28 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index 45fdab3fd1..3aad050dff 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -1746,10 +1746,21 @@ QString QQmlPropertyValidator::bindingAsString(int objectIndex, const QV4::Compi typedef QVarLengthArray<const QV4::CompiledData::Binding *, 8> GroupPropertyVector; -static bool compareNameIndices(const QV4::CompiledData::Binding *binding, quint32 name) +struct BindingFinder { - return binding->propertyNameIndex < name; -} + bool operator()(quint32 name, const QV4::CompiledData::Binding *binding) const + { + return name < binding->propertyNameIndex; + } + bool operator()(const QV4::CompiledData::Binding *binding, quint32 name) const + { + return binding->propertyNameIndex < name; + } + bool operator()(const QV4::CompiledData::Binding *lhs, const QV4::CompiledData::Binding *rhs) const + { + return lhs->propertyNameIndex < rhs->propertyNameIndex; + } +}; bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledData::Binding *instantiatingBinding, bool populatingValueTypeGroupProperty) { @@ -1797,7 +1808,7 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD return false; } - GroupPropertyVector::const_iterator pos = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, compareNameIndices); + GroupPropertyVector::const_iterator pos = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, BindingFinder()); groupProperties.insert(pos, binding); } @@ -1910,7 +1921,7 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD } if (pd) { - GroupPropertyVector::const_iterator assignedGroupProperty = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, compareNameIndices); + GroupPropertyVector::const_iterator assignedGroupProperty = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, BindingFinder()); const bool assigningToGroupProperty = assignedGroupProperty != groupProperties.constEnd() && !(binding->propertyNameIndex < (*assignedGroupProperty)->propertyNameIndex); if (!pd->isWritable() diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 6ee23690a6..5fb94af140 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -69,6 +69,10 @@ struct Function; struct Lookup; struct RegExp; +#if defined(Q_CC_MSVC) || defined(Q_CC_GNU) +#pragma pack(push, 1) +#endif + struct Location { qint32 line; @@ -82,29 +86,6 @@ struct Location } }; -struct TypeReference -{ - TypeReference(const Location &loc) - : location(loc) - , needsCreation(false) - , errorWhenNotFound(false) - {} - Location location; // first use - bool needsCreation : 1; // whether the type needs to be creatable or not - bool errorWhenNotFound: 1; -}; - -// map from name index to location of first use -struct TypeReferenceMap : QHash<int, TypeReference> -{ - TypeReference &add(int nameIndex, const Location &loc) { - Iterator it = find(nameIndex); - if (it != end()) - return *it; - return *insert(nameIndex, loc); - } -}; - struct RegExp { enum Flags { @@ -553,6 +534,33 @@ struct QmlUnit } }; +#if defined(Q_CC_MSVC) || defined(Q_CC_GNU) +#pragma pack(pop) +#endif + +struct TypeReference +{ + TypeReference(const Location &loc) + : location(loc) + , needsCreation(false) + , errorWhenNotFound(false) + {} + Location location; // first use + bool needsCreation : 1; // whether the type needs to be creatable or not + bool errorWhenNotFound: 1; +}; + +// map from name index to location of first use +struct TypeReferenceMap : QHash<int, TypeReference> +{ + TypeReference &add(int nameIndex, const Location &loc) { + Iterator it = find(nameIndex); + if (it != end()) + return *it; + return *insert(nameIndex, loc); + } +}; + // This is how this hooks into the existing structures: //VM::Function |