OpenCoverage

qv4generatorobject.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4generatorobject.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2using namespace QV4;-
3-
4const QV4::VTable GeneratorFunctionCtor::static_vtbl = { (std::is_same<GeneratorFunctionCtor::SuperClass, Object>::value) ? nullptr : &GeneratorFunctionCtor::SuperClass::static_vtbl, (sizeof(GeneratorFunctionCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(GeneratorFunctionCtor::Data) + (GeneratorFunctionCtor::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(GeneratorFunctionCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), GeneratorFunctionCtor::IsExecutionContext, GeneratorFunctionCtor::IsString, GeneratorFunctionCtor::IsObject, GeneratorFunctionCtor::IsFunctionObject, GeneratorFunctionCtor::IsErrorObject, GeneratorFunctionCtor::IsArrayData, GeneratorFunctionCtor::IsStringOrSymbol, GeneratorFunctionCtor::MyType, { 0, 0, 0, 0 }, "GeneratorFunctionCtor", GeneratorFunctionCtor::virtualDestroy, GeneratorFunctionCtor::Data::markObjects, GeneratorFunctionCtor::virtualIsEqualTo, GeneratorFunctionCtor::virtualGet, GeneratorFunctionCtor::virtualPut, GeneratorFunctionCtor::virtualDeleteProperty, GeneratorFunctionCtor::virtualHasProperty, GeneratorFunctionCtor::virtualGetOwnProperty, GeneratorFunctionCtor::virtualDefineOwnProperty, GeneratorFunctionCtor::virtualIsExtensible, GeneratorFunctionCtor::virtualPreventExtensions, GeneratorFunctionCtor::virtualGetPrototypeOf, GeneratorFunctionCtor::virtualSetPrototypeOf, GeneratorFunctionCtor::virtualGetLength, GeneratorFunctionCtor::virtualAdvanceIterator, GeneratorFunctionCtor::virtualInstanceOf, GeneratorFunctionCtor::virtualCall, GeneratorFunctionCtor::virtualCallAsConstructor, };-
5const QV4::VTable GeneratorFunction::static_vtbl = { (std::is_same<GeneratorFunction::SuperClass, Object>::value) ? nullptr : &GeneratorFunction::SuperClass::static_vtbl, (sizeof(GeneratorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(GeneratorFunction::Data) + (GeneratorFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(GeneratorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), GeneratorFunction::IsExecutionContext, GeneratorFunction::IsString, GeneratorFunction::IsObject, GeneratorFunction::IsFunctionObject, GeneratorFunction::IsErrorObject, GeneratorFunction::IsArrayData, GeneratorFunction::IsStringOrSymbol, GeneratorFunction::MyType, { 0, 0, 0, 0 }, "GeneratorFunction", GeneratorFunction::virtualDestroy, GeneratorFunction::Data::markObjects, GeneratorFunction::virtualIsEqualTo, GeneratorFunction::virtualGet, GeneratorFunction::virtualPut, GeneratorFunction::virtualDeleteProperty, GeneratorFunction::virtualHasProperty, GeneratorFunction::virtualGetOwnProperty, GeneratorFunction::virtualDefineOwnProperty, GeneratorFunction::virtualIsExtensible, GeneratorFunction::virtualPreventExtensions, GeneratorFunction::virtualGetPrototypeOf, GeneratorFunction::virtualSetPrototypeOf, GeneratorFunction::virtualGetLength, GeneratorFunction::virtualAdvanceIterator, GeneratorFunction::virtualInstanceOf, GeneratorFunction::virtualCall, GeneratorFunction::virtualCallAsConstructor, };-
6const QV4::VTable GeneratorObject::static_vtbl = { (std::is_same<GeneratorObject::SuperClass, Object>::value) ? nullptr : &GeneratorObject::SuperClass::static_vtbl, (sizeof(GeneratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(GeneratorObject::Data) + (GeneratorObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(GeneratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), GeneratorObject::IsExecutionContext, GeneratorObject::IsString, GeneratorObject::IsObject, GeneratorObject::IsFunctionObject, GeneratorObject::IsErrorObject, GeneratorObject::IsArrayData, GeneratorObject::IsStringOrSymbol, GeneratorObject::MyType, { 0, 0, 0, 0 }, "GeneratorObject", GeneratorObject::virtualDestroy, GeneratorObject::Data::markObjects, GeneratorObject::virtualIsEqualTo, GeneratorObject::virtualGet, GeneratorObject::virtualPut, GeneratorObject::virtualDeleteProperty, GeneratorObject::virtualHasProperty, GeneratorObject::virtualGetOwnProperty, GeneratorObject::virtualDefineOwnProperty, GeneratorObject::virtualIsExtensible, GeneratorObject::virtualPreventExtensions, GeneratorObject::virtualGetPrototypeOf, GeneratorObject::virtualSetPrototypeOf, GeneratorObject::virtualGetLength, GeneratorObject::virtualAdvanceIterator, GeneratorObject::virtualInstanceOf, GeneratorObject::virtualCall, GeneratorObject::virtualCallAsConstructor, };-
7-
8void Heap::GeneratorFunctionCtor::init(QV4::ExecutionContext *scope)-
9{-
10 Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "GeneratorFunction")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "GeneratorFunction" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98596 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 98596 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()));
98596
11}
executed 99150 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99150
12-
13ReturnedValue GeneratorFunctionCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *)-
14{-
15 ExecutionEngine *engine = f->engine();-
16-
17 QQmlRefPointer<CompiledData::CompilationUnit> compilationUnit = parse(engine, argv, argc, Type_Generator);-
18 if (engine->hasException
engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 111 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8-111
19 return
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
20-
21 Function *vmf = compilationUnit->linkToEngine(engine);-
22 ExecutionContext *global = engine->scriptContext();-
23 return
executed 111 times by 1 test: return Encode(GeneratorFunction::create(global, vmf));
Executed by:
  • tst_ecmascripttests
Encode(GeneratorFunction::create(global, vmf));
executed 111 times by 1 test: return Encode(GeneratorFunction::create(global, vmf));
Executed by:
  • tst_ecmascripttests
111
24}-
25-
26-
27ReturnedValue GeneratorFunctionCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc)-
28{-
29 return
executed 92 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
virtualCallAsConstructor(f, argv, argc, f);
executed 92 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
92
30}-
31-
32Heap::FunctionObject *GeneratorFunction::create(ExecutionContext *context, Function *function)-
33{-
34 Scope scope(context);-
35 Scoped<GeneratorFunction> g(scope, context->engine()->memoryManager->allocate<GeneratorFunction>(context, function));-
36 ScopedObject proto(scope, scope.engine->newObject());-
37 proto->setPrototypeOf(scope.engine->generatorPrototype());-
38 g->defineDefaultProperty(scope.engine->id_prototype(), proto, Attr_NotConfigurable|Attr_NotEnumerable);-
39 g->setPrototypeOf(ScopedObject(scope, scope.engine->generatorFunctionCtor()->get(scope.engine->id_prototype())));-
40 return
executed 6223 times by 1 test: return g->d();
Executed by:
  • tst_ecmascripttests
g->d();
executed 6223 times by 1 test: return g->d();
Executed by:
  • tst_ecmascripttests
6223
41}-
42-
43ReturnedValue GeneratorFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *, int, const Value *)-
44{-
45 return
executed 16 times by 1 test: return f->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
f->engine()->throwTypeError();
executed 16 times by 1 test: return f->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
16
46}-
47-
48ReturnedValue GeneratorFunction::virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
49{-
50 const GeneratorFunction *gf = static_cast<const GeneratorFunction *>(f);-
51 Function *function = gf->function();-
52 ExecutionEngine *engine = gf->engine();-
53-
54-
55 uint stackSize = argc-
56 + CppStackFrame::requiredJSStackFrameSize(function);-
57-
58 size_t requiredMemory = sizeof(GeneratorObject::Data) - sizeof(Value) + sizeof(Value) * stackSize;-
59-
60 Scope scope(gf);-
61 Scoped<GeneratorObject> g(scope, scope.engine->memoryManager->allocManaged<GeneratorObject>(requiredMemory, scope.engine->classes[EngineBase::Class_GeneratorObject]));-
62 g->setPrototypeOf(ScopedObject(scope, gf->get(scope.engine->id_prototype())));-
63-
64 Heap::GeneratorObject *gp = g->d();-
65 gp->stack.size = stackSize;-
66 gp->stack.alloc = stackSize;-
67-
68-
69 memcpy(gp->stack.values, argv, argc*sizeof(Value));-
70 gp->cppFrame.init(engine, function, gp->stack.values, argc);-
71 gp->cppFrame.setupJSFrame(&gp->stack.values[argc], *gf, gf->scope(),-
72 thisObject ? *thisObject : Primitive::undefinedValue(),-
73 Primitive::undefinedValue());-
74-
75 gp->cppFrame.push();-
76-
77 Moth::VME::interpret(&gp->cppFrame, engine, function->codeData);-
78 gp->state = GeneratorState::SuspendedStart;-
79-
80 gp->cppFrame.pop();-
81 return
executed 7777 times by 1 test: return g->asReturnedValue();
Executed by:
  • tst_ecmascripttests
g->asReturnedValue();
executed 7777 times by 1 test: return g->asReturnedValue();
Executed by:
  • tst_ecmascripttests
7777
82}-
83-
84-
85void Heap::GeneratorPrototype::init()-
86{-
87 Heap::FunctionObject::init();-
88}
never executed: end of block
0
89-
90-
91void GeneratorPrototype::init(ExecutionEngine *engine, Object *ctor)-
92{-
93 Scope scope(engine);-
94 ScopedValue v(scope);-
95-
96 ScopedObject ctorProto(scope, engine->newObject(engine->newInternalClass(Object::staticVTable(), engine->functionPrototype())));-
97-
98 ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1));-
99 ctor->defineReadonlyProperty(engine->id_prototype(), ctorProto);-
100-
101 ctorProto->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "constructor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "constructor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98715 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 98715 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()), (v = ctor), Attr_ReadOnly_ButConfigurable);
98715
102 ctorProto->defineDefaultProperty(engine->symbol_toStringTag(), (v = engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "GeneratorFunction")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "GeneratorFunction" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98995 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 98995 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()))), Attr_ReadOnly_ButConfigurable);
98995
103 ctorProto->defineDefaultProperty(engine->id_prototype(), (v = this), Attr_ReadOnly_ButConfigurable);-
104-
105 setPrototypeOf(engine->iteratorPrototype());-
106 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "constructor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "constructor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99072 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 99072 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()), ctorProto, Attr_ReadOnly_ButConfigurable);
99072
107 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "next")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "next" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99096 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 99096 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()), method_next, 1);
99096
108 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "return")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "return" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99107 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 99107 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()), method_return, 1);
99107
109 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "throw")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "throw" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99095 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 99095 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()), method_throw, 1);
99095
110 defineDefaultProperty(engine->symbol_toStringTag(), (v = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Generator")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Generator" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99061 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 99061 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()))), Attr_ReadOnly_ButConfigurable);
99061
111}
executed 99017 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99017
112-
113ReturnedValue GeneratorPrototype::method_next(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
114{-
115 ExecutionEngine *engine = f->engine();-
116 const GeneratorObject *g = thisObject->as<GeneratorObject>();-
117 if (!g
!gDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 7765 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| g->d()->state == GeneratorState::Executing
g->d()->state ...ate::ExecutingDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 7766 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8-7766
118 return
executed 88 times by 1 test: return engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
engine->throwTypeError();
executed 88 times by 1 test: return engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
88
119 Heap::GeneratorObject *gp = g->d();-
120-
121 if (gp->state == GeneratorState::Completed
gp->state == G...ate::CompletedDescription
TRUEevaluated 716 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 7045 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
716-7045
122 return
executed 716 times by 1 test: return IteratorPrototype::createIterResultObject(engine, Primitive::undefinedValue(), true);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(engine, Primitive::undefinedValue(), true);
executed 716 times by 1 test: return IteratorPrototype::createIterResultObject(engine, Primitive::undefinedValue(), true);
Executed by:
  • tst_ecmascripttests
716
123-
124 return
executed 7043 times by 1 test: return g->resume(engine, argc ? argv[0] : Primitive::undefinedValue());
Executed by:
  • tst_ecmascripttests
g->resume(engine, argc ? argv[0] : Primitive::undefinedValue());
executed 7043 times by 1 test: return g->resume(engine, argc ? argv[0] : Primitive::undefinedValue());
Executed by:
  • tst_ecmascripttests
7043
125}-
126-
127ReturnedValue GeneratorPrototype::method_return(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
128{-
129 ExecutionEngine *engine = f->engine();-
130 const GeneratorObject *g = thisObject->as<GeneratorObject>();-
131 if (!g
!gDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 500 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| g->d()->state == GeneratorState::Executing
g->d()->state ...ate::ExecutingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 496 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-500
132 return
executed 84 times by 1 test: return engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
engine->throwTypeError();
executed 84 times by 1 test: return engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
84
133-
134 Heap::GeneratorObject *gp = g->d();-
135-
136 if (gp->state == GeneratorState::SuspendedStart
gp->state == G...SuspendedStartDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 492 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-492
137 gp->state = GeneratorState::Completed;
executed 4 times by 1 test: gp->state = GeneratorState::Completed;
Executed by:
  • tst_ecmascripttests
4
138-
139 if (gp->state == GeneratorState::Completed
gp->state == G...ate::CompletedDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 488 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8-488
140 return
executed 8 times by 1 test: return IteratorPrototype::createIterResultObject(engine, argc ? argv[0] : Primitive::undefinedValue(), true);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(engine, argc ? argv[0] : Primitive::undefinedValue(), true);
executed 8 times by 1 test: return IteratorPrototype::createIterResultObject(engine, argc ? argv[0] : Primitive::undefinedValue(), true);
Executed by:
  • tst_ecmascripttests
8
141-
142-
143-
144 engine->throwError(Primitive::emptyValue());-
145-
146 return
executed 488 times by 1 test: return g->resume(engine, argc ? argv[0]: Primitive::undefinedValue());
Executed by:
  • tst_ecmascripttests
g->resume(engine, argc ? argv[0]: Primitive::undefinedValue());
executed 488 times by 1 test: return g->resume(engine, argc ? argv[0]: Primitive::undefinedValue());
Executed by:
  • tst_ecmascripttests
488
147}-
148-
149ReturnedValue GeneratorPrototype::method_throw(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
150{-
151 ExecutionEngine *engine = f->engine();-
152 const GeneratorObject *g = thisObject->as<GeneratorObject>();-
153 if (!g
!gDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| g->d()->state == GeneratorState::Executing
g->d()->state ...ate::ExecutingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-80
154 return
executed 84 times by 1 test: return engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
engine->throwTypeError();
executed 84 times by 1 test: return engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
84
155-
156 Heap::GeneratorObject *gp = g->d();-
157-
158 engine->throwError(argc ? argv[0]: Primitive::undefinedValue());-
159-
160 if (gp->state == GeneratorState::SuspendedStart
gp->state == G...SuspendedStartDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| gp->state == GeneratorState::Completed
gp->state == G...ate::CompletedDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
4-56
161 gp->state = GeneratorState::Completed;-
162 return
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
163 }-
164-
165 return
executed 52 times by 1 test: return g->resume(engine, Primitive::undefinedValue());
Executed by:
  • tst_ecmascripttests
g->resume(engine, Primitive::undefinedValue());
executed 52 times by 1 test: return g->resume(engine, Primitive::undefinedValue());
Executed by:
  • tst_ecmascripttests
52
166}-
167-
168ReturnedValue GeneratorObject::resume(ExecutionEngine *engine, const Value &arg) const-
169{-
170 Heap::GeneratorObject *gp = d();-
171 gp->state = GeneratorState::Executing;-
172 gp->cppFrame.parent = engine->currentStackFrame;-
173 engine->currentStackFrame = &gp->cppFrame;-
174-
175 ((gp->cppFrame.yield != nullptr) ? static_cast<void>(0) : qt_assert("gp->cppFrame.yield != nullptr", __FILE__, 219));-
176 const char *code = gp->cppFrame.yield;-
177 gp->cppFrame.yield = nullptr;-
178 gp->cppFrame.jsFrame->accumulator = arg;-
179-
180 Scope scope(engine);-
181 ScopedValue result(scope, Moth::VME::interpret(&gp->cppFrame, engine, code));-
182-
183 engine->currentStackFrame = gp->cppFrame.parent;-
184-
185 bool done = (gp->cppFrame.yield == nullptr);-
186 gp->state = done
doneDescription
TRUEevaluated 5756 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1834 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? GeneratorState::Completed : GeneratorState::SuspendedYield;
1834-5756
187 if (engine->hasException
engine->hasExceptionDescription
TRUEevaluated 612 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 6985 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
612-6985
188 return
executed 612 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 612 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
612
189 return
executed 6985 times by 1 test: return IteratorPrototype::createIterResultObject(engine, result, done);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(engine, result, done);
executed 6985 times by 1 test: return IteratorPrototype::createIterResultObject(engine, result, done);
Executed by:
  • tst_ecmascripttests
6985
190}-
191-
192const QV4::VTable MemberGeneratorFunction::static_vtbl = { (std::is_same<MemberGeneratorFunction::SuperClass, Object>::value) ? nullptr : &MemberGeneratorFunction::SuperClass::static_vtbl, (sizeof(MemberGeneratorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(MemberGeneratorFunction::Data) + (MemberGeneratorFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(MemberGeneratorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), MemberGeneratorFunction::IsExecutionContext, MemberGeneratorFunction::IsString, MemberGeneratorFunction::IsObject, MemberGeneratorFunction::IsFunctionObject, MemberGeneratorFunction::IsErrorObject, MemberGeneratorFunction::IsArrayData, MemberGeneratorFunction::IsStringOrSymbol, MemberGeneratorFunction::MyType, { 0, 0, 0, 0 }, "MemberGeneratorFunction", MemberGeneratorFunction::virtualDestroy, MemberGeneratorFunction::Data::markObjects, MemberGeneratorFunction::virtualIsEqualTo, MemberGeneratorFunction::virtualGet, MemberGeneratorFunction::virtualPut, MemberGeneratorFunction::virtualDeleteProperty, MemberGeneratorFunction::virtualHasProperty, MemberGeneratorFunction::virtualGetOwnProperty, MemberGeneratorFunction::virtualDefineOwnProperty, MemberGeneratorFunction::virtualIsExtensible, MemberGeneratorFunction::virtualPreventExtensions, MemberGeneratorFunction::virtualGetPrototypeOf, MemberGeneratorFunction::virtualSetPrototypeOf, MemberGeneratorFunction::virtualGetLength, MemberGeneratorFunction::virtualAdvanceIterator, MemberGeneratorFunction::virtualInstanceOf, MemberGeneratorFunction::virtualCall, MemberGeneratorFunction::virtualCallAsConstructor, };-
193-
194Heap::FunctionObject *MemberGeneratorFunction::create(ExecutionContext *context, Function *function)-
195{-
196 Scope scope(context);-
197 Scoped<GeneratorFunction> g(scope, context->engine()->memoryManager->allocate<MemberGeneratorFunction>(context, function));-
198 ScopedObject proto(scope, scope.engine->newObject());-
199 proto->setPrototypeOf(scope.engine->generatorPrototype());-
200 g->defineDefaultProperty(scope.engine->id_prototype(), proto, Attr_NotConfigurable|Attr_NotEnumerable);-
201 g->setPrototypeOf(ScopedObject(scope, scope.engine->generatorFunctionCtor()->get(scope.engine->id_prototype())));-
202 return
executed 3044 times by 1 test: return g->d();
Executed by:
  • tst_ecmascripttests
g->d();
executed 3044 times by 1 test: return g->d();
Executed by:
  • tst_ecmascripttests
3044
203}-
204-
205ReturnedValue MemberGeneratorFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *, int, const Value *)-
206{-
207 return
never executed: return f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Function is not a constructor.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Function is not a constructor." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Function is not a constructor.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Function is not a constructor." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
never executed: return f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Function is not a constructor.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Function is not a constructor." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
0
208}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0