Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4dataview.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | using namespace QV4; | - | ||||||||||||||||||
5 | - | |||||||||||||||||||
6 | const QV4::VTable DataViewCtor::static_vtbl = { (std::is_same<DataViewCtor::SuperClass, Object>::value) ? nullptr : &DataViewCtor::SuperClass::static_vtbl, (sizeof(DataViewCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(DataViewCtor::Data) + (DataViewCtor::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(DataViewCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), DataViewCtor::IsExecutionContext, DataViewCtor::IsString, DataViewCtor::IsObject, DataViewCtor::IsFunctionObject, DataViewCtor::IsErrorObject, DataViewCtor::IsArrayData, DataViewCtor::IsStringOrSymbol, DataViewCtor::MyType, { 0, 0, 0, 0 }, "DataViewCtor", DataViewCtor::virtualDestroy, DataViewCtor::Data::markObjects, DataViewCtor::virtualIsEqualTo, DataViewCtor::virtualGet, DataViewCtor::virtualPut, DataViewCtor::virtualDeleteProperty, DataViewCtor::virtualHasProperty, DataViewCtor::virtualGetOwnProperty, DataViewCtor::virtualDefineOwnProperty, DataViewCtor::virtualIsExtensible, DataViewCtor::virtualPreventExtensions, DataViewCtor::virtualGetPrototypeOf, DataViewCtor::virtualSetPrototypeOf, DataViewCtor::virtualGetLength, DataViewCtor::virtualAdvanceIterator, DataViewCtor::virtualInstanceOf, DataViewCtor::virtualCall, DataViewCtor::virtualCallAsConstructor, }; | - | ||||||||||||||||||
7 | const QV4::VTable DataView::static_vtbl = { (std::is_same<DataView::SuperClass, Object>::value) ? nullptr : &DataView::SuperClass::static_vtbl, (sizeof(DataView::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(DataView::Data) + (DataView::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(DataView::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), DataView::IsExecutionContext, DataView::IsString, DataView::IsObject, DataView::IsFunctionObject, DataView::IsErrorObject, DataView::IsArrayData, DataView::IsStringOrSymbol, DataView::MyType, { 0, 0, 0, 0 }, "DataView", DataView::virtualDestroy, DataView::Data::markObjects, DataView::virtualIsEqualTo, DataView::virtualGet, DataView::virtualPut, DataView::virtualDeleteProperty, DataView::virtualHasProperty, DataView::virtualGetOwnProperty, DataView::virtualDefineOwnProperty, DataView::virtualIsExtensible, DataView::virtualPreventExtensions, DataView::virtualGetPrototypeOf, DataView::virtualSetPrototypeOf, DataView::virtualGetLength, DataView::virtualAdvanceIterator, DataView::virtualInstanceOf, DataView::virtualCall, DataView::virtualCallAsConstructor, }; | - | ||||||||||||||||||
8 | - | |||||||||||||||||||
9 | void Heap::DataViewCtor::init(QV4::ExecutionContext *scope) | - | ||||||||||||||||||
10 | { | - | ||||||||||||||||||
11 | Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "DataView")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DataView" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98102 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98102 times by 153 tests: }()));return qstring_literal_temp; Executed by:
| 98102 | ||||||||||||||||||
12 | } executed 99083 times by 153 tests: end of block Executed by:
| 99083 | ||||||||||||||||||
13 | - | |||||||||||||||||||
14 | ReturnedValue DataViewCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) | - | ||||||||||||||||||
15 | { | - | ||||||||||||||||||
16 | Scope scope(f->engine()); | - | ||||||||||||||||||
17 | Scoped<ArrayBuffer> buffer(scope, argc ? argv[0] : Primitive::undefinedValue()); | - | ||||||||||||||||||
18 | if (!buffer
| 52-1415 | ||||||||||||||||||
19 | return executed 52 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError(); Executed by:
executed 52 times by 1 test: return scope.engine->throwTypeError(); Executed by:
| 52 | ||||||||||||||||||
20 | - | |||||||||||||||||||
21 | double bo = argc > 1
| 8-1407 | ||||||||||||||||||
22 | uint byteOffset = (uint)bo; | - | ||||||||||||||||||
23 | uint bufferLength = buffer->d()->data->size; | - | ||||||||||||||||||
24 | double bl = argc < 3
| 20-1149 | ||||||||||||||||||
25 | uint byteLength = (uint)bl; | - | ||||||||||||||||||
26 | if (bo != byteOffset
| 20-1392 | ||||||||||||||||||
27 | return executed 80 times by 1 test: scope.engine->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "DataView: constructor arguments out of range")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DataView: constructor arguments out of range" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn scope.engine->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "DataView: constructor arguments out of range")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DataView: constructor arguments out of range" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); Executed by:
executed 80 times by 1 test: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 80 times by 1 test: }()));return qstring_literal_temp; Executed by:
executed 80 times by 1 test: return scope.engine->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "DataView: constructor arguments out of range")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DataView: constructor arguments out of range" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); Executed by:
| 80 | ||||||||||||||||||
28 | - | |||||||||||||||||||
29 | Scoped<DataView> a(scope, scope.engine->memoryManager->allocate<DataView>()); | - | ||||||||||||||||||
30 | a->d()->buffer.set(scope.engine, buffer->d()); | - | ||||||||||||||||||
31 | a->d()->byteLength = byteLength; | - | ||||||||||||||||||
32 | a->d()->byteOffset = byteOffset; | - | ||||||||||||||||||
33 | return executed 1335 times by 1 test: a.asReturnedValue();return a.asReturnedValue(); Executed by:
executed 1335 times by 1 test: return a.asReturnedValue(); Executed by:
| 1335 | ||||||||||||||||||
34 | } | - | ||||||||||||||||||
35 | - | |||||||||||||||||||
36 | ReturnedValue DataViewCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||
37 | { | - | ||||||||||||||||||
38 | return executed 4 times by 1 test: virtualCallAsConstructor(f, argv, argc, f);return virtualCallAsConstructor(f, argv, argc, f); Executed by:
executed 4 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f); Executed by:
| 4 | ||||||||||||||||||
39 | } | - | ||||||||||||||||||
40 | - | |||||||||||||||||||
41 | void DataViewPrototype::init(ExecutionEngine *engine, Object *ctor) | - | ||||||||||||||||||
42 | { | - | ||||||||||||||||||
43 | Scope scope(engine); | - | ||||||||||||||||||
44 | ScopedObject o(scope); | - | ||||||||||||||||||
45 | ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(3)); | - | ||||||||||||||||||
46 | ctor->defineReadonlyProperty(engine->id_prototype(), (o = this)); | - | ||||||||||||||||||
47 | defineDefaultProperty(engine->id_constructor(), (o = ctor)); | - | ||||||||||||||||||
48 | defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "buffer")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "buffer" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98856 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98856 times by 153 tests: }()), method_get_buffer, nullptr);return qstring_literal_temp; Executed by:
| 98856 | ||||||||||||||||||
49 | defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "byteLength")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "byteLength" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98759 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98759 times by 153 tests: }()), method_get_byteLength, nullptr);return qstring_literal_temp; Executed by:
| 98759 | ||||||||||||||||||
50 | defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "byteOffset")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "byteOffset" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98413 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98413 times by 153 tests: }()), method_get_byteOffset, nullptr);return qstring_literal_temp; Executed by:
| 98413 | ||||||||||||||||||
51 | - | |||||||||||||||||||
52 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getInt8")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getInt8" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98555 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98555 times by 153 tests: }()), method_getChar<signed char>, 1);return qstring_literal_temp; Executed by:
| 98555 | ||||||||||||||||||
53 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getUint8")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getUint8" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98430 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98430 times by 153 tests: }()), method_getChar<unsigned char>, 1);return qstring_literal_temp; Executed by:
| 98430 | ||||||||||||||||||
54 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getInt16")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getInt16" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98750 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98750 times by 153 tests: }()), method_get<short>, 1);return qstring_literal_temp; Executed by:
| 98750 | ||||||||||||||||||
55 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getUint16")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getUint16" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98771 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98771 times by 153 tests: }()), method_get<unsigned short>, 1);return qstring_literal_temp; Executed by:
| 98771 | ||||||||||||||||||
56 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getInt32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getInt32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98898 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98898 times by 153 tests: }()), method_get<int>, 1);return qstring_literal_temp; Executed by:
| 98898 | ||||||||||||||||||
57 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getUint32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getUint32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98555 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98555 times by 153 tests: }()), method_get<unsigned int>, 1);return qstring_literal_temp; Executed by:
| 98555 | ||||||||||||||||||
58 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getFloat32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getFloat32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98823 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98823 times by 153 tests: }()), method_getFloat<float>, 1);return qstring_literal_temp; Executed by:
| 98823 | ||||||||||||||||||
59 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getFloat64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getFloat64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98762 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98762 times by 153 tests: }()), method_getFloat<double>, 1);return qstring_literal_temp; Executed by:
| 98762 | ||||||||||||||||||
60 | - | |||||||||||||||||||
61 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setInt8")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setInt8" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98889 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98889 times by 153 tests: }()), method_setChar<signed char>, 2);return qstring_literal_temp; Executed by:
| 98889 | ||||||||||||||||||
62 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setUint8")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setUint8" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98892 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98892 times by 153 tests: }()), method_setChar<unsigned char>, 2);return qstring_literal_temp; Executed by:
| 98892 | ||||||||||||||||||
63 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setInt16")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setInt16" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98890 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98890 times by 153 tests: }()), method_set<short>, 2);return qstring_literal_temp; Executed by:
| 98890 | ||||||||||||||||||
64 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setUint16")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setUint16" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98826 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98826 times by 153 tests: }()), method_set<unsigned short>, 2);return qstring_literal_temp; Executed by:
| 98826 | ||||||||||||||||||
65 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setInt32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setInt32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98426 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98426 times by 153 tests: }()), method_set<int>, 2);return qstring_literal_temp; Executed by:
| 98426 | ||||||||||||||||||
66 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setUint32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setUint32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98589 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98589 times by 153 tests: }()), method_set<unsigned int>, 2);return qstring_literal_temp; Executed by:
| 98589 | ||||||||||||||||||
67 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setFloat32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setFloat32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98790 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98790 times by 153 tests: }()), method_setFloat<float>, 2);return qstring_literal_temp; Executed by:
| 98790 | ||||||||||||||||||
68 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setFloat64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setFloat64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98798 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98798 times by 153 tests: }()), method_setFloat<double>, 2);return qstring_literal_temp; Executed by:
| 98798 | ||||||||||||||||||
69 | - | |||||||||||||||||||
70 | ScopedString name(scope, engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "DataView")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DataView" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98922 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98922 times by 153 tests: }())));return qstring_literal_temp; Executed by:
| 98922 | ||||||||||||||||||
71 | defineReadonlyConfigurableProperty(scope.engine->symbol_toStringTag(), name); | - | ||||||||||||||||||
72 | - | |||||||||||||||||||
73 | - | |||||||||||||||||||
74 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getUInt8")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getUInt8" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98920 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98920 times by 153 tests: }()), method_getChar<unsigned char>, 1);return qstring_literal_temp; Executed by:
| 98920 | ||||||||||||||||||
75 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getUInt16")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getUInt16" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98972 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98972 times by 153 tests: }()), method_get<unsigned short>, 1);return qstring_literal_temp; Executed by:
| 98972 | ||||||||||||||||||
76 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getUInt32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getUInt32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99042 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 99042 times by 153 tests: }()), method_get<unsigned int>, 1);return qstring_literal_temp; Executed by:
| 99042 | ||||||||||||||||||
77 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setUInt8")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setUInt8" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98917 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98917 times by 153 tests: }()), method_setChar<unsigned char>, 1);return qstring_literal_temp; Executed by:
| 98917 | ||||||||||||||||||
78 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setUInt16")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setUInt16" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98629 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98629 times by 153 tests: }()), method_set<unsigned short>, 1);return qstring_literal_temp; Executed by:
| 98629 | ||||||||||||||||||
79 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setUInt32")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setUInt32" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98984 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98984 times by 153 tests: }()), method_set<unsigned int>, 1);return qstring_literal_temp; Executed by:
| 98984 | ||||||||||||||||||
80 | } executed 98717 times by 153 tests: end of block Executed by:
| 98717 | ||||||||||||||||||
81 | - | |||||||||||||||||||
82 | ReturnedValue DataViewPrototype::method_get_buffer(const FunctionObject *b, const Value *thisObject, const Value *, int) | - | ||||||||||||||||||
83 | { | - | ||||||||||||||||||
84 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
85 | if (!v
| 52-87 | ||||||||||||||||||
86 | return executed 52 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 52 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 52 | ||||||||||||||||||
87 | - | |||||||||||||||||||
88 | return executed 87 times by 1 test: v->d()->buffer->asReturnedValue();return v->d()->buffer->asReturnedValue(); Executed by:
executed 87 times by 1 test: return v->d()->buffer->asReturnedValue(); Executed by:
| 87 | ||||||||||||||||||
89 | } | - | ||||||||||||||||||
90 | - | |||||||||||||||||||
91 | ReturnedValue DataViewPrototype::method_get_byteLength(const FunctionObject *b, const Value *thisObject, const Value *, int) | - | ||||||||||||||||||
92 | { | - | ||||||||||||||||||
93 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
94 | if (!v
| 52-112 | ||||||||||||||||||
95 | return executed 52 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 52 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 52 | ||||||||||||||||||
96 | - | |||||||||||||||||||
97 | return executed 112 times by 1 test: Encode(v->d()->byteLength);return Encode(v->d()->byteLength); Executed by:
executed 112 times by 1 test: return Encode(v->d()->byteLength); Executed by:
| 112 | ||||||||||||||||||
98 | } | - | ||||||||||||||||||
99 | - | |||||||||||||||||||
100 | ReturnedValue DataViewPrototype::method_get_byteOffset(const FunctionObject *b, const Value *thisObject, const Value *, int) | - | ||||||||||||||||||
101 | { | - | ||||||||||||||||||
102 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
103 | if (!v
| 52-115 | ||||||||||||||||||
104 | return executed 52 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 52 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 52 | ||||||||||||||||||
105 | - | |||||||||||||||||||
106 | return executed 116 times by 1 test: Encode(v->d()->byteOffset);return Encode(v->d()->byteOffset); Executed by:
executed 116 times by 1 test: return Encode(v->d()->byteOffset); Executed by:
| 116 | ||||||||||||||||||
107 | } | - | ||||||||||||||||||
108 | - | |||||||||||||||||||
109 | template <typename T> | - | ||||||||||||||||||
110 | ReturnedValue DataViewPrototype::method_getChar(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||
111 | { | - | ||||||||||||||||||
112 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
113 | if (!v
| 0-444 | ||||||||||||||||||
114 | return executed 88 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 88 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 88 | ||||||||||||||||||
115 | double l = argv[0].toNumber(); | - | ||||||||||||||||||
116 | uint idx = (uint)l; | - | ||||||||||||||||||
117 | if (l != idx
| 0-420 | ||||||||||||||||||
118 | return executed 24 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 24 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 24 | ||||||||||||||||||
119 | idx += v->d()->byteOffset; | - | ||||||||||||||||||
120 | - | |||||||||||||||||||
121 | T t = T(v->d()->buffer->data->data()[idx]); | - | ||||||||||||||||||
122 | - | |||||||||||||||||||
123 | return executed 420 times by 1 test: Encode((int)t);return Encode((int)t); Executed by:
executed 420 times by 1 test: return Encode((int)t); Executed by:
| 420 | ||||||||||||||||||
124 | } | - | ||||||||||||||||||
125 | - | |||||||||||||||||||
126 | template <typename T> | - | ||||||||||||||||||
127 | ReturnedValue DataViewPrototype::method_get(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||
128 | { | - | ||||||||||||||||||
129 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
130 | if (!v
| 0-1936 | ||||||||||||||||||
131 | return executed 176 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 176 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 176 | ||||||||||||||||||
132 | double l = argv[0].toNumber(); | - | ||||||||||||||||||
133 | uint idx = (uint)l; | - | ||||||||||||||||||
134 | if (l != idx
| 48-1888 | ||||||||||||||||||
135 | return executed 96 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 96 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 96 | ||||||||||||||||||
136 | idx += v->d()->byteOffset; | - | ||||||||||||||||||
137 | - | |||||||||||||||||||
138 | bool littleEndian = argc < 2
| 656-1184 | ||||||||||||||||||
139 | - | |||||||||||||||||||
140 | T t = littleEndian
| 328-1512 | ||||||||||||||||||
141 | ? qFromLittleEndian<T>((uchar *)v->d()->buffer->data->data() + idx) | - | ||||||||||||||||||
142 | : qFromBigEndian<T>((uchar *)v->d()->buffer->data->data() + idx); | - | ||||||||||||||||||
143 | - | |||||||||||||||||||
144 | return executed 1840 times by 1 test: Encode(t);return Encode(t); Executed by:
executed 1840 times by 1 test: return Encode(t); Executed by:
| 1840 | ||||||||||||||||||
145 | } | - | ||||||||||||||||||
146 | - | |||||||||||||||||||
147 | template <typename T> | - | ||||||||||||||||||
148 | ReturnedValue DataViewPrototype::method_getFloat(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||
149 | { | - | ||||||||||||||||||
150 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
151 | if (!v
| 0-1032 | ||||||||||||||||||
152 | return executed 88 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 88 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 88 | ||||||||||||||||||
153 | double l = argv[0].toNumber(); | - | ||||||||||||||||||
154 | uint idx = (uint)l; | - | ||||||||||||||||||
155 | if (l != idx
| 24-1008 | ||||||||||||||||||
156 | return executed 48 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 48 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 48 | ||||||||||||||||||
157 | idx += v->d()->byteOffset; | - | ||||||||||||||||||
158 | - | |||||||||||||||||||
159 | bool littleEndian = argc < 2
| 376-608 | ||||||||||||||||||
160 | - | |||||||||||||||||||
161 | if (sizeof(T) == 4
| 492 | ||||||||||||||||||
162 | - | |||||||||||||||||||
163 | union { | - | ||||||||||||||||||
164 | uint i; | - | ||||||||||||||||||
165 | float f; | - | ||||||||||||||||||
166 | } u; | - | ||||||||||||||||||
167 | u.i = littleEndian
| 96-396 | ||||||||||||||||||
168 | ? qFromLittleEndian<uint>((uchar *)v->d()->buffer->data->data() + idx) | - | ||||||||||||||||||
169 | : qFromBigEndian<uint>((uchar *)v->d()->buffer->data->data() + idx); | - | ||||||||||||||||||
170 | return executed 492 times by 1 test: Encode(u.f);return Encode(u.f); Executed by:
executed 492 times by 1 test: return Encode(u.f); Executed by:
| 492 | ||||||||||||||||||
171 | } else { | - | ||||||||||||||||||
172 | ((sizeof(T) == 8) ? static_cast<void>(0) : qt_assert("sizeof(T) == 8", __FILE__, 216)); | - | ||||||||||||||||||
173 | union { | - | ||||||||||||||||||
174 | quint64 i; | - | ||||||||||||||||||
175 | double d; | - | ||||||||||||||||||
176 | } u; | - | ||||||||||||||||||
177 | u.i = littleEndian
| 92-400 | ||||||||||||||||||
178 | ? qFromLittleEndian<quint64>((uchar *)v->d()->buffer->data->data() + idx) | - | ||||||||||||||||||
179 | : qFromBigEndian<quint64>((uchar *)v->d()->buffer->data->data() + idx); | - | ||||||||||||||||||
180 | return executed 492 times by 1 test: Encode(u.d);return Encode(u.d); Executed by:
executed 492 times by 1 test: return Encode(u.d); Executed by:
| 492 | ||||||||||||||||||
181 | } | - | ||||||||||||||||||
182 | } | - | ||||||||||||||||||
183 | - | |||||||||||||||||||
184 | template <typename T> | - | ||||||||||||||||||
185 | ReturnedValue DataViewPrototype::method_setChar(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||
186 | { | - | ||||||||||||||||||
187 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
188 | if (!v
| 0-1808 | ||||||||||||||||||
189 | return executed 88 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 88 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 88 | ||||||||||||||||||
190 | double l = argv[0].toNumber(); | - | ||||||||||||||||||
191 | uint idx = (uint)l; | - | ||||||||||||||||||
192 | if (l != idx
| 8-1776 | ||||||||||||||||||
193 | return executed 40 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 40 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 40 | ||||||||||||||||||
194 | idx += v->d()->byteOffset; | - | ||||||||||||||||||
195 | - | |||||||||||||||||||
196 | int val = argc >= 2
| 8-1760 | ||||||||||||||||||
197 | v->d()->buffer->data->data()[idx] = (char)val; | - | ||||||||||||||||||
198 | - | |||||||||||||||||||
199 | return executed 1768 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined(); Executed by:
executed 1768 times by 1 test: return QV4::Encode::undefined(); Executed by:
| 1768 | ||||||||||||||||||
200 | } | - | ||||||||||||||||||
201 | - | |||||||||||||||||||
202 | template <typename T> | - | ||||||||||||||||||
203 | ReturnedValue DataViewPrototype::method_set(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||
204 | { | - | ||||||||||||||||||
205 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
206 | if (!v
| 0-1374 | ||||||||||||||||||
207 | return executed 176 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 176 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 176 | ||||||||||||||||||
208 | double l = argv[0].toNumber(); | - | ||||||||||||||||||
209 | uint idx = (uint)l; | - | ||||||||||||||||||
210 | if (l != idx
| 64-1312 | ||||||||||||||||||
211 | return executed 128 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 128 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 128 | ||||||||||||||||||
212 | idx += v->d()->byteOffset; | - | ||||||||||||||||||
213 | - | |||||||||||||||||||
214 | int val = argc >= 2
| 16-1232 | ||||||||||||||||||
215 | - | |||||||||||||||||||
216 | bool littleEndian = argc < 3
| 368-880 | ||||||||||||||||||
217 | - | |||||||||||||||||||
218 | if (littleEndian
| 160-1088 | ||||||||||||||||||
219 | qToLittleEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx); executed 160 times by 1 test: qToLittleEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx); Executed by:
| 160 | ||||||||||||||||||
220 | else | - | ||||||||||||||||||
221 | qToBigEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx); executed 1088 times by 1 test: qToBigEndian<T>(val, (uchar *)v->d()->buffer->data->data() + idx); Executed by:
| 1088 | ||||||||||||||||||
222 | - | |||||||||||||||||||
223 | return executed 1248 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined(); Executed by:
executed 1248 times by 1 test: return QV4::Encode::undefined(); Executed by:
| 1248 | ||||||||||||||||||
224 | } | - | ||||||||||||||||||
225 | - | |||||||||||||||||||
226 | template <typename T> | - | ||||||||||||||||||
227 | ReturnedValue DataViewPrototype::method_setFloat(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||
228 | { | - | ||||||||||||||||||
229 | const DataView *v = thisObject->as<DataView>(); | - | ||||||||||||||||||
230 | if (!v
| 0-648 | ||||||||||||||||||
231 | return executed 88 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 88 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 88 | ||||||||||||||||||
232 | double l = argv[0].toNumber(); | - | ||||||||||||||||||
233 | uint idx = (uint)l; | - | ||||||||||||||||||
234 | if (l != idx
| 32-616 | ||||||||||||||||||
235 | return executed 64 times by 1 test: b->engine()->throwTypeError();return b->engine()->throwTypeError(); Executed by:
executed 64 times by 1 test: return b->engine()->throwTypeError(); Executed by:
| 64 | ||||||||||||||||||
236 | idx += v->d()->byteOffset; | - | ||||||||||||||||||
237 | - | |||||||||||||||||||
238 | double val = argc >= 2
| 8-576 | ||||||||||||||||||
239 | bool littleEndian = argc < 3
| 176-408 | ||||||||||||||||||
240 | - | |||||||||||||||||||
241 | if (sizeof(T) == 4
| 292 | ||||||||||||||||||
242 | - | |||||||||||||||||||
243 | union { | - | ||||||||||||||||||
244 | uint i; | - | ||||||||||||||||||
245 | float f; | - | ||||||||||||||||||
246 | } u; | - | ||||||||||||||||||
247 | u.f = val; | - | ||||||||||||||||||
248 | if (littleEndian
| 24-268 | ||||||||||||||||||
249 | qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); executed 24 times by 1 test: qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); Executed by:
| 24 | ||||||||||||||||||
250 | else | - | ||||||||||||||||||
251 | qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); executed 268 times by 1 test: qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); Executed by:
| 268 | ||||||||||||||||||
252 | } else { | - | ||||||||||||||||||
253 | ((sizeof(T) == 8) ? static_cast<void>(0) : qt_assert("sizeof(T) == 8", __FILE__, 297)); | - | ||||||||||||||||||
254 | union { | - | ||||||||||||||||||
255 | quint64 i; | - | ||||||||||||||||||
256 | double d; | - | ||||||||||||||||||
257 | } u; | - | ||||||||||||||||||
258 | u.d = val; | - | ||||||||||||||||||
259 | if (littleEndian
| 24-268 | ||||||||||||||||||
260 | qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); executed 24 times by 1 test: qToLittleEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); Executed by:
| 24 | ||||||||||||||||||
261 | else | - | ||||||||||||||||||
262 | qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); executed 268 times by 1 test: qToBigEndian(u.i, (uchar *)v->d()->buffer->data->data() + idx); Executed by:
| 268 | ||||||||||||||||||
263 | } | - | ||||||||||||||||||
264 | return executed 584 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined(); Executed by:
executed 584 times by 1 test: return QV4::Encode::undefined(); Executed by:
| 584 | ||||||||||||||||||
265 | } | - | ||||||||||||||||||
Switch to Source code | Preprocessed file |