diff options
Diffstat (limited to 'src/qml/compiler/qv4jsir_p.h')
-rw-r--r-- | src/qml/compiler/qv4jsir_p.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h index eafecae494..94fa65cf71 100644 --- a/src/qml/compiler/qv4jsir_p.h +++ b/src/qml/compiler/qv4jsir_p.h @@ -55,6 +55,7 @@ #include <private/qqmljsastfwd_p.h> #include <private/qflagpointer_p.h> +#include <QtCore/private/qnumeric_p.h> #include <QtCore/QVector> #include <QtCore/QString> #include <QtCore/QBitArray> @@ -1060,7 +1061,32 @@ private: }; // Map from meta property index (existence implies dependency) to notify signal index -typedef QHash<int, int> PropertyDependencyMap; +struct KeyValuePair +{ + quint32 _key; + quint32 _value; + + KeyValuePair(): _key(0), _value(0) {} + KeyValuePair(quint32 key, quint32 value): _key(key), _value(value) {} + + quint32 key() const { return _key; } + quint32 value() const { return _value; } +}; + +class PropertyDependencyMap: public QVarLengthArray<KeyValuePair, 8> +{ +public: + void insert(quint32 key, quint32 value) + { + for (auto it = begin(), eit = end(); it != eit; ++it) { + if (it->_key == key) { + it->_value = value; + return; + } + } + append(KeyValuePair(key, value)); + } +}; // The Function owns (manages), among things, a list of basic-blocks. All the blocks have an index, // which corresponds to the index in the entry/index in the vector in which they are stored. This @@ -1344,7 +1370,7 @@ inline Expr *BasicBlock::CONST(Type type, double value) } else if (type == NullType) { value = 0; } else if (type == UndefinedType) { - value = qQNaN(); + value = qt_qnan(); } e->init(type, value); |