| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4generatorobject_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | namespace QV4 { | - | ||||||||||||
| 5 | - | |||||||||||||
| 6 | enum class GeneratorState { | - | ||||||||||||
| 7 | Undefined, | - | ||||||||||||
| 8 | SuspendedStart, | - | ||||||||||||
| 9 | SuspendedYield, | - | ||||||||||||
| 10 | Executing, | - | ||||||||||||
| 11 | Completed | - | ||||||||||||
| 12 | }; | - | ||||||||||||
| 13 | - | |||||||||||||
| 14 | namespace Heap { | - | ||||||||||||
| 15 | - | |||||||||||||
| 16 | struct GeneratorFunctionCtor : FunctionObject { | - | ||||||||||||
| 17 | void init(QV4::ExecutionContext *scope); | - | ||||||||||||
| 18 | }; | - | ||||||||||||
| 19 | - | |||||||||||||
| 20 | struct GeneratorFunction : ScriptFunction { | - | ||||||||||||
| 21 | }; | - | ||||||||||||
| 22 | - | |||||||||||||
| 23 | struct MemberGeneratorFunction : ScriptFunction { | - | ||||||||||||
| 24 | }; | - | ||||||||||||
| 25 | - | |||||||||||||
| 26 | struct GeneratorPrototype : FunctionObject { | - | ||||||||||||
| 27 | void init(); | - | ||||||||||||
| 28 | }; | - | ||||||||||||
| 29 | struct GeneratorObjectOffsetStruct { Pointer<ExecutionContext *, 0> context; Pointer<GeneratorFunction *, 0> function; GeneratorState state; CppStackFrame cppFrame; ValueArray<0> stack; }; struct GeneratorObjectSizeStruct : Object, GeneratorObjectOffsetStruct {}; struct GeneratorObjectData { typedef Object SuperClass; static constexpr size_t baseOffset = sizeof(GeneratorObjectSizeStruct) - sizeof(GeneratorObjectOffsetStruct); Pointer<ExecutionContext *, | - | ||||||||||||
| 30 | __builtin_offsetof ( | - | ||||||||||||
| 31 | GeneratorObjectOffsetStruct | - | ||||||||||||
| 32 | , | - | ||||||||||||
| 33 | context | - | ||||||||||||
| 34 | ) | - | ||||||||||||
| 35 | + baseOffset> context; Pointer<GeneratorFunction *, | - | ||||||||||||
| 36 | __builtin_offsetof ( | - | ||||||||||||
| 37 | GeneratorObjectOffsetStruct | - | ||||||||||||
| 38 | , | - | ||||||||||||
| 39 | function | - | ||||||||||||
| 40 | ) | - | ||||||||||||
| 41 | + baseOffset> function; GeneratorState state; CppStackFrame cppFrame; ValueArray< | - | ||||||||||||
| 42 | __builtin_offsetof ( | - | ||||||||||||
| 43 | GeneratorObjectOffsetStruct | - | ||||||||||||
| 44 | , | - | ||||||||||||
| 45 | stack | - | ||||||||||||
| 46 | ) | - | ||||||||||||
| 47 | + baseOffset> stack; }; static_assert(bool(sizeof(GeneratorObjectSizeStruct) == sizeof(GeneratorObjectData) + GeneratorObjectData::baseOffset), "sizeof(GeneratorObjectSizeStruct) == sizeof(GeneratorObjectData) + GeneratorObjectData::baseOffset"); struct GeneratorObject : Object, GeneratorObjectData { | - | ||||||||||||
| 48 | static void markObjects(Heap::Base *b, MarkStack *stack) { GeneratorObject *o = static_cast<GeneratorObject *>(b); GeneratorObjectData::SuperClass::markObjects(o, stack); if (o->context
never executed: if (o->functiono->context.heapObject()->mark(stack);
never executed: o->stack.mark(stack); }o->function.heapObject()->mark(stack);never executed: ;end of block | 0 | ||||||||||||
| 49 | }; | - | ||||||||||||
| 50 | - | |||||||||||||
| 51 | } | - | ||||||||||||
| 52 | - | |||||||||||||
| 53 | struct GeneratorFunctionCtor : FunctionCtor | - | ||||||||||||
| 54 | { | - | ||||||||||||
| 55 | private: GeneratorFunctionCtor() = delete; GeneratorFunctionCtor(const GeneratorFunctionCtor &) = delete; GeneratorFunctionCtor &operator=(const GeneratorFunctionCtor &) = 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::GeneratorFunctionCtor Data; typedef FunctionCtor SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 296809 times by 153 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 296809 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::GeneratorFunctionCtor *d_unchecked() const { returnend of blockexecuted 198079 times by 153 tests: static_cast<QV4::Heap::GeneratorFunctionCtor *>(m());return static_cast<QV4::Heap::GeneratorFunctionCtor *>(m());Executed by:
executed 198079 times by 153 tests: } QV4::Heap::GeneratorFunctionCtor *d() const { QV4::Heap::GeneratorFunctionCtor *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::GeneratorFunctionCtor *>(m());Executed by:
executed 99087 times by 153 tests: dptr;return dptr;Executed by:
executed 99087 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::GeneratorFunctionCtor >::value), "std::is_trivial< QV4::Heap::GeneratorFunctionCtor >::value");return dptr;Executed by:
| 0-296809 | ||||||||||||
| 56 | - | |||||||||||||
| 57 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 58 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 59 | }; | - | ||||||||||||
| 60 | - | |||||||||||||
| 61 | struct GeneratorFunction : ScriptFunction | - | ||||||||||||
| 62 | { | - | ||||||||||||
| 63 | private: GeneratorFunction() = delete; GeneratorFunction(const GeneratorFunction &) = delete; GeneratorFunction &operator=(const GeneratorFunction &) = 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 3020 times by 1 test: typedef QV4::Heap::GeneratorFunction Data; typedef ScriptFunction SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockExecuted by:
executed 222375 times by 153 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 222375 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::GeneratorFunction *d_unchecked() const { returnend of blockexecuted 21717 times by 1 test: static_cast<QV4::Heap::GeneratorFunction *>(m());return static_cast<QV4::Heap::GeneratorFunction *>(m());Executed by:
executed 21717 times by 1 test: } QV4::Heap::GeneratorFunction *d() const { QV4::Heap::GeneratorFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::GeneratorFunction *>(m());Executed by:
executed 15496 times by 1 test: dptr;return dptr;Executed by:
executed 15496 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::GeneratorFunction >::value), "std::is_trivial< QV4::Heap::GeneratorFunction >::value");return dptr;Executed by:
| 0-222375 | ||||||||||||
| 64 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 6209 times by 1 test: e->internalClasses(QV4::EngineBase::Class_GeneratorFunction);return e->internalClasses(QV4::EngineBase::Class_GeneratorFunction);Executed by:
executed 6209 times by 1 test: }return e->internalClasses(QV4::EngineBase::Class_GeneratorFunction);Executed by:
| 6209 | ||||||||||||
| 65 | - | |||||||||||||
| 66 | static Heap::FunctionObject *create(ExecutionContext *scope, Function *function); | - | ||||||||||||
| 67 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 68 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 69 | }; | - | ||||||||||||
| 70 | - | |||||||||||||
| 71 | struct MemberGeneratorFunction : GeneratorFunction | - | ||||||||||||
| 72 | { | - | ||||||||||||
| 73 | private: MemberGeneratorFunction() = delete; MemberGeneratorFunction(const MemberGeneratorFunction &) = delete; MemberGeneratorFunction &operator=(const MemberGeneratorFunction &) = 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::MemberGeneratorFunction Data; typedef GeneratorFunction SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 107825 times by 153 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 107825 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::MemberGeneratorFunction *d_unchecked() const { returnend of blockexecuted 6083 times by 1 test: static_cast<QV4::Heap::MemberGeneratorFunction *>(m());return static_cast<QV4::Heap::MemberGeneratorFunction *>(m());Executed by:
executed 6083 times by 1 test: } QV4::Heap::MemberGeneratorFunction *d() const { QV4::Heap::MemberGeneratorFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::MemberGeneratorFunction *>(m());Executed by:
executed 3049 times by 1 test: dptr;return dptr;Executed by:
executed 3049 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::MemberGeneratorFunction >::value), "std::is_trivial< QV4::Heap::MemberGeneratorFunction >::value");return dptr;Executed by:
| 0-107825 | ||||||||||||
| 74 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return executed 3014 times by 1 test: e->internalClasses(QV4::EngineBase::Class_MemberGeneratorFunction);return e->internalClasses(QV4::EngineBase::Class_MemberGeneratorFunction);Executed by:
executed 3014 times by 1 test: }return e->internalClasses(QV4::EngineBase::Class_MemberGeneratorFunction);Executed by:
| 3014 | ||||||||||||
| 75 | - | |||||||||||||
| 76 | static Heap::FunctionObject *create(ExecutionContext *scope, Function *function); | - | ||||||||||||
| 77 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 78 | }; | - | ||||||||||||
| 79 | - | |||||||||||||
| 80 | struct GeneratorPrototype : Object | - | ||||||||||||
| 81 | { | - | ||||||||||||
| 82 | void init(ExecutionEngine *engine, Object *ctor); | - | ||||||||||||
| 83 | - | |||||||||||||
| 84 | static ReturnedValue method_next(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 85 | static ReturnedValue method_return(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 86 | static ReturnedValue method_throw(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 87 | }; | - | ||||||||||||
| 88 | - | |||||||||||||
| 89 | - | |||||||||||||
| 90 | struct GeneratorObject : Object { | - | ||||||||||||
| 91 | private: GeneratorObject() = delete; GeneratorObject(const GeneratorObject &) = delete; GeneratorObject &operator=(const GeneratorObject &) = 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 8477 times by 1 test: typedef QV4::Heap::GeneratorObject Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockExecuted by:
executed 115386 times by 153 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 115386 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::GeneratorObject *d_unchecked() const { returnend of blockexecuted 32018 times by 1 test: static_cast<QV4::Heap::GeneratorObject *>(m());return static_cast<QV4::Heap::GeneratorObject *>(m());Executed by:
executed 32018 times by 1 test: } QV4::Heap::GeneratorObject *d() const { QV4::Heap::GeneratorObject *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::GeneratorObject *>(m());Executed by:
executed 32010 times by 1 test: dptr;return dptr;Executed by:
executed 32010 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::GeneratorObject >::value), "std::is_trivial< QV4::Heap::GeneratorObject >::value");return dptr;Executed by:
| 0-115386 | ||||||||||||
| 92 | public: enum { MyType = Type_GeneratorObject }; | - | ||||||||||||
| 93 | static Heap::InternalClass *defaultInternalClass(QV4::EngineBase *e) { return never executed: e->internalClasses(QV4::EngineBase::Class_GeneratorObject);return e->internalClasses(QV4::EngineBase::Class_GeneratorObject);never executed: }return e->internalClasses(QV4::EngineBase::Class_GeneratorObject); | 0 | ||||||||||||
| 94 | static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) { return never executed: e->generatorPrototype();return e->generatorPrototype();never executed: }return e->generatorPrototype(); | 0 | ||||||||||||
| 95 | - | |||||||||||||
| 96 | ReturnedValue resume(ExecutionEngine *engine, const Value &arg) const; | - | ||||||||||||
| 97 | }; | - | ||||||||||||
| 98 | - | |||||||||||||
| 99 | } | - | ||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| Switch to Source code | Preprocessed file |