Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4typedarray_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | namespace QV4 { | - | ||||||
4 | - | |||||||
5 | struct ArrayBuffer; | - | ||||||
6 | - | |||||||
7 | typedef ReturnedValue (*TypedArrayRead)(const char *data, int index); | - | ||||||
8 | typedef void (*TypedArrayWrite)(ExecutionEngine *engine, char *data, int index, const Value &value); | - | ||||||
9 | - | |||||||
10 | struct TypedArrayOperations { | - | ||||||
11 | int bytesPerElement; | - | ||||||
12 | const char *name; | - | ||||||
13 | TypedArrayRead read; | - | ||||||
14 | TypedArrayWrite write; | - | ||||||
15 | }; | - | ||||||
16 | - | |||||||
17 | namespace Heap { | - | ||||||
18 | struct TypedArrayOffsetStruct { Pointer<ArrayBuffer *, 0> buffer; const TypedArrayOperations * type; uint byteLength; uint byteOffset; uint arrayType; }; struct TypedArraySizeStruct : Object, TypedArrayOffsetStruct {}; struct TypedArrayData { typedef Object SuperClass; static constexpr size_t baseOffset = sizeof(TypedArraySizeStruct) - sizeof(TypedArrayOffsetStruct); Pointer<ArrayBuffer *, | - | ||||||
19 | __builtin_offsetof ( | - | ||||||
20 | TypedArrayOffsetStruct | - | ||||||
21 | , | - | ||||||
22 | buffer | - | ||||||
23 | ) | - | ||||||
24 | + baseOffset> buffer; const TypedArrayOperations * type; uint byteLength; uint byteOffset; uint arrayType; }; static_assert(bool(sizeof(TypedArraySizeStruct) == sizeof(TypedArrayData) + TypedArrayData::baseOffset), "sizeof(TypedArraySizeStruct) == sizeof(TypedArrayData) + TypedArrayData::baseOffset"); struct TypedArray : Object, TypedArrayData { | - | ||||||
25 | static void markObjects(Heap::Base *b, MarkStack *stack) { TypedArray *o = static_cast<TypedArray *>(b); TypedArrayData::SuperClass::markObjects(o, stack); if (o->buffer
never executed: }o->buffer.heapObject()->mark(stack); never executed: ;end of block | 0 | ||||||
26 | enum Type { | - | ||||||
27 | Int8Array, | - | ||||||
28 | UInt8Array, | - | ||||||
29 | UInt8ClampedArray, | - | ||||||
30 | Int16Array, | - | ||||||
31 | UInt16Array, | - | ||||||
32 | Int32Array, | - | ||||||
33 | UInt32Array, | - | ||||||
34 | Float32Array, | - | ||||||
35 | Float64Array, | - | ||||||
36 | NTypes | - | ||||||
37 | }; | - | ||||||
38 | - | |||||||
39 | void init(Type t); | - | ||||||
40 | }; | - | ||||||
41 | - | |||||||
42 | struct IntrinsicTypedArrayCtor : FunctionObject { | - | ||||||
43 | }; | - | ||||||
44 | - | |||||||
45 | struct TypedArrayCtor : FunctionObject { | - | ||||||
46 | void init(QV4::ExecutionContext *scope, TypedArray::Type t); | - | ||||||
47 | - | |||||||
48 | TypedArray::Type type; | - | ||||||
49 | }; | - | ||||||
50 | - | |||||||
51 | struct IntrinsicTypedArrayPrototype : Object { | - | ||||||
52 | }; | - | ||||||
53 | - | |||||||
54 | struct TypedArrayPrototype : Object { | - | ||||||
55 | inline void init(TypedArray::Type t); | - | ||||||
56 | TypedArray::Type type; | - | ||||||
57 | }; | - | ||||||
58 | - | |||||||
59 | - | |||||||
60 | } | - | ||||||
61 | - | |||||||
62 | struct __attribute__((visibility("default"))) TypedArray : Object | - | ||||||
63 | { | - | ||||||
64 | private: TypedArray() = delete; TypedArray(const TypedArray &) = delete; TypedArray &operator=(const TypedArray &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } executed 86738 times by 2 tests: typedef QV4::Heap::TypedArray Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block Executed by:
executed 161276 times by 2 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 161276 times by 2 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::TypedArray *d_unchecked() const { returnend of block executed 451842 times by 2 tests: static_cast<QV4::Heap::TypedArray *>(m());return static_cast<QV4::Heap::TypedArray *>(m()); Executed by:
executed 451842 times by 2 tests: } QV4::Heap::TypedArray *d() const { QV4::Heap::TypedArray *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::TypedArray *>(m()); Executed by:
executed 451918 times by 2 tests: dptr;return dptr; Executed by:
executed 451918 times by 2 tests: } static_assert(bool(std::is_trivial< QV4::Heap::TypedArray >::value), "std::is_trivial< QV4::Heap::TypedArray >::value");return dptr; Executed by:
| 0-451918 | ||||||
65 | - | |||||||
66 | static Heap::TypedArray *create(QV4::ExecutionEngine *e, Heap::TypedArray::Type t); | - | ||||||
67 | - | |||||||
68 | uint byteLength() const { | - | ||||||
69 | return never executed: d()->byteLength;return d()->byteLength; never executed: return d()->byteLength; | 0 | ||||||
70 | } | - | ||||||
71 | - | |||||||
72 | uint length() const { | - | ||||||
73 | return executed 12462 times by 1 test: d()->byteLength/d()->type->bytesPerElement;return d()->byteLength/d()->type->bytesPerElement; Executed by:
executed 12462 times by 1 test: return d()->byteLength/d()->type->bytesPerElement; Executed by:
| 12462 | ||||||
74 | } | - | ||||||
75 | - | |||||||
76 | QTypedArrayData<char> *arrayData() { | - | ||||||
77 | return never executed: d()->buffer->data;return d()->buffer->data; never executed: return d()->buffer->data; | 0 | ||||||
78 | } | - | ||||||
79 | - | |||||||
80 | Heap::TypedArray::Type arrayType() const { | - | ||||||
81 | return never executed: static_cast<Heap::TypedArray::Type>(d()->arrayType);return static_cast<Heap::TypedArray::Type>(d()->arrayType); never executed: return static_cast<Heap::TypedArray::Type>(d()->arrayType); | 0 | ||||||
82 | } | - | ||||||
83 | using Object::get; | - | ||||||
84 | - | |||||||
85 | static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty); | - | ||||||
86 | static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver); | - | ||||||
87 | }; | - | ||||||
88 | - | |||||||
89 | struct IntrinsicTypedArrayCtor: FunctionObject | - | ||||||
90 | { | - | ||||||
91 | private: IntrinsicTypedArrayCtor() = delete; IntrinsicTypedArrayCtor(const IntrinsicTypedArrayCtor &) = delete; IntrinsicTypedArrayCtor &operator=(const IntrinsicTypedArrayCtor &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::IntrinsicTypedArrayCtor Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block executed 296354 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 296354 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::IntrinsicTypedArrayCtor *d_unchecked() const { returnend of block executed 197751 times by 153 tests: static_cast<QV4::Heap::IntrinsicTypedArrayCtor *>(m());return static_cast<QV4::Heap::IntrinsicTypedArrayCtor *>(m()); Executed by:
executed 197751 times by 153 tests: } QV4::Heap::IntrinsicTypedArrayCtor *d() const { QV4::Heap::IntrinsicTypedArrayCtor *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::IntrinsicTypedArrayCtor *>(m()); Executed by:
executed 98963 times by 153 tests: dptr;return dptr; Executed by:
executed 98963 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::IntrinsicTypedArrayCtor >::value), "std::is_trivial< QV4::Heap::IntrinsicTypedArrayCtor >::value");return dptr; Executed by:
| 0-296354 | ||||||
92 | - | |||||||
93 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
94 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||
95 | }; | - | ||||||
96 | - | |||||||
97 | struct TypedArrayCtor: FunctionObject | - | ||||||
98 | { | - | ||||||
99 | private: TypedArrayCtor() = delete; TypedArrayCtor(const TypedArrayCtor &) = delete; TypedArrayCtor &operator=(const TypedArrayCtor &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::TypedArrayCtor Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block executed 2668017 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 2668017 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::TypedArrayCtor *d_unchecked() const { returnend of block executed 3610027 times by 153 tests: static_cast<QV4::Heap::TypedArrayCtor *>(m());return static_cast<QV4::Heap::TypedArrayCtor *>(m()); Executed by:
executed 3610027 times by 153 tests: } QV4::Heap::TypedArrayCtor *d() const { QV4::Heap::TypedArrayCtor *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::TypedArrayCtor *>(m()); Executed by:
executed 2722927 times by 153 tests: dptr;return dptr; Executed by:
executed 2722927 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::TypedArrayCtor >::value), "std::is_trivial< QV4::Heap::TypedArrayCtor >::value");return dptr; Executed by:
| 0-3610027 | ||||||
100 | - | |||||||
101 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
102 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||
103 | }; | - | ||||||
104 | - | |||||||
105 | struct IntrinsicTypedArrayPrototype : Object | - | ||||||
106 | { | - | ||||||
107 | private: IntrinsicTypedArrayPrototype() = delete; IntrinsicTypedArrayPrototype(const IntrinsicTypedArrayPrototype &) = delete; IntrinsicTypedArrayPrototype &operator=(const IntrinsicTypedArrayPrototype &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::IntrinsicTypedArrayPrototype Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block executed 296351 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 296351 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::IntrinsicTypedArrayPrototype *d_unchecked() const { returnend of block executed 197444 times by 153 tests: static_cast<QV4::Heap::IntrinsicTypedArrayPrototype *>(m());return static_cast<QV4::Heap::IntrinsicTypedArrayPrototype *>(m()); Executed by:
executed 197444 times by 153 tests: } QV4::Heap::IntrinsicTypedArrayPrototype *d() const { QV4::Heap::IntrinsicTypedArrayPrototype *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::IntrinsicTypedArrayPrototype *>(m()); Executed by:
executed 98906 times by 153 tests: dptr;return dptr; Executed by:
executed 98906 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::IntrinsicTypedArrayPrototype >::value), "std::is_trivial< QV4::Heap::IntrinsicTypedArrayPrototype >::value");return dptr; Executed by:
| 0-296351 | ||||||
108 | static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) { return executed 98966 times by 153 tests: e->objectPrototype();return e->objectPrototype(); Executed by:
executed 98966 times by 153 tests: }return e->objectPrototype(); Executed by:
| 98966 | ||||||
109 | - | |||||||
110 | void init(ExecutionEngine *engine, IntrinsicTypedArrayCtor *ctor); | - | ||||||
111 | - | |||||||
112 | static ReturnedValue method_get_buffer(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
113 | static ReturnedValue method_get_byteLength(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
114 | static ReturnedValue method_get_byteOffset(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
115 | static ReturnedValue method_get_length(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
116 | - | |||||||
117 | static ReturnedValue method_entries(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
118 | static ReturnedValue method_keys(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
119 | static ReturnedValue method_values(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
120 | static ReturnedValue method_set(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
121 | static ReturnedValue method_subarray(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
122 | - | |||||||
123 | static ReturnedValue method_get_toStringTag(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
124 | - | |||||||
125 | }; | - | ||||||
126 | - | |||||||
127 | struct TypedArrayPrototype : Object | - | ||||||
128 | { | - | ||||||
129 | private: TypedArrayPrototype() = delete; TypedArrayPrototype(const TypedArrayPrototype &) = delete; TypedArrayPrototype &operator=(const TypedArrayPrototype &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } executed 888953 times by 153 tests: typedef QV4::Heap::TypedArrayPrototype Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block Executed by:
executed 3555449 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 3555449 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::TypedArrayPrototype *d_unchecked() const { returnend of block executed 1777005 times by 153 tests: static_cast<QV4::Heap::TypedArrayPrototype *>(m());return static_cast<QV4::Heap::TypedArrayPrototype *>(m()); Executed by:
executed 1777005 times by 153 tests: } QV4::Heap::TypedArrayPrototype *d() const { QV4::Heap::TypedArrayPrototype *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::TypedArrayPrototype *>(m()); Executed by:
executed 888748 times by 153 tests: dptr;return dptr; Executed by:
executed 888748 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::TypedArrayPrototype >::value), "std::is_trivial< QV4::Heap::TypedArrayPrototype >::value");return dptr; Executed by:
| 0-3555449 | ||||||
130 | static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) { return executed 889923 times by 153 tests: e->objectPrototype();return e->objectPrototype(); Executed by:
executed 889923 times by 153 tests: }return e->objectPrototype(); Executed by:
| 889923 | ||||||
131 | - | |||||||
132 | void init(ExecutionEngine *engine, TypedArrayCtor *ctor); | - | ||||||
133 | }; | - | ||||||
134 | - | |||||||
135 | inline void | - | ||||||
136 | Heap::TypedArrayPrototype::init(TypedArray::Type t) | - | ||||||
137 | { | - | ||||||
138 | Object::init(); | - | ||||||
139 | type = t; | - | ||||||
140 | } executed 888846 times by 153 tests: end of block Executed by:
| 888846 | ||||||
141 | - | |||||||
142 | } | - | ||||||
143 | - | |||||||
144 | - | |||||||
Switch to Source code | Preprocessed file |