| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4functionobject_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | struct QQmlSourceLocation; | - | ||||||||||||
| 7 | - | |||||||||||||
| 8 | namespace QV4 { | - | ||||||||||||
| 9 | - | |||||||||||||
| 10 | struct IndexedBuiltinFunction; | - | ||||||||||||
| 11 | struct JSCallData; | - | ||||||||||||
| 12 | - | |||||||||||||
| 13 | namespace Heap { | - | ||||||||||||
| 14 | struct FunctionObjectOffsetStruct { Pointer<ExecutionContext *, 0> scope; Function * function; VTable::Call jsCall; VTable::CallAsConstructor jsConstruct; }; struct FunctionObjectSizeStruct : Object, FunctionObjectOffsetStruct {}; struct FunctionObjectData { typedef Object SuperClass; static constexpr size_t baseOffset = sizeof(FunctionObjectSizeStruct) - sizeof(FunctionObjectOffsetStruct); Pointer<ExecutionContext *, | - | ||||||||||||
| 15 | __builtin_offsetof ( | - | ||||||||||||
| 16 | FunctionObjectOffsetStruct | - | ||||||||||||
| 17 | , | - | ||||||||||||
| 18 | scope | - | ||||||||||||
| 19 | ) | - | ||||||||||||
| 20 | + baseOffset> scope; Function * function; VTable::Call jsCall; VTable::CallAsConstructor jsConstruct; }; static_assert(bool(sizeof(FunctionObjectSizeStruct) == sizeof(FunctionObjectData) + FunctionObjectData::baseOffset), "sizeof(FunctionObjectSizeStruct) == sizeof(FunctionObjectData) + FunctionObjectData::baseOffset"); struct FunctionObject : Object, FunctionObjectData { | - | ||||||||||||
| 21 | static void markObjects(Heap::Base *b, MarkStack *stack) { FunctionObject *o = static_cast<FunctionObject *>(b); FunctionObjectData::SuperClass::markObjects(o, stack); if (o->scope
executed 111380 times by 27 tests: }o->scope.heapObject()->mark(stack);Executed by:
executed 111380 times by 27 tests: ;end of blockExecuted by:
| 0-111380 | ||||||||||||
| 22 | enum { | - | ||||||||||||
| 23 | Index_Prototype = 0, | - | ||||||||||||
| 24 | Index_ProtoConstructor = 0 | - | ||||||||||||
| 25 | }; | - | ||||||||||||
| 26 | - | |||||||||||||
| 27 | __attribute__((visibility("default"))) void init(QV4::ExecutionContext *scope, QV4::String *name, ReturnedValue (*code)(const QV4::FunctionObject *, const Value *thisObject, const Value *argv, int argc)); | - | ||||||||||||
| 28 | void init(QV4::ExecutionContext *scope, QV4::String *name = nullptr, bool createProto = false); | - | ||||||||||||
| 29 | void init(QV4::ExecutionContext *scope, QV4::Function *function, bool createProto = false); | - | ||||||||||||
| 30 | void init(QV4::ExecutionContext *scope, const QString &name, bool createProto = false); | - | ||||||||||||
| 31 | void init(); | - | ||||||||||||
| 32 | void destroy(); | - | ||||||||||||
| 33 | - | |||||||||||||
| 34 | void setFunction(Function *f); | - | ||||||||||||
| 35 | - | |||||||||||||
| 36 | unsigned int formalParameterCount() { return executed 5764 times by 34 tests: function ? function->nFormals : 0;return function ? function->nFormals : 0;Executed by:
executed 5764 times by 34 tests: }return function ? function->nFormals : 0;Executed by:
| 5764 | ||||||||||||
| 37 | unsigned int varCount() { return never executed: function ? function->compiledFunction->nLocals : 0;return function ? function->compiledFunction->nLocals : 0;never executed: }return function ? function->compiledFunction->nLocals : 0; | 0 | ||||||||||||
| 38 | - | |||||||||||||
| 39 | const QV4::Object *protoProperty() const { return executed 4285299 times by 12 tests: propertyData(Index_Prototype)->as<QV4::Object>();return propertyData(Index_Prototype)->as<QV4::Object>();Executed by:
executed 4285299 times by 12 tests: }return propertyData(Index_Prototype)->as<QV4::Object>();Executed by:
| 4285299 | ||||||||||||
| 40 | }; | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | struct FunctionCtor : FunctionObject { | - | ||||||||||||
| 43 | void init(QV4::ExecutionContext *scope); | - | ||||||||||||
| 44 | }; | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | struct FunctionPrototype : FunctionObject { | - | ||||||||||||
| 47 | void init(); | - | ||||||||||||
| 48 | }; | - | ||||||||||||
| 49 | - | |||||||||||||
| 50 | struct IndexedBuiltinFunction : FunctionObject { | - | ||||||||||||
| 51 | inline void init(QV4::ExecutionContext *scope, uint index, ReturnedValue (*code)(const QV4::FunctionObject *, const Value *, const Value *, int)); | - | ||||||||||||
| 52 | uint index; | - | ||||||||||||
| 53 | }; | - | ||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | struct ScriptFunctionOffsetStruct { Pointer<InternalClass *, 0> cachedClassForConstructor; }; struct ScriptFunctionSizeStruct : FunctionObject, ScriptFunctionOffsetStruct {}; struct ScriptFunctionData { typedef FunctionObject SuperClass; static constexpr size_t baseOffset = sizeof(ScriptFunctionSizeStruct) - sizeof(ScriptFunctionOffsetStruct); Pointer<InternalClass *, | - | ||||||||||||
| 59 | __builtin_offsetof ( | - | ||||||||||||
| 60 | ScriptFunctionOffsetStruct | - | ||||||||||||
| 61 | , | - | ||||||||||||
| 62 | cachedClassForConstructor | - | ||||||||||||
| 63 | ) | - | ||||||||||||
| 64 | + baseOffset> cachedClassForConstructor; }; static_assert(bool(sizeof(ScriptFunctionSizeStruct) == sizeof(ScriptFunctionData) + ScriptFunctionData::baseOffset), "sizeof(ScriptFunctionSizeStruct) == sizeof(ScriptFunctionData) + ScriptFunctionData::baseOffset"); struct ScriptFunction : FunctionObject, ScriptFunctionData { | - | ||||||||||||
| 65 | static void markObjects(Heap::Base *b, MarkStack *stack) { ScriptFunction *o = static_cast<ScriptFunction *>(b); ScriptFunctionData::SuperClass::markObjects(o, stack); if (o->cachedClassForConstructor
never executed: }o->cachedClassForConstructor.heapObject()->mark(stack);executed 93564 times by 17 tests: end of blockExecuted by:
| 0-93564 | ||||||||||||
| 66 | enum { | - | ||||||||||||
| 67 | Index_Name = FunctionObject::Index_Prototype + 1, | - | ||||||||||||
| 68 | Index_Length | - | ||||||||||||
| 69 | }; | - | ||||||||||||
| 70 | void init(QV4::ExecutionContext *scope, Function *function); | - | ||||||||||||
| 71 | }; | - | ||||||||||||
| 72 | - | |||||||||||||
| 73 | struct ConstructorFunction : ScriptFunction | - | ||||||||||||
| 74 | { | - | ||||||||||||
| 75 | bool isDerivedConstructor; | - | ||||||||||||
| 76 | }; | - | ||||||||||||
| 77 | - | |||||||||||||
| 78 | struct MemberFunction : ScriptFunction | - | ||||||||||||
| 79 | { | - | ||||||||||||
| 80 | }; | - | ||||||||||||
| 81 | - | |||||||||||||
| 82 | struct DefaultClassConstructorFunction : FunctionObject | - | ||||||||||||
| 83 | { | - | ||||||||||||
| 84 | bool isDerivedConstructor; | - | ||||||||||||
| 85 | }; | - | ||||||||||||
| 86 | - | |||||||||||||
| 87 | - | |||||||||||||
| 88 | - | |||||||||||||
| 89 | - | |||||||||||||
| 90 | - | |||||||||||||
| 91 | - | |||||||||||||
| 92 | struct BoundFunctionOffsetStruct { Pointer<FunctionObject *, 0> target; HeapValue<0> boundThis; Pointer<MemberData *, 0> boundArgs; }; struct BoundFunctionSizeStruct : FunctionObject, BoundFunctionOffsetStruct {}; struct BoundFunctionData { typedef FunctionObject SuperClass; static constexpr size_t baseOffset = sizeof(BoundFunctionSizeStruct) - sizeof(BoundFunctionOffsetStruct); Pointer<FunctionObject *, | - | ||||||||||||
| 93 | __builtin_offsetof ( | - | ||||||||||||
| 94 | BoundFunctionOffsetStruct | - | ||||||||||||
| 95 | , | - | ||||||||||||
| 96 | target | - | ||||||||||||
| 97 | ) | - | ||||||||||||
| 98 | + baseOffset> target; HeapValue< | - | ||||||||||||
| 99 | __builtin_offsetof ( | - | ||||||||||||
| 100 | BoundFunctionOffsetStruct | - | ||||||||||||
| 101 | , | - | ||||||||||||
| 102 | boundThis | - | ||||||||||||
| 103 | ) | - | ||||||||||||
| 104 | + baseOffset> boundThis; Pointer<MemberData *, | - | ||||||||||||
| 105 | __builtin_offsetof ( | - | ||||||||||||
| 106 | BoundFunctionOffsetStruct | - | ||||||||||||
| 107 | , | - | ||||||||||||
| 108 | boundArgs | - | ||||||||||||
| 109 | ) | - | ||||||||||||
| 110 | + baseOffset> boundArgs; }; static_assert(bool(sizeof(BoundFunctionSizeStruct) == sizeof(BoundFunctionData) + BoundFunctionData::baseOffset), "sizeof(BoundFunctionSizeStruct) == sizeof(BoundFunctionData) + BoundFunctionData::baseOffset"); struct BoundFunction : FunctionObject, BoundFunctionData { | - | ||||||||||||
| 111 | static void markObjects(Heap::Base *b, MarkStack *stack) { BoundFunction *o = static_cast<BoundFunction *>(b); BoundFunctionData::SuperClass::markObjects(o, stack); if (o->target
never executed: o->boundThis.mark(stack); if (o->boundArgso->target.heapObject()->mark(stack);
never executed: }o->boundArgs.heapObject()->mark(stack);never executed: ;end of block | 0 | ||||||||||||
| 112 | - | |||||||||||||
| 113 | void init(QV4::ExecutionContext *scope, QV4::FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs); | - | ||||||||||||
| 114 | }; | - | ||||||||||||
| 115 | - | |||||||||||||
| 116 | } | - | ||||||||||||
| 117 | - | |||||||||||||
| 118 | struct __attribute__((visibility("default"))) FunctionObject: Object { | - | ||||||||||||
| 119 | enum { | - | ||||||||||||
| 120 | IsFunctionObject = true | - | ||||||||||||
| 121 | }; | - | ||||||||||||
| 122 | private: FunctionObject() = delete; FunctionObject(const FunctionObject &) = delete; FunctionObject &operator=(const FunctionObject &) = 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::FunctionObject Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 102974416 times by 154 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 102974416 times by 154 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::FunctionObject *d_unchecked() const { returnend of blockexecuted 202037829 times by 154 tests: static_cast<QV4::Heap::FunctionObject *>(m());return static_cast<QV4::Heap::FunctionObject *>(m());Executed by:
executed 202037829 times by 154 tests: } QV4::Heap::FunctionObject *d() const { QV4::Heap::FunctionObject *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::FunctionObject *>(m());Executed by:
executed 168245430 times by 154 tests: dptr;return dptr;Executed by:
executed 168245430 times by 154 tests: } static_assert(bool(std::is_trivial< QV4::Heap::FunctionObject >::value), "std::is_trivial< QV4::Heap::FunctionObject >::value");return dptr;Executed by:
| 0-202037829 | ||||||||||||
| 123 | public: enum { MyType = Type_FunctionObject }; | - | ||||||||||||
| 124 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 37769959 times by 154 tests: e->internalClasses(QV4::EngineBase::Class_FunctionObject);return e->internalClasses(QV4::EngineBase::Class_FunctionObject);Executed by:
executed 37769959 times by 154 tests: }return e->internalClasses(QV4::EngineBase::Class_FunctionObject);Executed by:
| 37769959 | ||||||||||||
| 125 | static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) { return executed 39311498 times by 154 tests: e->functionPrototype();return e->functionPrototype();Executed by:
executed 39311498 times by 154 tests: }return e->functionPrototype();Executed by:
| 39311498 | ||||||||||||
| 126 | static void virtualDestroy(QV4::Heap::Base *b) { static_cast<Data *>(b)->destroy(); } never executed: end of block | 0 | ||||||||||||
| 127 | enum { NInlineProperties = 1 }; | - | ||||||||||||
| 128 | - | |||||||||||||
| 129 | Heap::ExecutionContext *scope() const { return executed 15910012 times by 154 tests: d()->scope;return d()->scope;Executed by:
executed 15910012 times by 154 tests: }return d()->scope;Executed by:
| 15910012 | ||||||||||||
| 130 | Function *function() const { return executed 15022628 times by 60 tests: d()->function;return d()->function;Executed by:
executed 15022628 times by 60 tests: }return d()->function;Executed by:
| 15022628 | ||||||||||||
| 131 | - | |||||||||||||
| 132 | ReturnedValue name() const; | - | ||||||||||||
| 133 | unsigned int formalParameterCount() const { return executed 5764 times by 34 tests: d()->formalParameterCount();return d()->formalParameterCount();Executed by:
executed 5764 times by 34 tests: }return d()->formalParameterCount();Executed by:
| 5764 | ||||||||||||
| 134 | unsigned int varCount() const { return never executed: d()->varCount();return d()->varCount();never executed: }return d()->varCount(); | 0 | ||||||||||||
| 135 | - | |||||||||||||
| 136 | void setName(String *name) { | - | ||||||||||||
| 137 | defineReadonlyConfigurableProperty(engine()->id_name(), *name); | - | ||||||||||||
| 138 | } executed 38967115 times by 154 tests: end of blockExecuted by:
| 38967115 | ||||||||||||
| 139 | void createDefaultPrototypeProperty(uint protoSlot, uint protoConstructorSlot); | - | ||||||||||||
| 140 | - | |||||||||||||
| 141 | inline ReturnedValue callAsConstructor(const JSCallData &data) const; | - | ||||||||||||
| 142 | ReturnedValue callAsConstructor(const Value *argv, int argc, const Value *newTarget = nullptr) const { | - | ||||||||||||
| 143 | return executed 117811 times by 18 tests: d()->jsConstruct(this, argv, argc, newTarget ? newTarget : this);return d()->jsConstruct(this, argv, argc, newTarget ? newTarget : this);Executed by:
executed 117811 times by 18 tests: return d()->jsConstruct(this, argv, argc, newTarget ? newTarget : this);Executed by:
| 117811 | ||||||||||||
| 144 | } | - | ||||||||||||
| 145 | inline ReturnedValue call(const JSCallData &data) const; | - | ||||||||||||
| 146 | ReturnedValue call(const Value *thisObject, const Value *argv, int argc) const { | - | ||||||||||||
| 147 | return executed 57429125 times by 87 tests: d()->jsCall(this, thisObject, argv, argc);return d()->jsCall(this, thisObject, argv, argc);Executed by:
executed 57429125 times by 87 tests: return d()->jsCall(this, thisObject, argv, argc);Executed by:
| 57429125 | ||||||||||||
| 148 | } | - | ||||||||||||
| 149 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 150 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 151 | - | |||||||||||||
| 152 | static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function); | - | ||||||||||||
| 153 | static Heap::FunctionObject *createConstructorFunction(ExecutionContext *scope, Function *function, bool isDerivedConstructor); | - | ||||||||||||
| 154 | static Heap::FunctionObject *createMemberFunction(ExecutionContext *scope, Function *function); | - | ||||||||||||
| 155 | static Heap::FunctionObject *createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount); | - | ||||||||||||
| 156 | - | |||||||||||||
| 157 | bool strictMode() const { return never executed: d()->function ? d()->function->isStrict() : false;return d()->function ? d()->function->isStrict() : false;never executed: }return d()->function ? d()->function->isStrict() : false; | 0 | ||||||||||||
| 158 | bool isBinding() const; | - | ||||||||||||
| 159 | bool isBoundFunction() const; | - | ||||||||||||
| 160 | - | |||||||||||||
| 161 | QQmlSourceLocation sourceLocation() const; | - | ||||||||||||
| 162 | }; | - | ||||||||||||
| 163 | - | |||||||||||||
| 164 | template<> | - | ||||||||||||
| 165 | inline const FunctionObject *Value::as() const { | - | ||||||||||||
| 166 | return executed 12476520 times by 154 tests: isManaged() && m()->internalClass->vtable->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : nullptr;return isManaged() && m()->internalClass->vtable->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : nullptr;Executed by:
executed 12476520 times by 154 tests: return isManaged() && m()->internalClass->vtable->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : nullptr;Executed by:
| 12476520 | ||||||||||||
| 167 | } | - | ||||||||||||
| 168 | - | |||||||||||||
| 169 | - | |||||||||||||
| 170 | struct FunctionCtor: FunctionObject | - | ||||||||||||
| 171 | { | - | ||||||||||||
| 172 | private: FunctionCtor() = delete; FunctionCtor(const FunctionCtor &) = delete; FunctionCtor &operator=(const FunctionCtor &) = 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::FunctionCtor Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 296941 times by 154 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 296941 times by 154 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::FunctionCtor *d_unchecked() const { returnend of blockexecuted 197825 times by 154 tests: static_cast<QV4::Heap::FunctionCtor *>(m());return static_cast<QV4::Heap::FunctionCtor *>(m());Executed by:
executed 197825 times by 154 tests: } QV4::Heap::FunctionCtor *d() const { QV4::Heap::FunctionCtor *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::FunctionCtor *>(m());Executed by:
executed 99044 times by 154 tests: dptr;return dptr;Executed by:
executed 99044 times by 154 tests: } static_assert(bool(std::is_trivial< QV4::Heap::FunctionCtor >::value), "std::is_trivial< QV4::Heap::FunctionCtor >::value");return dptr;Executed by:
| 0-296941 | ||||||||||||
| 173 | - | |||||||||||||
| 174 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 175 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 176 | protected: | - | ||||||||||||
| 177 | enum Type { | - | ||||||||||||
| 178 | Type_Function, | - | ||||||||||||
| 179 | Type_Generator | - | ||||||||||||
| 180 | }; | - | ||||||||||||
| 181 | static QQmlRefPointer<CompiledData::CompilationUnit> parse(ExecutionEngine *engine, const Value *argv, int argc, Type t = Type_Function); | - | ||||||||||||
| 182 | }; | - | ||||||||||||
| 183 | - | |||||||||||||
| 184 | struct FunctionPrototype: FunctionObject | - | ||||||||||||
| 185 | { | - | ||||||||||||
| 186 | private: FunctionPrototype() = delete; FunctionPrototype(const FunctionPrototype &) = delete; FunctionPrototype &operator=(const FunctionPrototype &) = 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::FunctionPrototype Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 296938 times by 154 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 296938 times by 154 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::FunctionPrototype *d_unchecked() const { returnend of blocknever executed: static_cast<QV4::Heap::FunctionPrototype *>(m());return static_cast<QV4::Heap::FunctionPrototype *>(m());never executed: } QV4::Heap::FunctionPrototype *d() const { QV4::Heap::FunctionPrototype *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::FunctionPrototype *>(m());never executed: dptr;return dptr;never executed: } static_assert(bool(std::is_trivial< QV4::Heap::FunctionPrototype >::value), "std::is_trivial< QV4::Heap::FunctionPrototype >::value");return dptr; | 0-296938 | ||||||||||||
| 187 | - | |||||||||||||
| 188 | void init(ExecutionEngine *engine, Object *ctor); | - | ||||||||||||
| 189 | - | |||||||||||||
| 190 | static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 191 | static ReturnedValue method_apply(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 192 | static ReturnedValue method_call(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 193 | static ReturnedValue method_bind(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 194 | static ReturnedValue method_hasInstance(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 195 | }; | - | ||||||||||||
| 196 | - | |||||||||||||
| 197 | struct IndexedBuiltinFunction : FunctionObject | - | ||||||||||||
| 198 | { | - | ||||||||||||
| 199 | private: IndexedBuiltinFunction() = delete; IndexedBuiltinFunction(const IndexedBuiltinFunction &) = delete; IndexedBuiltinFunction &operator=(const IndexedBuiltinFunction &) = 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::IndexedBuiltinFunction Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 5616 times by 2 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 5616 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::IndexedBuiltinFunction *d_unchecked() const { returnend of blockexecuted 6364 times by 2 tests: static_cast<QV4::Heap::IndexedBuiltinFunction *>(m());return static_cast<QV4::Heap::IndexedBuiltinFunction *>(m());Executed by:
executed 6364 times by 2 tests: } QV4::Heap::IndexedBuiltinFunction *d() const { QV4::Heap::IndexedBuiltinFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::IndexedBuiltinFunction *>(m());Executed by:
executed 4492 times by 2 tests: dptr;return dptr;Executed by:
executed 4492 times by 2 tests: } static_assert(bool(std::is_trivial< QV4::Heap::IndexedBuiltinFunction >::value), "std::is_trivial< QV4::Heap::IndexedBuiltinFunction >::value");return dptr;Executed by:
| 0-6364 | ||||||||||||
| 200 | }; | - | ||||||||||||
| 201 | - | |||||||||||||
| 202 | void Heap::IndexedBuiltinFunction::init(QV4::ExecutionContext *scope, uint index, | - | ||||||||||||
| 203 | ReturnedValue (*code)(const QV4::FunctionObject *, const Value *thisObject, const Value *argv, int argc)) | - | ||||||||||||
| 204 | { | - | ||||||||||||
| 205 | Heap::FunctionObject::init(scope); | - | ||||||||||||
| 206 | this->jsCall = code; | - | ||||||||||||
| 207 | this->index = index; | - | ||||||||||||
| 208 | } executed 1872 times by 2 tests: end of blockExecuted by:
| 1872 | ||||||||||||
| 209 | - | |||||||||||||
| 210 | - | |||||||||||||
| 211 | struct ScriptFunction : FunctionObject { | - | ||||||||||||
| 212 | private: ScriptFunction() = delete; ScriptFunction(const ScriptFunction &) = delete; ScriptFunction &operator=(const ScriptFunction &) = 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::ScriptFunction Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 4620740 times by 154 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 4620740 times by 154 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::ScriptFunction *d_unchecked() const { returnend of blockexecuted 3077016 times by 62 tests: static_cast<QV4::Heap::ScriptFunction *>(m());return static_cast<QV4::Heap::ScriptFunction *>(m());Executed by:
executed 3077016 times by 62 tests: } QV4::Heap::ScriptFunction *d() const { QV4::Heap::ScriptFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::ScriptFunction *>(m());Executed by:
executed 1569928 times by 62 tests: dptr;return dptr;Executed by:
executed 1569928 times by 62 tests: } static_assert(bool(std::is_trivial< QV4::Heap::ScriptFunction >::value), "std::is_trivial< QV4::Heap::ScriptFunction >::value");return dptr;Executed by:
| 0-4620740 | ||||||||||||
| 213 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 1509217 times by 62 tests: e->internalClasses(QV4::EngineBase::Class_ScriptFunction);return e->internalClasses(QV4::EngineBase::Class_ScriptFunction);Executed by:
executed 1509217 times by 62 tests: }return e->internalClasses(QV4::EngineBase::Class_ScriptFunction);Executed by:
| 1509217 | ||||||||||||
| 214 | enum { NInlineProperties = 3 }; | - | ||||||||||||
| 215 | - | |||||||||||||
| 216 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 217 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 218 | - | |||||||||||||
| 219 | Heap::InternalClass *classForConstructor() const; | - | ||||||||||||
| 220 | }; | - | ||||||||||||
| 221 | - | |||||||||||||
| 222 | struct ConstructorFunction : ScriptFunction { | - | ||||||||||||
| 223 | private: ConstructorFunction() = delete; ConstructorFunction(const ConstructorFunction &) = delete; ConstructorFunction &operator=(const ConstructorFunction &) = 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::ConstructorFunction Data; typedef ScriptFunction SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 101054 times by 154 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 101054 times by 154 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::ConstructorFunction *d_unchecked() const { returnend of blockexecuted 1918 times by 1 test: static_cast<QV4::Heap::ConstructorFunction *>(m());return static_cast<QV4::Heap::ConstructorFunction *>(m());Executed by:
executed 1918 times by 1 test: } QV4::Heap::ConstructorFunction *d() const { QV4::Heap::ConstructorFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::ConstructorFunction *>(m());Executed by:
executed 1259 times by 1 test: dptr;return dptr;Executed by:
executed 1259 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::ConstructorFunction >::value), "std::is_trivial< QV4::Heap::ConstructorFunction >::value");return dptr;Executed by:
| 0-101054 | ||||||||||||
| 224 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 660 times by 1 test: e->internalClasses(QV4::EngineBase::Class_ConstructorFunction);return e->internalClasses(QV4::EngineBase::Class_ConstructorFunction);Executed by:
executed 660 times by 1 test: }return e->internalClasses(QV4::EngineBase::Class_ConstructorFunction);Executed by:
| 660 | ||||||||||||
| 225 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 226 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 227 | }; | - | ||||||||||||
| 228 | - | |||||||||||||
| 229 | struct MemberFunction : ScriptFunction { | - | ||||||||||||
| 230 | private: MemberFunction() = delete; MemberFunction(const MemberFunction &) = delete; MemberFunction &operator=(const MemberFunction &) = 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::MemberFunction Data; typedef ScriptFunction SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 113220 times by 154 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 113220 times by 154 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::MemberFunction *d_unchecked() const { returnend of blockexecuted 9452 times by 1 test: static_cast<QV4::Heap::MemberFunction *>(m());return static_cast<QV4::Heap::MemberFunction *>(m());Executed by:
executed 9452 times by 1 test: } QV4::Heap::MemberFunction *d() const { QV4::Heap::MemberFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::MemberFunction *>(m());Executed by:
executed 4745 times by 1 test: dptr;return dptr;Executed by:
executed 4745 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::MemberFunction >::value), "std::is_trivial< QV4::Heap::MemberFunction >::value");return dptr;Executed by:
| 0-113220 | ||||||||||||
| 231 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 4732 times by 1 test: e->internalClasses(QV4::EngineBase::Class_MemberFunction);return e->internalClasses(QV4::EngineBase::Class_MemberFunction);Executed by:
executed 4732 times by 1 test: }return e->internalClasses(QV4::EngineBase::Class_MemberFunction);Executed by:
| 4732 | ||||||||||||
| 232 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 233 | }; | - | ||||||||||||
| 234 | - | |||||||||||||
| 235 | - | |||||||||||||
| 236 | struct DefaultClassConstructorFunction : FunctionObject { | - | ||||||||||||
| 237 | private: DefaultClassConstructorFunction() = delete; DefaultClassConstructorFunction(const DefaultClassConstructorFunction &) = delete; DefaultClassConstructorFunction &operator=(const DefaultClassConstructorFunction &) = 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::DefaultClassConstructorFunction Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 25054 times by 1 test: &static_vtbl;return &static_vtbl;Executed by:
executed 25054 times by 1 test: } 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::DefaultClassConstructorFunction *d_unchecked() const { returnend of blockexecuted 19848 times by 1 test: static_cast<QV4::Heap::DefaultClassConstructorFunction *>(m());return static_cast<QV4::Heap::DefaultClassConstructorFunction *>(m());Executed by:
executed 19848 times by 1 test: } QV4::Heap::DefaultClassConstructorFunction *d() const { QV4::Heap::DefaultClassConstructorFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::DefaultClassConstructorFunction *>(m());Executed by:
executed 11498 times by 1 test: dptr;return dptr;Executed by:
executed 11498 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::DefaultClassConstructorFunction >::value), "std::is_trivial< QV4::Heap::DefaultClassConstructorFunction >::value");return dptr;Executed by:
| 0-25054 | ||||||||||||
| 238 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 239 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 240 | }; | - | ||||||||||||
| 241 | - | |||||||||||||
| 242 | struct BoundFunction: FunctionObject { | - | ||||||||||||
| 243 | private: BoundFunction() = delete; BoundFunction(const BoundFunction &) = delete; BoundFunction &operator=(const BoundFunction &) = 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::BoundFunction Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 4306107 times by 17 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 4306107 times by 17 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::BoundFunction *d_unchecked() const { returnend of blockexecuted 1980 times by 3 tests: static_cast<QV4::Heap::BoundFunction *>(m());return static_cast<QV4::Heap::BoundFunction *>(m());Executed by:
executed 1980 times by 3 tests: } QV4::Heap::BoundFunction *d() const { QV4::Heap::BoundFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::BoundFunction *>(m());Executed by:
executed 1409 times by 3 tests: dptr;return dptr;Executed by:
executed 1409 times by 3 tests: } static_assert(bool(std::is_trivial< QV4::Heap::BoundFunction >::value), "std::is_trivial< QV4::Heap::BoundFunction >::value");return dptr;Executed by:
| 0-4306107 | ||||||||||||
| 244 | - | |||||||||||||
| 245 | static Heap::BoundFunction *create(ExecutionContext *scope, FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs) | - | ||||||||||||
| 246 | { | - | ||||||||||||
| 247 | return executed 575 times by 3 tests: scope->engine()->memoryManager->allocate<BoundFunction>(scope, target, boundThis, boundArgs);return scope->engine()->memoryManager->allocate<BoundFunction>(scope, target, boundThis, boundArgs);Executed by:
executed 575 times by 3 tests: return scope->engine()->memoryManager->allocate<BoundFunction>(scope, target, boundThis, boundArgs);Executed by:
| 575 | ||||||||||||
| 248 | } | - | ||||||||||||
| 249 | - | |||||||||||||
| 250 | Heap::FunctionObject *target() const { return executed 310 times by 2 tests: d()->target;return d()->target;Executed by:
executed 310 times by 2 tests: }return d()->target;Executed by:
| 310 | ||||||||||||
| 251 | Value boundThis() const { return executed 207 times by 2 tests: d()->boundThis;return d()->boundThis;Executed by:
executed 207 times by 2 tests: }return d()->boundThis;Executed by:
| 207 | ||||||||||||
| 252 | Heap::MemberData *boundArgs() const { return executed 309 times by 3 tests: d()->boundArgs;return d()->boundArgs;Executed by:
executed 309 times by 3 tests: }return d()->boundArgs;Executed by:
| 309 | ||||||||||||
| 253 | - | |||||||||||||
| 254 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 255 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 256 | }; | - | ||||||||||||
| 257 | - | |||||||||||||
| 258 | } | - | ||||||||||||
| 259 | - | |||||||||||||
| 260 | - | |||||||||||||
| Switch to Source code | Preprocessed file |