| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4arraydata_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||
| 2 | ** | - | ||||||
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||
| 4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||
| 5 | ** | - | ||||||
| 6 | ** This file is part of the QtQml module of the Qt Toolkit. | - | ||||||
| 7 | ** | - | ||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||
| 9 | ** Commercial License Usage | - | ||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||
| 16 | ** | - | ||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
| 19 | ** General Public License version 3 as published by the Free Software | - | ||||||
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||
| 21 | ** packaging of this file. Please review the following information to | - | ||||||
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||
| 24 | ** | - | ||||||
| 25 | ** GNU General Public License Usage | - | ||||||
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||
| 31 | ** included in the packaging of this file. Please review the following | - | ||||||
| 32 | ** information to ensure the GNU General Public License requirements will | - | ||||||
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||
| 35 | ** | - | ||||||
| 36 | ** $QT_END_LICENSE$ | - | ||||||
| 37 | ** | - | ||||||
| 38 | ****************************************************************************/ | - | ||||||
| 39 | #ifndef QV4ARRAYDATA_H | - | ||||||
| 40 | #define QV4ARRAYDATA_H | - | ||||||
| 41 | - | |||||||
| 42 | // | - | ||||||
| 43 | // W A R N I N G | - | ||||||
| 44 | // ------------- | - | ||||||
| 45 | // | - | ||||||
| 46 | // This file is not part of the Qt API. It exists purely as an | - | ||||||
| 47 | // implementation detail. This header file may change from version to | - | ||||||
| 48 | // version without notice, or even be removed. | - | ||||||
| 49 | // | - | ||||||
| 50 | // We mean it. | - | ||||||
| 51 | // | - | ||||||
| 52 | - | |||||||
| 53 | #include "qv4global_p.h" | - | ||||||
| 54 | #include "qv4managed_p.h" | - | ||||||
| 55 | #include "qv4property_p.h" | - | ||||||
| 56 | #include "qv4sparsearray_p.h" | - | ||||||
| 57 | - | |||||||
| 58 | QT_BEGIN_NAMESPACE | - | ||||||
| 59 | - | |||||||
| 60 | namespace QV4 { | - | ||||||
| 61 | - | |||||||
| 62 | #define V4_ARRAYDATA(DataClass) \ | - | ||||||
| 63 | public: \ | - | ||||||
| 64 | Q_MANAGED_CHECK \ | - | ||||||
| 65 | typedef QV4::Heap::DataClass Data; \ | - | ||||||
| 66 | static const QV4::ArrayVTable static_vtbl; \ | - | ||||||
| 67 | static inline const QV4::VTable *staticVTable() { return &static_vtbl.vTable; } \ | - | ||||||
| 68 | V4_MANAGED_SIZE_TEST \ | - | ||||||
| 69 | const Data *d() const { return static_cast<const Data *>(m()); } \ | - | ||||||
| 70 | Data *d() { return static_cast<Data *>(m()); } | - | ||||||
| 71 | - | |||||||
| 72 | - | |||||||
| 73 | struct ArrayData; | - | ||||||
| 74 | - | |||||||
| 75 | struct ArrayVTable | - | ||||||
| 76 | { | - | ||||||
| 77 | VTable vTable; | - | ||||||
| 78 | uint type; | - | ||||||
| 79 | Heap::ArrayData *(*reallocate)(Object *o, uint n, bool enforceAttributes); | - | ||||||
| 80 | ReturnedValue (*get)(const Heap::ArrayData *d, uint index); | - | ||||||
| 81 | bool (*put)(Object *o, uint index, const Value &value); | - | ||||||
| 82 | bool (*putArray)(Object *o, uint index, const Value *values, uint n); | - | ||||||
| 83 | bool (*del)(Object *o, uint index); | - | ||||||
| 84 | void (*setAttribute)(Object *o, uint index, PropertyAttributes attrs); | - | ||||||
| 85 | void (*push_front)(Object *o, const Value *values, uint n); | - | ||||||
| 86 | ReturnedValue (*pop_front)(Object *o); | - | ||||||
| 87 | uint (*truncate)(Object *o, uint newLen); | - | ||||||
| 88 | uint (*length)(const Heap::ArrayData *d); | - | ||||||
| 89 | }; | - | ||||||
| 90 | - | |||||||
| 91 | namespace Heap { | - | ||||||
| 92 | - | |||||||
| 93 | #define ArrayDataMembers(class, Member) \ | - | ||||||
| 94 | Member(class, NoMark, ushort, type) \ | - | ||||||
| 95 | Member(class, NoMark, ushort, unused) \ | - | ||||||
| 96 | Member(class, NoMark, uint, offset) \ | - | ||||||
| 97 | Member(class, NoMark, PropertyAttributes *, attrs) \ | - | ||||||
| 98 | Member(class, NoMark, SparseArray *, sparse) \ | - | ||||||
| 99 | Member(class, ValueArray, ValueArray, values) | - | ||||||
| 100 | - | |||||||
| 101 | DECLARE_HEAP_OBJECT(ArrayData, Base) { | - | ||||||
| 102 | static void markObjects(Heap::Base *base, MarkStack *stack); | - | ||||||
| 103 | - | |||||||
| 104 | enum Type { Simple = 0, Complex = 1, Sparse = 2, Custom = 3 }; | - | ||||||
| 105 | - | |||||||
| 106 | bool isSparse() const { return type == Sparse; } executed 27778575 times by 54 tests: return type == Sparse;Executed by:
| 27778575 | ||||||
| 107 | - | |||||||
| 108 | const ArrayVTable *vtable() const { return reinterpret_cast<const ArrayVTable *>(internalClass->vtable); } executed 114156 times by 30 tests: return reinterpret_cast<const ArrayVTable *>(internalClass->vtable);Executed by:
| 114156 | ||||||
| 109 | - | |||||||
| 110 | inline ReturnedValue get(uint i) const { | - | ||||||
| 111 | return vtable()->get(this, i); executed 79185 times by 17 tests: return vtable()->get(this, i);Executed by:
| 79185 | ||||||
| 112 | } | - | ||||||
| 113 | inline bool getProperty(uint index, Property *p, PropertyAttributes *attrs); | - | ||||||
| 114 | inline void setProperty(EngineBase *e, uint index, const Property *p); | - | ||||||
| 115 | inline PropertyIndex getValueOrSetter(uint index, PropertyAttributes *attrs); | - | ||||||
| 116 | inline PropertyAttributes attributes(uint i) const; | - | ||||||
| 117 | - | |||||||
| 118 | bool isEmpty(uint i) const { | - | ||||||
| 119 | return get(i) == Primitive::emptyValue().asReturnedValue(); executed 8640 times by 1 test: return get(i) == Primitive::emptyValue().asReturnedValue();Executed by:
| 8640 | ||||||
| 120 | } | - | ||||||
| 121 | - | |||||||
| 122 | inline uint length() const { | - | ||||||
| 123 | return vtable()->length(this); executed 230 times by 6 tests: return vtable()->length(this);Executed by:
| 230 | ||||||
| 124 | } | - | ||||||
| 125 | - | |||||||
| 126 | void setArrayData(EngineBase *e, uint index, Value newVal) { | - | ||||||
| 127 | values.set(e, index, newVal); | - | ||||||
| 128 | } executed 6685 times by 2 tests: end of blockExecuted by:
| 6685 | ||||||
| 129 | - | |||||||
| 130 | uint mappedIndex(uint index) const; | - | ||||||
| 131 | }; | - | ||||||
| 132 | Q_STATIC_ASSERT(std::is_trivial< ArrayData >::value); | - | ||||||
| 133 | - | |||||||
| 134 | struct SimpleArrayData : public ArrayData { | - | ||||||
| 135 | uint mappedIndex(uint index) const { index += offset; if (index >= values.alloc) index -= values.alloc; return index; } executed 40016 times by 4 tests: index -= values.alloc;Executed by:
executed 19470931 times by 57 tests: return index;Executed by:
| 40016-19470931 | ||||||
| 136 | const Value &data(uint index) const { return values[mappedIndex(index)]; } executed 18815243 times by 21 tests: return values[mappedIndex(index)];Executed by:
| 18815243 | ||||||
| 137 | void setData(EngineBase *e, uint index, Value newVal) { | - | ||||||
| 138 | values.set(e, mappedIndex(index), newVal); | - | ||||||
| 139 | } executed 297014 times by 39 tests: end of blockExecuted by:
| 297014 | ||||||
| 140 | - | |||||||
| 141 | PropertyAttributes attributes(uint i) const { | - | ||||||
| 142 | return attrs ? attrs[i] : Attr_Data; executed 185693 times by 53 tests: return attrs ? attrs[i] : Attr_Data;Executed by:
| 185693 | ||||||
| 143 | } | - | ||||||
| 144 | }; | - | ||||||
| 145 | Q_STATIC_ASSERT(std::is_trivial< SimpleArrayData >::value); | - | ||||||
| 146 | - | |||||||
| 147 | struct SparseArrayData : public ArrayData { | - | ||||||
| 148 | void destroy() { | - | ||||||
| 149 | delete sparse; | - | ||||||
| 150 | ArrayData::destroy(); | - | ||||||
| 151 | } executed 8425 times by 2 tests: end of blockExecuted by:
| 8425 | ||||||
| 152 | - | |||||||
| 153 | uint mappedIndex(uint index) const { | - | ||||||
| 154 | SparseArrayNode *n = sparse->findNode(index); | - | ||||||
| 155 | if (!n)
| 22522-27367920 | ||||||
| 156 | return UINT_MAX; executed 27367068 times by 2 tests: return (0x7fffffff * 2U + 1U) ;Executed by:
| 27367068 | ||||||
| 157 | return n->value; executed 22532 times by 2 tests: return n->value;Executed by:
| 22532 | ||||||
| 158 | } | - | ||||||
| 159 | - | |||||||
| 160 | PropertyAttributes attributes(uint i) const { | - | ||||||
| 161 | if (!attrs)
| 692-10884 | ||||||
| 162 | return Attr_Data; executed 692 times by 2 tests: return Attr_Data;Executed by:
| 692 | ||||||
| 163 | uint index = mappedIndex(i); | - | ||||||
| 164 | return index < UINT_MAX ? attrs[index] : Attr_Data; executed 10890 times by 1 test: return index < (0x7fffffff * 2U + 1U) ? attrs[index] : Attr_Data;Executed by:
| 10890 | ||||||
| 165 | } | - | ||||||
| 166 | }; | - | ||||||
| 167 | - | |||||||
| 168 | } | - | ||||||
| 169 | - | |||||||
| 170 | struct Q_QML_EXPORT ArrayData : public Managed | - | ||||||
| 171 | { | - | ||||||
| 172 | typedef Heap::ArrayData::Type Type; | - | ||||||
| 173 | V4_MANAGED(ArrayData, Managed) never executed: end of blocknever executed: end of blocknever executed: return &static_vtbl;executed 597434 times by 52 tests: return static_cast<QV4::Heap::ArrayData *>(m());Executed by:
executed 597616 times by 52 tests: return dptr;Executed by:
| 0-597616 | ||||||
| 174 | enum { | - | ||||||
| 175 | IsArrayData = true | - | ||||||
| 176 | }; | - | ||||||
| 177 | - | |||||||
| 178 | uint alloc() const { return d()->values.alloc; } never executed: return d()->values.alloc; | 0 | ||||||
| 179 | uint &alloc() { return d()->values.alloc; } executed 44381 times by 16 tests: return d()->values.alloc;Executed by:
| 44381 | ||||||
| 180 | void setAlloc(uint a) { d()->values.alloc = a; } executed 86708 times by 52 tests: end of blockExecuted by:
| 86708 | ||||||
| 181 | Type type() const { return static_cast<Type>(d()->type); } executed 53897 times by 18 tests: return static_cast<Type>(d()->type);Executed by:
| 53897 | ||||||
| 182 | void setType(Type t) { d()->type = t; } executed 86772 times by 52 tests: end of blockExecuted by:
| 86772 | ||||||
| 183 | PropertyAttributes *attrs() const { return d()->attrs; } executed 59232 times by 16 tests: return d()->attrs;Executed by:
| 59232 | ||||||
| 184 | void setAttrs(PropertyAttributes *a) { d()->attrs = a; } executed 86801 times by 52 tests: end of blockExecuted by:
| 86801 | ||||||
| 185 | const Value *arrayData() const { return d()->values.data(); } never executed: return d()->values.data(); | 0 | ||||||
| 186 | void setArrayData(EngineBase *e, uint index, Value newVal) { | - | ||||||
| 187 | d()->setArrayData(e, index, newVal); | - | ||||||
| 188 | } never executed: end of block | 0 | ||||||
| 189 | - | |||||||
| 190 | const ArrayVTable *vtable() const { return d()->vtable(); } executed 2417 times by 8 tests: return d()->vtable();Executed by:
| 2417 | ||||||
| 191 | bool isSparse() const { return type() == Heap::ArrayData::Sparse; } executed 116 times by 2 tests: return type() == Heap::ArrayData::Sparse;Executed by:
| 116 | ||||||
| 192 | - | |||||||
| 193 | uint length() const { | - | ||||||
| 194 | return d()->length(); executed 184 times by 6 tests: return d()->length();Executed by:
| 184 | ||||||
| 195 | } | - | ||||||
| 196 | - | |||||||
| 197 | bool hasAttributes() const { | - | ||||||
| 198 | return attrs(); never executed: return attrs(); | 0 | ||||||
| 199 | } | - | ||||||
| 200 | PropertyAttributes attributes(uint i) const { | - | ||||||
| 201 | return d()->attributes(i); never executed: return d()->attributes(i); | 0 | ||||||
| 202 | } | - | ||||||
| 203 | - | |||||||
| 204 | bool isEmpty(uint i) const { | - | ||||||
| 205 | return d()->isEmpty(i); never executed: return d()->isEmpty(i); | 0 | ||||||
| 206 | } | - | ||||||
| 207 | - | |||||||
| 208 | ReturnedValue get(uint i) const { | - | ||||||
| 209 | return d()->get(i); never executed: return d()->get(i); | 0 | ||||||
| 210 | } | - | ||||||
| 211 | - | |||||||
| 212 | static void ensureAttributes(Object *o); | - | ||||||
| 213 | static void realloc(Object *o, Type newType, uint alloc, bool enforceAttributes); | - | ||||||
| 214 | - | |||||||
| 215 | static void sort(ExecutionEngine *engine, Object *thisObject, const Value &comparefn, uint dataLen); | - | ||||||
| 216 | static uint append(Object *obj, ArrayObject *otherObj, uint n); | - | ||||||
| 217 | static void insert(Object *o, uint index, const Value *v, bool isAccessor = false); | - | ||||||
| 218 | }; | - | ||||||
| 219 | - | |||||||
| 220 | struct Q_QML_EXPORT SimpleArrayData : public ArrayData | - | ||||||
| 221 | { | - | ||||||
| 222 | V4_ARRAYDATA(SimpleArrayData) never executed: end of blocknever executed: end of blockexecuted 220538 times by 154 tests: return &static_vtbl.vTable;Executed by:
never executed: return static_cast<const Data *>(m());never executed: return static_cast<Data *>(m()); | 0-220538 | ||||||
| 223 | V4_INTERNALCLASS(SimpleArrayData) executed 121476 times by 64 tests: return e->internalClasses(QV4::EngineBase::Class_SimpleArrayData);Executed by:
| 121476 | ||||||
| 224 | - | |||||||
| 225 | uint mappedIndex(uint index) const { return d()->mappedIndex(index); } never executed: return d()->mappedIndex(index); | 0 | ||||||
| 226 | Value data(uint index) const { return d()->data(index); } never executed: return d()->data(index); | 0 | ||||||
| 227 | - | |||||||
| 228 | uint &len() { return d()->values.size; } never executed: return d()->values.size; | 0 | ||||||
| 229 | uint len() const { return d()->values.size; } never executed: return d()->values.size; | 0 | ||||||
| 230 | - | |||||||
| 231 | static Heap::ArrayData *reallocate(Object *o, uint n, bool enforceAttributes); | - | ||||||
| 232 | - | |||||||
| 233 | static ReturnedValue get(const Heap::ArrayData *d, uint index); | - | ||||||
| 234 | static bool put(Object *o, uint index, const Value &value); | - | ||||||
| 235 | static bool putArray(Object *o, uint index, const Value *values, uint n); | - | ||||||
| 236 | static bool del(Object *o, uint index); | - | ||||||
| 237 | static void setAttribute(Object *o, uint index, PropertyAttributes attrs); | - | ||||||
| 238 | static void push_front(Object *o, const Value *values, uint n); | - | ||||||
| 239 | static ReturnedValue pop_front(Object *o); | - | ||||||
| 240 | static uint truncate(Object *o, uint newLen); | - | ||||||
| 241 | static uint length(const Heap::ArrayData *d); | - | ||||||
| 242 | }; | - | ||||||
| 243 | - | |||||||
| 244 | struct Q_QML_EXPORT SparseArrayData : public ArrayData | - | ||||||
| 245 | { | - | ||||||
| 246 | V4_ARRAYDATA(SparseArrayData) never executed: end of blocknever executed: end of blockexecuted 107450 times by 154 tests: return &static_vtbl.vTable;Executed by:
never executed: return static_cast<const Data *>(m());never executed: return static_cast<Data *>(m()); | 0-107450 | ||||||
| 247 | V4_INTERNALCLASS(SparseArrayData) executed 8393 times by 2 tests: return e->internalClasses(QV4::EngineBase::Class_SparseArrayData);Executed by:
| 8393 | ||||||
| 248 | V4_NEEDS_DESTROY executed 8425 times by 2 tests: end of blockExecuted by:
| 8425 | ||||||
| 249 | - | |||||||
| 250 | SparseArray *sparse() const { return d()->sparse; } never executed: return d()->sparse; | 0 | ||||||
| 251 | void setSparse(SparseArray *s) { d()->sparse = s; } never executed: end of block | 0 | ||||||
| 252 | - | |||||||
| 253 | static uint allocate(Object *o, bool doubleSlot = false); | - | ||||||
| 254 | static void free(Heap::ArrayData *d, uint idx); | - | ||||||
| 255 | - | |||||||
| 256 | uint mappedIndex(uint index) const { return d()->mappedIndex(index); } never executed: return d()->mappedIndex(index); | 0 | ||||||
| 257 | - | |||||||
| 258 | static Heap::ArrayData *reallocate(Object *o, uint n, bool enforceAttributes); | - | ||||||
| 259 | static ReturnedValue get(const Heap::ArrayData *d, uint index); | - | ||||||
| 260 | static bool put(Object *o, uint index, const Value &value); | - | ||||||
| 261 | static bool putArray(Object *o, uint index, const Value *values, uint n); | - | ||||||
| 262 | static bool del(Object *o, uint index); | - | ||||||
| 263 | static void setAttribute(Object *o, uint index, PropertyAttributes attrs); | - | ||||||
| 264 | static void push_front(Object *o, const Value *values, uint n); | - | ||||||
| 265 | static ReturnedValue pop_front(Object *o); | - | ||||||
| 266 | static uint truncate(Object *o, uint newLen); | - | ||||||
| 267 | static uint length(const Heap::ArrayData *d); | - | ||||||
| 268 | }; | - | ||||||
| 269 | - | |||||||
| 270 | namespace Heap { | - | ||||||
| 271 | - | |||||||
| 272 | inline uint ArrayData::mappedIndex(uint index) const | - | ||||||
| 273 | { | - | ||||||
| 274 | if (isSparse())
| 236280-27347876 | ||||||
| 275 | return static_cast<const SparseArrayData *>(this)->mappedIndex(index); executed 27348438 times by 2 tests: return static_cast<const SparseArrayData *>(this)->mappedIndex(index);Executed by:
| 27348438 | ||||||
| 276 | if (index >= values.size)
| 37882-198367 | ||||||
| 277 | return UINT_MAX; executed 37883 times by 25 tests: return (0x7fffffff * 2U + 1U) ;Executed by:
| 37883 | ||||||
| 278 | uint idx = static_cast<const SimpleArrayData *>(this)->mappedIndex(index); | - | ||||||
| 279 | return values[idx].isEmpty() ? UINT_MAX : idx; executed 198401 times by 53 tests: return values[idx].isEmpty() ? (0x7fffffff * 2U + 1U) : idx;Executed by:
| 198401 | ||||||
| 280 | } | - | ||||||
| 281 | - | |||||||
| 282 | bool ArrayData::getProperty(uint index, Property *p, PropertyAttributes *attrs) | - | ||||||
| 283 | { | - | ||||||
| 284 | uint mapped = mappedIndex(index); | - | ||||||
| 285 | if (mapped == UINT_MAX) {
| 185065-27389279 | ||||||
| 286 | *attrs = Attr_Invalid; | - | ||||||
| 287 | return false; executed 27378966 times by 5 tests: return false;Executed by:
| 27378966 | ||||||
| 288 | } | - | ||||||
| 289 | - | |||||||
| 290 | *attrs = attributes(index); | - | ||||||
| 291 | if (p) {
| 2479-182660 | ||||||
| 292 | p->value = *(PropertyIndex{ this, values.values + mapped }); | - | ||||||
| 293 | if (attrs->isAccessor())
| 4327-178320 | ||||||
| 294 | p->set = *(PropertyIndex{ this, values.values + mapped + 1 /*Object::SetterOffset*/ }); executed 4330 times by 1 test: p->set = *(PropertyIndex{ this, values.values + mapped + 1 });Executed by:
| 4330 | ||||||
| 295 | } executed 182579 times by 53 tests: end of blockExecuted by:
| 182579 | ||||||
| 296 | return true; executed 185146 times by 53 tests: return true;Executed by:
| 185146 | ||||||
| 297 | } | - | ||||||
| 298 | - | |||||||
| 299 | void ArrayData::setProperty(QV4::EngineBase *e, uint index, const Property *p) | - | ||||||
| 300 | { | - | ||||||
| 301 | uint mapped = mappedIndex(index); | - | ||||||
| 302 | Q_ASSERT(mapped != UINT_MAX); | - | ||||||
| 303 | values.set(e, mapped, p->value); | - | ||||||
| 304 | if (attributes(index).isAccessor())
| 447-808 | ||||||
| 305 | values.set(e, mapped + 1 /*QV4::Object::SetterOffset*/, p->set); executed 809 times by 1 test: values.set(e, mapped + 1 , p->set);Executed by:
| 809 | ||||||
| 306 | } executed 1254 times by 1 test: end of blockExecuted by:
| 1254 | ||||||
| 307 | - | |||||||
| 308 | inline PropertyAttributes ArrayData::attributes(uint i) const | - | ||||||
| 309 | { | - | ||||||
| 310 | if (isSparse())
| 11576-185679 | ||||||
| 311 | return static_cast<const SparseArrayData *>(this)->attributes(i); executed 11578 times by 2 tests: return static_cast<const SparseArrayData *>(this)->attributes(i);Executed by:
| 11578 | ||||||
| 312 | return static_cast<const SimpleArrayData *>(this)->attributes(i); executed 185667 times by 53 tests: return static_cast<const SimpleArrayData *>(this)->attributes(i);Executed by:
| 185667 | ||||||
| 313 | } | - | ||||||
| 314 | - | |||||||
| 315 | PropertyIndex ArrayData::getValueOrSetter(uint index, PropertyAttributes *attrs) | - | ||||||
| 316 | { | - | ||||||
| 317 | uint idx = mappedIndex(index); | - | ||||||
| 318 | if (idx == UINT_MAX) {
| 2736-29717 | ||||||
| 319 | *attrs = Attr_Invalid; | - | ||||||
| 320 | return { nullptr, nullptr }; executed 29717 times by 25 tests: return { nullptr, nullptr };Executed by:
| 29717 | ||||||
| 321 | } | - | ||||||
| 322 | - | |||||||
| 323 | *attrs = attributes(index); | - | ||||||
| 324 | if (attrs->isAccessor())
| 602-2131 | ||||||
| 325 | ++idx; executed 602 times by 1 test: ++idx;Executed by:
| 602 | ||||||
| 326 | return { this, values.values + idx }; executed 2732 times by 2 tests: return { this, values.values + idx };Executed by:
| 2732 | ||||||
| 327 | } | - | ||||||
| 328 | - | |||||||
| 329 | - | |||||||
| 330 | - | |||||||
| 331 | } | - | ||||||
| 332 | - | |||||||
| 333 | } | - | ||||||
| 334 | - | |||||||
| 335 | QT_END_NAMESPACE | - | ||||||
| 336 | - | |||||||
| 337 | #endif | - | ||||||
| Source code | Switch to Preprocessed file |