OpenCoverage

qv4functionobject.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4functionobject.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8using namespace QV4;-
9-
10-
11const QV4::VTable FunctionObject::static_vtbl = { (std::is_same<FunctionObject::SuperClass, Object>::value) ? nullptr : &FunctionObject::SuperClass::static_vtbl, (sizeof(FunctionObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(FunctionObject::Data) + (FunctionObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(FunctionObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), FunctionObject::IsExecutionContext, FunctionObject::IsString, FunctionObject::IsObject, FunctionObject::IsFunctionObject, FunctionObject::IsErrorObject, FunctionObject::IsArrayData, FunctionObject::IsStringOrSymbol, FunctionObject::MyType, { 0, 0, 0, 0 }, "FunctionObject", FunctionObject::virtualDestroy, FunctionObject::Data::markObjects, FunctionObject::virtualIsEqualTo, FunctionObject::virtualGet, FunctionObject::virtualPut, FunctionObject::virtualDeleteProperty, FunctionObject::virtualHasProperty, FunctionObject::virtualGetOwnProperty, FunctionObject::virtualDefineOwnProperty, FunctionObject::virtualIsExtensible, FunctionObject::virtualPreventExtensions, FunctionObject::virtualGetPrototypeOf, FunctionObject::virtualSetPrototypeOf, FunctionObject::virtualGetLength, FunctionObject::virtualAdvanceIterator, FunctionObject::virtualInstanceOf, FunctionObject::virtualCall, FunctionObject::virtualCallAsConstructor, };-
12-
13void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name,-
14 ReturnedValue (*code)(const QV4::FunctionObject *, const Value *thisObject, const Value *argv, int argc))-
15{-
16 jsCall = code;-
17 jsConstruct = QV4::FunctionObject::virtualCallAsConstructor;-
18-
19 Object::init();-
20 this->scope.set(scope->engine(), scope->d());-
21 Scope s(scope->engine());-
22 ScopedFunctionObject f(s, this);-
23 if (name
nameDescription
TRUEevaluated 34321871 times by 153 tests
Evaluated 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
  • ...
FALSEevaluated 99063 times by 153 tests
Evaluated 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
  • ...
)
99063-34321871
24 f->setName(name);
executed 34317055 times by 153 tests: f->setName(name);
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
  • ...
34317055
25}
executed 34351957 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
  • ...
34351957
26-
27void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name, bool createProto)-
28{-
29 jsCall = vtable()->call;-
30 jsConstruct = vtable()->callAsConstructor;-
31-
32 Object::init();-
33 this->scope.set(scope->engine(), scope->d());-
34 Scope s(scope->engine());-
35 ScopedFunctionObject f(s, this);-
36 if (name
nameDescription
TRUEevaluated 3180157 times by 153 tests
Evaluated 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
  • ...
FALSEevaluated 180222 times by 153 tests
Evaluated 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
  • ...
)
180222-3180157
37 f->setName(name);
executed 3178928 times by 153 tests: f->setName(name);
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
  • ...
3178928
38-
39 if (createProto
createProtoDescription
TRUEnever evaluated
FALSEevaluated 3359402 times by 153 tests
Evaluated 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
  • ...
)
0-3359402
40 f->createDefaultPrototypeProperty(Heap::FunctionObject::Index_Prototype, Heap::FunctionObject::Index_ProtoConstructor);
never executed: f->createDefaultPrototypeProperty(Heap::FunctionObject::Index_Prototype, Heap::FunctionObject::Index_ProtoConstructor);
0
41}
executed 3358433 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
  • ...
3358433
42-
43-
44-
45void Heap::FunctionObject::init(QV4::ExecutionContext *scope, Function *function, bool createProto)-
46{-
47 jsCall = vtable()->call;-
48 jsConstruct = vtable()->callAsConstructor;-
49-
50 Object::init();-
51 setFunction(function);-
52 this->scope.set(scope->engine(), scope->d());-
53 Scope s(scope->engine());-
54 ScopedString name(s, function->name());-
55 ScopedFunctionObject f(s, this);-
56 if (name
nameDescription
TRUEevaluated 90 times by 8 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
FALSEnever evaluated
)
0-90
57 f->setName(name);
executed 90 times by 8 tests: f->setName(name);
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
90
58-
59 if (createProto
createProtoDescription
TRUEnever evaluated
FALSEevaluated 90 times by 8 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
)
0-90
60 f->createDefaultPrototypeProperty(Heap::FunctionObject::Index_Prototype, Heap::FunctionObject::Index_ProtoConstructor);
never executed: f->createDefaultPrototypeProperty(Heap::FunctionObject::Index_Prototype, Heap::FunctionObject::Index_ProtoConstructor);
0
61}
executed 90 times by 8 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
90
62-
63void Heap::FunctionObject::init(QV4::ExecutionContext *scope, const QString &name, bool createProto)-
64{-
65 Scope valueScope(scope);-
66 ScopedString s(valueScope, valueScope.engine->newString(name));-
67 init(scope, s, createProto);-
68}
executed 3083351 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
  • ...
3083351
69-
70void Heap::FunctionObject::init()-
71{-
72 jsCall = vtable()->call;-
73 jsConstruct = vtable()->callAsConstructor;-
74-
75 Object::init();-
76 this->scope.set(internalClass->engine, internalClass->engine->rootContext()->d());-
77 ((internalClass && internalClass->find(internalClass->engine->id_prototype()->propertyKey()) == Index_Prototype) ? static_cast<void>(0) : qt_assert("internalClass && internalClass->find(internalClass->engine->id_prototype()->propertyKey()) == Index_Prototype", __FILE__, 137));-
78 setProperty(internalClass->engine, Index_Prototype, Primitive::undefinedValue());-
79}
executed 1621011 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
  • ...
1621011
80-
81void Heap::FunctionObject::setFunction(Function *f)-
82{-
83 if (f
fDescription
TRUEevaluated 1522818 times by 62 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
44-1522818
84 function = f;-
85 function->compilationUnit->addref();-
86 }
executed 1524066 times by 62 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1524066
87}
executed 1524161 times by 62 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1524161
88void Heap::FunctionObject::destroy()-
89{-
90 if (function
functionDescription
TRUEevaluated 1525791 times by 62 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
FALSEevaluated 37877975 times by 153 tests
Evaluated 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
  • ...
)
1525791-37877975
91 function->compilationUnit->release();
executed 1525800 times by 62 tests: function->compilationUnit->release();
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1525800
92 Object::destroy();-
93}
executed 39395632 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
  • ...
39395632
94-
95void FunctionObject::createDefaultPrototypeProperty(uint protoSlot, uint protoConstructorSlot)-
96{-
97 Scope s(this);-
98-
99 ((internalClass() && internalClass()->find(s.engine->id_prototype()->propertyKey()) == protoSlot) ? static_cast<void>(0) : qt_assert("internalClass() && internalClass()->find(s.engine->id_prototype()->propertyKey()) == protoSlot", __FILE__, 159));-
100 ((s.engine->internalClasses(EngineBase::Class_ObjectProto)->find(s.engine->id_constructor()->propertyKey()) == protoConstructorSlot) ? static_cast<void>(0) : qt_assert("s.engine->internalClasses(EngineBase::Class_ObjectProto)->find(s.engine->id_constructor()->propertyKey()) == protoConstructorSlot", __FILE__, 160));-
101-
102 ScopedObject proto(s, s.engine->newObject(s.engine->internalClasses(EngineBase::Class_ObjectProto)));-
103 proto->setProperty(protoConstructorSlot, d());-
104 setProperty(protoSlot, proto);-
105}
executed 1523507 times by 62 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1523507
106-
107ReturnedValue FunctionObject::name() const-
108{-
109 return
executed 891471 times by 153 tests: return get(scope()->internalClass->engine->id_name());
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
  • ...
get(scope()->internalClass->engine->id_name());
executed 891471 times by 153 tests: return get(scope()->internalClass->engine->id_name());
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
  • ...
891471
110}-
111-
112ReturnedValue FunctionObject::virtualCallAsConstructor(const FunctionObject *f, const Value *, int, const Value *)-
113{-
114 return
executed 302 times by 1 test: return f->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
f->engine()->throwTypeError();
executed 302 times by 1 test: return f->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
302
115}-
116-
117ReturnedValue FunctionObject::virtualCall(const FunctionObject *, const Value *, const Value *, int)-
118{-
119 return
executed 16 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 16 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
120}-
121-
122Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function)-
123{-
124 return
executed 1508812 times by 62 tests: return scope->engine()->memoryManager->allocate<ScriptFunction>(scope, function);
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
scope->engine()->memoryManager->allocate<ScriptFunction>(scope, function);
executed 1508812 times by 62 tests: return scope->engine()->memoryManager->allocate<ScriptFunction>(scope, function);
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1508812
125}-
126-
127Heap::FunctionObject *FunctionObject::createConstructorFunction(ExecutionContext *scope, Function *function, bool isDerivedConstructor)-
128{-
129 if (!function
!functionDescription
TRUEevaluated 8353 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 660 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
660-8353
130 Heap::DefaultClassConstructorFunction *c = scope->engine()->memoryManager->allocate<DefaultClassConstructorFunction>(scope);-
131 c->isDerivedConstructor = isDerivedConstructor;-
132 return
executed 8358 times by 1 test: return c;
Executed by:
  • tst_ecmascripttests
c;
executed 8358 times by 1 test: return c;
Executed by:
  • tst_ecmascripttests
8358
133 }-
134 Heap::ConstructorFunction *c = scope->engine()->memoryManager->allocate<ConstructorFunction>(scope, function);-
135 c->isDerivedConstructor = isDerivedConstructor;-
136 return
executed 660 times by 1 test: return c;
Executed by:
  • tst_ecmascripttests
c;
executed 660 times by 1 test: return c;
Executed by:
  • tst_ecmascripttests
660
137}-
138-
139Heap::FunctionObject *FunctionObject::createMemberFunction(ExecutionContext *scope, Function *function)-
140{-
141 return
executed 4735 times by 1 test: return scope->engine()->memoryManager->allocate<MemberFunction>(scope, function);
Executed by:
  • tst_ecmascripttests
scope->engine()->memoryManager->allocate<MemberFunction>(scope, function);
executed 4735 times by 1 test: return scope->engine()->memoryManager->allocate<MemberFunction>(scope, function);
Executed by:
  • tst_ecmascripttests
4735
142}-
143-
144Heap::FunctionObject *FunctionObject::createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount)-
145{-
146 Scope scope(engine);-
147 ScopedString name(scope, nameOrSymbol);-
148 if (!name
!nameDescription
TRUEevaluated 494366 times by 153 tests
Evaluated 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
  • ...
FALSEevaluated 33854654 times by 153 tests
Evaluated 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
  • ...
)
494366-33854654
149 name = engine->newString(QChar::fromLatin1('[') + nameOrSymbol->toQString().midRef(1) + QChar::fromLatin1(']'));
executed 493746 times by 153 tests: name = engine->newString(QChar::fromLatin1('[') + nameOrSymbol->toQString().midRef(1) + QChar::fromLatin1(']'));
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
  • ...
493746
150-
151 ScopedFunctionObject function(scope, engine->memoryManager->allocate<FunctionObject>(engine->rootContext(), name, code));-
152 function->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(argumentCount));-
153 return
executed 34288646 times by 153 tests: return function->d();
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
  • ...
function->d();
executed 34288646 times by 153 tests: return function->d();
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
  • ...
34288646
154}-
155-
156bool FunctionObject::isBinding() const-
157{-
158 return
executed 742 times by 13 tests: return d()->vtable() == QQmlBindingFunction::staticVTable();
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlstatemachine
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
d()->vtable() == QQmlBindingFunction::staticVTable();
executed 742 times by 13 tests: return d()->vtable() == QQmlBindingFunction::staticVTable();
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlstatemachine
  • tst_qqmlvaluetypes
  • tst_qquickitem2
  • tst_qquickloader
742
159}-
160-
161bool FunctionObject::isBoundFunction() const-
162{-
163 return
executed 4289625 times by 17 tests: return d()->vtable() == BoundFunction::staticVTable();
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickworkerscript
d()->vtable() == BoundFunction::staticVTable();
executed 4289625 times by 17 tests: return d()->vtable() == BoundFunction::staticVTable();
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickworkerscript
4289625
164}-
165-
166QQmlSourceLocation FunctionObject::sourceLocation() const-
167{-
168 return
never executed: return d()->function->sourceLocation();
d()->function->sourceLocation();
never executed: return d()->function->sourceLocation();
0
169}-
170-
171const QV4::VTable FunctionCtor::static_vtbl = { (std::is_same<FunctionCtor::SuperClass, Object>::value) ? nullptr : &FunctionCtor::SuperClass::static_vtbl, (sizeof(FunctionCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(FunctionCtor::Data) + (FunctionCtor::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(FunctionCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), FunctionCtor::IsExecutionContext, FunctionCtor::IsString, FunctionCtor::IsObject, FunctionCtor::IsFunctionObject, FunctionCtor::IsErrorObject, FunctionCtor::IsArrayData, FunctionCtor::IsStringOrSymbol, FunctionCtor::MyType, { 0, 0, 0, 0 }, "FunctionCtor", FunctionCtor::virtualDestroy, FunctionCtor::Data::markObjects, FunctionCtor::virtualIsEqualTo, FunctionCtor::virtualGet, FunctionCtor::virtualPut, FunctionCtor::virtualDeleteProperty, FunctionCtor::virtualHasProperty, FunctionCtor::virtualGetOwnProperty, FunctionCtor::virtualDefineOwnProperty, FunctionCtor::virtualIsExtensible, FunctionCtor::virtualPreventExtensions, FunctionCtor::virtualGetPrototypeOf, FunctionCtor::virtualSetPrototypeOf, FunctionCtor::virtualGetLength, FunctionCtor::virtualAdvanceIterator, FunctionCtor::virtualInstanceOf, FunctionCtor::virtualCall, FunctionCtor::virtualCallAsConstructor, };-
172-
173void Heap::FunctionCtor::init(QV4::ExecutionContext *scope)-
174{-
175 Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "Function")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Function" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98685 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 98685 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
  • ...
}()));
98685
176}
executed 98961 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
  • ...
98961
177-
178-
179QQmlRefPointer<CompiledData::CompilationUnit> FunctionCtor::parse(ExecutionEngine *engine, const Value *argv, int argc, Type t)-
180{-
181 QString arguments;-
182 QString body;-
183 if (argc > 0
argc > 0Description
TRUEevaluated 818 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
FALSEevaluated 180 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
180-818
184 for (int i = 0, ei = argc - 1; i < ei
i < eiDescription
TRUEevaluated 548 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
FALSEevaluated 820 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
; ++i) {
548-820
185 if (i
iDescription
TRUEevaluated 174 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 374 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
)
174-374
186 arguments += QLatin1String(", ");
executed 176 times by 1 test: arguments += QLatin1String(", ");
Executed by:
  • tst_ecmascripttests
176
187 arguments += argv[i].toQString();-
188 }
executed 547 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
547
189 body = argv[argc - 1].toQString();-
190 }
executed 825 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
825
191 if (engine->hasException
engine->hasExceptionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 993 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
)
12-993
192 return
executed 12 times by 1 test: return nullptr;
Executed by:
  • tst_ecmascripttests
nullptr;
executed 12 times by 1 test: return nullptr;
Executed by:
  • tst_ecmascripttests
12
193-
194 QString function = (t == Type_Function
t == Type_FunctionDescription
TRUEevaluated 867 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? QLatin1String("function anonymous(") : QLatin1String("function* anonymous(")) + arguments + QLatin1String("\n){") + body + QLatin1String("\n}");
120-867
195-
196 QQmlJS::Engine ee;-
197 QQmlJS::Lexer lexer(&ee);-
198 lexer.setCode(function, 1, false);-
199 QQmlJS::Parser parser(&ee);-
200-
201 const bool parsed = parser.parseExpression();-
202-
203 if (!parsed
!parsedDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 952 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
) {
36-952
204 engine->throwSyntaxError(QLatin1String("Parse error"));-
205 return
executed 36 times by 1 test: return nullptr;
Executed by:
  • tst_ecmascripttests
nullptr;
executed 36 times by 1 test: return nullptr;
Executed by:
  • tst_ecmascripttests
36
206 }-
207-
208 QQmlJS::AST::FunctionExpression *fe = QQmlJS::AST::cast<QQmlJS::AST::FunctionExpression *>(parser.rootNode());-
209 if (!fe
!feDescription
TRUEnever evaluated
FALSEevaluated 951 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
) {
0-951
210 engine->throwSyntaxError(QLatin1String("Parse error"));-
211 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
212 }-
213-
214 Compiler::Module module(engine->debugger() != nullptr);-
215-
216 Compiler::JSUnitGenerator jsGenerator(&module);-
217 RuntimeCodegen cg(engine, &jsGenerator, false);-
218 cg.generateFromFunctionExpression(QString(), function, fe, &module);-
219-
220 if (engine->hasException
engine->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 935 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
)
16-935
221 return
executed 16 times by 1 test: return nullptr;
Executed by:
  • tst_ecmascripttests
nullptr;
executed 16 times by 1 test: return nullptr;
Executed by:
  • tst_ecmascripttests
16
222-
223 return
executed 934 times by 2 tests: return cg.generateCompilationUnit();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
cg.generateCompilationUnit();
executed 934 times by 2 tests: return cg.generateCompilationUnit();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
934
224}-
225-
226ReturnedValue FunctionCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *)-
227{-
228 ExecutionEngine *engine = f->engine();-
229-
230 QQmlRefPointer<CompiledData::CompilationUnit> compilationUnit = parse(engine, argv, argc, Type_Function);-
231 if (engine->hasException
engine->hasExceptionDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 823 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
)
56-823
232 return
executed 56 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 56 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
56
233-
234 Function *vmf = compilationUnit->linkToEngine(engine);-
235 ExecutionContext *global = engine->scriptContext();-
236 return
executed 821 times by 2 tests: return Encode(FunctionObject::createScriptFunction(global, vmf));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
Encode(FunctionObject::createScriptFunction(global, vmf));
executed 821 times by 2 tests: return Encode(FunctionObject::createScriptFunction(global, vmf));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
821
237}-
238-
239-
240ReturnedValue FunctionCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc)-
241{-
242 return
executed 516 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
virtualCallAsConstructor(f, argv, argc, f);
executed 516 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
516
243}-
244-
245const QV4::VTable FunctionPrototype::static_vtbl = { (std::is_same<FunctionPrototype::SuperClass, Object>::value) ? nullptr : &FunctionPrototype::SuperClass::static_vtbl, (sizeof(FunctionPrototype::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(FunctionPrototype::Data) + (FunctionPrototype::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(FunctionPrototype::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), FunctionPrototype::IsExecutionContext, FunctionPrototype::IsString, FunctionPrototype::IsObject, FunctionPrototype::IsFunctionObject, FunctionPrototype::IsErrorObject, FunctionPrototype::IsArrayData, FunctionPrototype::IsStringOrSymbol, FunctionPrototype::MyType, { 0, 0, 0, 0 }, "FunctionPrototype", FunctionPrototype::virtualDestroy, FunctionPrototype::Data::markObjects, FunctionPrototype::virtualIsEqualTo, FunctionPrototype::virtualGet, FunctionPrototype::virtualPut, FunctionPrototype::virtualDeleteProperty, FunctionPrototype::virtualHasProperty, FunctionPrototype::virtualGetOwnProperty, FunctionPrototype::virtualDefineOwnProperty, FunctionPrototype::virtualIsExtensible, FunctionPrototype::virtualPreventExtensions, FunctionPrototype::virtualGetPrototypeOf, FunctionPrototype::virtualSetPrototypeOf, FunctionPrototype::virtualGetLength, FunctionPrototype::virtualAdvanceIterator, FunctionPrototype::virtualInstanceOf, FunctionPrototype::virtualCall, FunctionPrototype::virtualCallAsConstructor, };-
246-
247void Heap::FunctionPrototype::init()-
248{-
249 Heap::FunctionObject::init();-
250}
executed 98817 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
  • ...
98817
251-
252void FunctionPrototype::init(ExecutionEngine *engine, Object *ctor)-
253{-
254 Scope scope(engine);-
255 ScopedObject o(scope);-
256-
257 ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1));-
258 ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));-
259-
260 defineReadonlyConfigurableProperty(engine->id_name(), *engine->id_empty());-
261 defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(0));-
262 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 98860 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 98860 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
  • ...
}()), (o = ctor));
98860
263 defineDefaultProperty(engine->id_toString(), method_toString, 0);-
264 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "apply")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "apply" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99069 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 99069 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_apply, 2);
99069
265 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "call")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "call" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99094 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 99094 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_call, 1);
99094
266 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "bind")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bind" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99066 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 99066 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_bind, 1);
99066
267 defineDefaultProperty(engine->symbol_hasInstance(), method_hasInstance, 1, Attr_ReadOnly);-
268}
executed 99035 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
  • ...
99035
269-
270ReturnedValue FunctionPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int)-
271{-
272 ExecutionEngine *v4 = b->engine();-
273 const FunctionObject *fun = thisObject->as<FunctionObject>();-
274 if (!fun
!funDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
FALSEevaluated 1306 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
)
22-1306
275 return
executed 22 times by 2 tests: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
v4->throwTypeError();
executed 22 times by 2 tests: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
22
276-
277 const Scope scope(fun->engine());-
278 const ScopedString scopedFunctionName(scope, fun->name());-
279 const QString functionName(scopedFunctionName ? scopedFunctionName->toQString() : QString());-
280 QString functionAsString = ([]() noexcept -> QString { enum { Size = sizeof(u"" "function")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "function" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());-
281-
282-
283-
284 if (!functionName.isEmpty()
!functionName.isEmpty()Description
TRUEevaluated 600 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
FALSEevaluated 706 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
)
600-706
285 functionAsString.append(QLatin1Char(' ') + functionName);
executed 600 times by 4 tests: functionAsString.append(QLatin1Char(' ') + functionName);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
600
286-
287 functionAsString.append(([]() noexcept -> QString { enum { Size = sizeof(u"" "() { [code] }")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "() { [code] }" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 1306 times by 4 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
qstring_literal_temp;
executed 1306 times by 4 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
}()));
1306
288-
289 return
executed 1306 times by 4 tests: return Encode(v4->newString(functionAsString));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
Encode(v4->newString(functionAsString));
executed 1306 times by 4 tests: return Encode(v4->newString(functionAsString));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
1306
290}-
291-
292ReturnedValue FunctionPrototype::method_apply(const QV4::FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
293{-
294 ExecutionEngine *v4 = b->engine();-
295 const FunctionObject *f = thisObject->as<FunctionObject>();-
296 if (!f
!fDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 259 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qv4debugger
)
19-259
297 return
executed 19 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 19 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
19
298 thisObject = argc
argcDescription
TRUEevaluated 231 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qv4debugger
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? argv : nullptr;
28-231
299 if (argc < 2
argc < 2Description
TRUEevaluated 142 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 116 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qv4debugger
|| argv[1].isNullOrUndefined()
argv[1].isNullOrUndefined()Description
TRUEnever evaluated
FALSEevaluated 116 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qv4debugger
)
0-142
300 return
executed 141 times by 1 test: return f->call(thisObject, argv, 0);
Executed by:
  • tst_ecmascripttests
f->call(thisObject, argv, 0);
executed 141 times by 1 test: return f->call(thisObject, argv, 0);
Executed by:
  • tst_ecmascripttests
141
301-
302 Object *arr = argv[1].objectValue();-
303 if (!arr
!arrDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 108 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qv4debugger
)
8-108
304 return
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
305-
306 uint len = arr->getLength();-
307-
308 Scope scope(v4);-
309 Value *arguments = scope.alloc(len);-
310 if (len
lenDescription
TRUEevaluated 98 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qv4debugger
) {
10-98
311 if (ArgumentsObject::isNonStrictArgumentsObject(arr)
ArgumentsObjec...ntsObject(arr)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& !arr->cast<ArgumentsObject>()->fullyCreated()
!arr->cast<Arg...fullyCreated()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-84
312 QV4::ArgumentsObject *a = arr->cast<ArgumentsObject>();-
313 int l = qMin(len, (uint)a->d()->context->argc());-
314 memcpy(arguments, a->d()->context->args(), l*sizeof(Value));-
315 for (quint32 i = l; i < len
i < lenDescription
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
0-14
316 arguments[i] = Primitive::undefinedValue();
never executed: arguments[i] = Primitive::undefinedValue();
0
317 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else if (arr->arrayType() == Heap::ArrayData::Simple
arr->arrayType...ayData::SimpleDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
&& !arr->protoHasArray()
!arr->protoHasArray()Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
) {
0-84
318 auto sad = static_cast<Heap::SimpleArrayData *>(arr->arrayData());-
319 uint alen = sad
sadDescription
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? sad->values.size : 0;
6-78
320 if (alen > len
alen > lenDescription
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-84
321 alen = len;
never executed: alen = len;
0
322 for (uint i = 0; i < alen
i < alenDescription
TRUEevaluated 226 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
84-226
323 arguments[i] = sad->data(i);
executed 226 times by 1 test: arguments[i] = sad->data(i);
Executed by:
  • tst_ecmascripttests
226
324 for (quint32 i = alen; i < len
i < lenDescription
TRUEevaluated 406 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++i)
84-406
325 arguments[i] = Primitive::undefinedValue();
executed 406 times by 1 test: arguments[i] = Primitive::undefinedValue();
Executed by:
  • tst_ecmascripttests
406
326 }
executed 84 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
84
327 for (quint32 i = 0; i < len
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
328 arguments[i] = arr->get(i);
never executed: arguments[i] = arr->get(i);
0
329 }
never executed: end of block
0
330 }-
331-
332 return
executed 108 times by 2 tests: return f->call(thisObject, arguments, len);
Executed by:
  • tst_ecmascripttests
  • tst_qv4debugger
f->call(thisObject, arguments, len);
executed 108 times by 2 tests: return f->call(thisObject, arguments, len);
Executed by:
  • tst_ecmascripttests
  • tst_qv4debugger
108
333}-
334-
335ReturnedValue FunctionPrototype::method_call(const QV4::FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
336{-
337 if (!thisObject->isFunctionObject()
!thisObject->i...nctionObject()Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 28216 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
)
44-28216
338 return
executed 44 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
b->engine()->throwTypeError();
executed 44 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
44
339-
340 const FunctionObject *f = static_cast<const FunctionObject *>(thisObject);-
341-
342 thisObject = argc
argcDescription
TRUEevaluated 28183 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? argv : nullptr;
34-28183
343 if (argc
argcDescription
TRUEevaluated 28207 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
34-28207
344 ++argv;-
345 --argc;-
346 }
executed 28196 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
28196
347 return
executed 28237 times by 3 tests: return f->call(thisObject, argv, argc);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
f->call(thisObject, argv, argc);
executed 28237 times by 3 tests: return f->call(thisObject, argv, argc);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
28237
348}-
349-
350ReturnedValue FunctionPrototype::method_bind(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
351{-
352 QV4::Scope scope(b);-
353 ScopedFunctionObject target(scope, thisObject);-
354 if (!target
!targetDescription
TRUEevaluated 55 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 568 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
|| target->isBinding()
target->isBinding()Description
TRUEnever evaluated
FALSEevaluated 571 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
)
0-571
355 return
executed 55 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
scope.engine->throwTypeError();
executed 55 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
55
356-
357 ScopedValue boundThis(scope, argc ? argv[0] : Primitive::undefinedValue());-
358 Scoped<MemberData> boundArgs(scope, (Heap::MemberData *)nullptr);-
359-
360 int nArgs = (
(argc - 1 >= 0)Description
TRUEevaluated 451 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEevaluated 114 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argc - 1 >= 0)
(argc - 1 >= 0)Description
TRUEevaluated 451 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEevaluated 114 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? argc - 1 : 0;
114-451
361 if (target->isBoundFunction()
target->isBoundFunction()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 543 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
) {
22-543
362 BoundFunction *bound = static_cast<BoundFunction *>(target.getPointer());-
363 Scoped<MemberData> oldArgs(scope, bound->boundArgs());-
364 boundThis = bound->boundThis();-
365 int oldSize = !oldArgs
!oldArgsDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
? 0 : oldArgs->size();
2-20
366 if (oldSize + nArgs
oldSize + nArgsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
2-20
367 boundArgs = MemberData::allocate(scope.engine, oldSize + nArgs);-
368 boundArgs->d()->values.size = oldSize + nArgs;-
369 for (uint i = 0; i < static_cast<uint>(oldSize)
i < static_cast<uint>(oldSize)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
; ++i)
2
370 boundArgs->set(scope.engine, i, oldArgs->data()[i]);
executed 2 times by 1 test: boundArgs->set(scope.engine, i, oldArgs->data()[i]);
Executed by:
  • tst_qjsengine
2
371 for (uint i = 0; i < static_cast<uint>(nArgs)
i < static_cast<uint>(nArgs)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
; ++i)
2
372 boundArgs->set(scope.engine, oldSize + i, argv[i + 1]);
executed 2 times by 1 test: boundArgs->set(scope.engine, oldSize + i, argv[i + 1]);
Executed by:
  • tst_qjsengine
2
373 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qjsengine
2
374 target = bound->target();-
375 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
else if (nArgs
nArgsDescription
TRUEevaluated 88 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEevaluated 461 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
22-461
376 boundArgs = MemberData::allocate(scope.engine, nArgs);-
377 boundArgs->d()->values.size = nArgs;-
378 for (uint i = 0, ei = static_cast<uint>(nArgs); i < ei
i < eiDescription
TRUEevaluated 136 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEevaluated 90 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
; ++i)
90-136
379 boundArgs->set(scope.engine, i, argv[i + 1]);
executed 136 times by 3 tests: boundArgs->set(scope.engine, i, argv[i + 1]);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
136
380 }
executed 90 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
90
381-
382 ScopedContext ctx(scope, target->scope());-
383 Heap::BoundFunction *bound = BoundFunction::create(ctx, target, boundThis, boundArgs);-
384 bound->setFunction(target->function());-
385 return
executed 574 times by 3 tests: return bound->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
bound->asReturnedValue();
executed 574 times by 3 tests: return bound->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
574
386}-
387-
388ReturnedValue FunctionPrototype::method_hasInstance(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
389{-
390 if (!argc
!argcDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4235391 times by 11 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickworkerscript
)
8-4235391
391 return
executed 8 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
8
392 const Object *o = thisObject->as<Object>();-
393 if (!o
!oDescription
TRUEnever evaluated
FALSEevaluated 4250958 times by 11 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickworkerscript
)
0-4250958
394 return
never executed: return f->engine()->throwTypeError();
f->engine()->throwTypeError();
never executed: return f->engine()->throwTypeError();
0
395-
396 return
executed 4247077 times by 11 tests: return Object::virtualInstanceOf(o, argv[0]);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickworkerscript
Object::virtualInstanceOf(o, argv[0]);
executed 4247077 times by 11 tests: return Object::virtualInstanceOf(o, argv[0]);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickworkerscript
4247077
397}-
398-
399const QV4::VTable ScriptFunction::static_vtbl = { (std::is_same<ScriptFunction::SuperClass, Object>::value) ? nullptr : &ScriptFunction::SuperClass::static_vtbl, (sizeof(ScriptFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ScriptFunction::Data) + (ScriptFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ScriptFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ScriptFunction::IsExecutionContext, ScriptFunction::IsString, ScriptFunction::IsObject, ScriptFunction::IsFunctionObject, ScriptFunction::IsErrorObject, ScriptFunction::IsArrayData, ScriptFunction::IsStringOrSymbol, ScriptFunction::MyType, { 0, 0, 0, 0 }, "ScriptFunction", ScriptFunction::virtualDestroy, ScriptFunction::Data::markObjects, ScriptFunction::virtualIsEqualTo, ScriptFunction::virtualGet, ScriptFunction::virtualPut, ScriptFunction::virtualDeleteProperty, ScriptFunction::virtualHasProperty, ScriptFunction::virtualGetOwnProperty, ScriptFunction::virtualDefineOwnProperty, ScriptFunction::virtualIsExtensible, ScriptFunction::virtualPreventExtensions, ScriptFunction::virtualGetPrototypeOf, ScriptFunction::virtualSetPrototypeOf, ScriptFunction::virtualGetLength, ScriptFunction::virtualAdvanceIterator, ScriptFunction::virtualInstanceOf, ScriptFunction::virtualCall, ScriptFunction::virtualCallAsConstructor, };-
400-
401ReturnedValue ScriptFunction::virtualCallAsConstructor(const FunctionObject *fo, const Value *argv, int argc, const Value *newTarget)-
402{-
403 ExecutionEngine *v4 = fo->engine();-
404 const ScriptFunction *f = static_cast<const ScriptFunction *>(fo);-
405 ((newTarget->isFunctionObject()) ? static_cast<void>(0) : qt_assert("newTarget->isFunctionObject()", __FILE__, 465));-
406 const FunctionObject *nt = static_cast<const FunctionObject *>(newTarget);-
407-
408 Scope scope(v4);-
409 Scoped<InternalClass> ic(scope);-
410 if (nt->d() == f->d()
nt->d() == f->d()Description
TRUEevaluated 14395 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
FALSEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
208-14395
411 ic = f->classForConstructor();-
412 }
executed 14414 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
else {
14414
413 const Object *o = nt->d()->protoProperty();-
414 ic = scope.engine->internalClasses(EngineBase::Class_Object);-
415 if (o
oDescription
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-208
416 ic = ic->changePrototype(o->d());
executed 208 times by 1 test: ic = ic->changePrototype(o->d());
Executed by:
  • tst_ecmascripttests
208
417 }
executed 208 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
208
418 ScopedValue thisObject(scope, v4->memoryManager->allocObject<Object>(ic));-
419-
420 CppStackFrame frame;-
421 frame.init(v4, f->function(), argv, argc);-
422 frame.setupJSFrame(v4->jsStackTop, *f, f->scope(),-
423 thisObject,-
424 newTarget ? *newTarget : Primitive::undefinedValue());-
425-
426 frame.push();-
427 v4->jsStackTop += frame.requiredJSStackFrameSize();-
428-
429 ReturnedValue result = Moth::VME::exec(&frame, v4);-
430-
431 frame.pop();-
432-
433 if (__builtin_expect(!!(v4->hasException), false)
__builtin_expe...ption), false)Description
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
FALSEevaluated 14561 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
)
66-14561
434 return
executed 66 times by 2 tests: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
Encode::undefined();
executed 66 times by 2 tests: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
66
435 else if (!Value::fromReturnedValue(result).isObject()
!Value::fromRe...lt).isObject()Description
TRUEevaluated 14372 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
FALSEevaluated 184 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
)
184-14372
436 return
executed 14376 times by 3 tests: return thisObject->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
thisObject->asReturnedValue();
executed 14376 times by 3 tests: return thisObject->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
14376
437 return
executed 184 times by 2 tests: return result;
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
result;
executed 184 times by 2 tests: return result;
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
184
438}-
439-
440ReturnedValue ScriptFunction::virtualCall(const FunctionObject *fo, const Value *thisObject, const Value *argv, int argc)-
441{-
442 ExecutionEngine *engine = fo->engine();-
443 CppStackFrame frame;-
444 frame.init(engine, fo->function(), argv, argc);-
445 frame.setupJSFrame(engine->jsStackTop, *fo, fo->scope(),-
446 thisObject ? *thisObject : Primitive::undefinedValue(),-
447 Primitive::undefinedValue());-
448-
449 frame.push();-
450 engine->jsStackTop += frame.requiredJSStackFrameSize();-
451-
452 ReturnedValue result = Moth::VME::exec(&frame, engine);-
453-
454 frame.pop();-
455-
456 return
executed 14908599 times by 59 tests: return result;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsettings
  • ...
result;
executed 14908599 times by 59 tests: return result;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsettings
  • ...
14908599
457}-
458-
459void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function)-
460{-
461 FunctionObject::init();-
462 this->scope.set(scope->engine(), scope->d());-
463-
464 setFunction(function);-
465 ((function) ? static_cast<void>(0) : qt_assert("function", __FILE__, 525));-
466-
467 Scope s(scope);-
468 ScopedFunctionObject f(s, this);-
469-
470 ScopedString name(s, function->name());-
471 if (name
nameDescription
TRUEevaluated 1522497 times by 62 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
FALSEnever evaluated
)
0-1522497
472 f->setName(name);
executed 1522416 times by 62 tests: f->setName(name);
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1522416
473 f->createDefaultPrototypeProperty(Heap::FunctionObject::Index_Prototype, Heap::FunctionObject::Index_ProtoConstructor);-
474-
475 ((internalClass && internalClass->find(s.engine->id_length()->propertyKey()) == Index_Length) ? static_cast<void>(0) : qt_assert("internalClass && internalClass->find(s.engine->id_length()->propertyKey()) == Index_Length", __FILE__, 535));-
476 setProperty(s.engine, Index_Length, Primitive::fromInt32(int(function->compiledFunction->length)));-
477}
executed 1523569 times by 62 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
1523569
478-
479Heap::InternalClass *ScriptFunction::classForConstructor() const-
480{-
481 const Object *o = d()->protoProperty();-
482 if (d()->cachedClassForConstructor && d()->cachedClassForConstructor->prototype == o->d()
d()->cachedCla...type == o->d()Description
TRUEevaluated 3208 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-3208
483 return
executed 3208 times by 2 tests: return d()->cachedClassForConstructor;
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
d()->cachedClassForConstructor;
executed 3208 times by 2 tests: return d()->cachedClassForConstructor;
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
3208
484-
485 Scope scope(engine());-
486 Scoped<InternalClass> ic(scope, engine()->internalClasses(EngineBase::Class_Object));-
487 if (o
oDescription
TRUEevaluated 11200 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8-11200
488 ic = ic->changePrototype(o->d());
executed 11200 times by 3 tests: ic = ic->changePrototype(o->d());
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
11200
489 d()->cachedClassForConstructor.set(scope.engine, ic->d());-
490-
491 return
executed 11227 times by 3 tests: return ic->d();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
ic->d();
executed 11227 times by 3 tests: return ic->d();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
11227
492}-
493-
494const QV4::VTable ConstructorFunction::static_vtbl = { (std::is_same<ConstructorFunction::SuperClass, Object>::value) ? nullptr : &ConstructorFunction::SuperClass::static_vtbl, (sizeof(ConstructorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ConstructorFunction::Data) + (ConstructorFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ConstructorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ConstructorFunction::IsExecutionContext, ConstructorFunction::IsString, ConstructorFunction::IsObject, ConstructorFunction::IsFunctionObject, ConstructorFunction::IsErrorObject, ConstructorFunction::IsArrayData, ConstructorFunction::IsStringOrSymbol, ConstructorFunction::MyType, { 0, 0, 0, 0 }, "ConstructorFunction", ConstructorFunction::virtualDestroy, ConstructorFunction::Data::markObjects, ConstructorFunction::virtualIsEqualTo, ConstructorFunction::virtualGet, ConstructorFunction::virtualPut, ConstructorFunction::virtualDeleteProperty, ConstructorFunction::virtualHasProperty, ConstructorFunction::virtualGetOwnProperty, ConstructorFunction::virtualDefineOwnProperty, ConstructorFunction::virtualIsExtensible, ConstructorFunction::virtualPreventExtensions, ConstructorFunction::virtualGetPrototypeOf, ConstructorFunction::virtualSetPrototypeOf, ConstructorFunction::virtualGetLength, ConstructorFunction::virtualAdvanceIterator, ConstructorFunction::virtualInstanceOf, ConstructorFunction::virtualCall, ConstructorFunction::virtualCallAsConstructor, };-
495-
496ReturnedValue ConstructorFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget)-
497{-
498 const ConstructorFunction *c = static_cast<const ConstructorFunction *>(f);-
499 if (!c->d()->isDerivedConstructor
!c->d()->isDerivedConstructorDescription
TRUEevaluated 224 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 376 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
224-376
500 return
executed 224 times by 1 test: return ScriptFunction::virtualCallAsConstructor(f, argv, argc, newTarget);
Executed by:
  • tst_ecmascripttests
ScriptFunction::virtualCallAsConstructor(f, argv, argc, newTarget);
executed 224 times by 1 test: return ScriptFunction::virtualCallAsConstructor(f, argv, argc, newTarget);
Executed by:
  • tst_ecmascripttests
224
501-
502 ExecutionEngine *v4 = f->engine();-
503-
504 CppStackFrame frame;-
505 frame.init(v4, f->function(), argv, argc);-
506 frame.setupJSFrame(v4->jsStackTop, *f, f->scope(),-
507 Primitive::undefinedValue(),-
508 newTarget ? *newTarget : Primitive::undefinedValue());-
509-
510 frame.push();-
511 v4->jsStackTop += frame.requiredJSStackFrameSize();-
512-
513 ReturnedValue result = Moth::VME::exec(&frame, v4);-
514-
515 frame.pop();-
516-
517 if (__builtin_expect(!!(v4->hasException), false)
__builtin_expe...ption), false)Description
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 287 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
88-287
518 return
executed 88 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 88 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
88
519 else if (Value::fromReturnedValue(result).isObject()
Value::fromRet...lt).isObject()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 275 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
12-275
520 return
executed 12 times by 1 test: return result;
Executed by:
  • tst_ecmascripttests
result;
executed 12 times by 1 test: return result;
Executed by:
  • tst_ecmascripttests
12
521 else if (!Value::fromReturnedValue(result).isUndefined()
!Value::fromRe....isUndefined()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 248 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
28-248
522 return
executed 28 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 28 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
28
523 return
executed 248 times by 1 test: return frame.jsFrame->thisObject.asReturnedValue();
Executed by:
  • tst_ecmascripttests
frame.jsFrame->thisObject.asReturnedValue();
executed 248 times by 1 test: return frame.jsFrame->thisObject.asReturnedValue();
Executed by:
  • tst_ecmascripttests
248
524}-
525-
526ReturnedValue ConstructorFunction::virtualCall(const FunctionObject *f, const Value *, const Value *, int)-
527{-
528 return
executed 16 times by 1 test: return f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Cannot call a class constructor without |new|")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Cannot call a class constructor without |new|" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_ecmascripttests
f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Cannot call a class constructor without |new|")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Cannot call a class constructor without |new|" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 16 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 16 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}()));
executed 16 times by 1 test: return f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Cannot call a class constructor without |new|")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Cannot call a class constructor without |new|" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_ecmascripttests
16
529}-
530-
531const QV4::VTable MemberFunction::static_vtbl = { (std::is_same<MemberFunction::SuperClass, Object>::value) ? nullptr : &MemberFunction::SuperClass::static_vtbl, (sizeof(MemberFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(MemberFunction::Data) + (MemberFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(MemberFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), MemberFunction::IsExecutionContext, MemberFunction::IsString, MemberFunction::IsObject, MemberFunction::IsFunctionObject, MemberFunction::IsErrorObject, MemberFunction::IsArrayData, MemberFunction::IsStringOrSymbol, MemberFunction::MyType, { 0, 0, 0, 0 }, "MemberFunction", MemberFunction::virtualDestroy, MemberFunction::Data::markObjects, MemberFunction::virtualIsEqualTo, MemberFunction::virtualGet, MemberFunction::virtualPut, MemberFunction::virtualDeleteProperty, MemberFunction::virtualHasProperty, MemberFunction::virtualGetOwnProperty, MemberFunction::virtualDefineOwnProperty, MemberFunction::virtualIsExtensible, MemberFunction::virtualPreventExtensions, MemberFunction::virtualGetPrototypeOf, MemberFunction::virtualSetPrototypeOf, MemberFunction::virtualGetLength, MemberFunction::virtualAdvanceIterator, MemberFunction::virtualInstanceOf, MemberFunction::virtualCall, MemberFunction::virtualCallAsConstructor, };-
532-
533ReturnedValue MemberFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *, int, const Value *)-
534{-
535 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
536}-
537-
538const QV4::VTable DefaultClassConstructorFunction::static_vtbl = { (std::is_same<DefaultClassConstructorFunction::SuperClass, Object>::value) ? nullptr : &DefaultClassConstructorFunction::SuperClass::static_vtbl, (sizeof(DefaultClassConstructorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(DefaultClassConstructorFunction::Data) + (DefaultClassConstructorFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(DefaultClassConstructorFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), DefaultClassConstructorFunction::IsExecutionContext, DefaultClassConstructorFunction::IsString, DefaultClassConstructorFunction::IsObject, DefaultClassConstructorFunction::IsFunctionObject, DefaultClassConstructorFunction::IsErrorObject, DefaultClassConstructorFunction::IsArrayData, DefaultClassConstructorFunction::IsStringOrSymbol, DefaultClassConstructorFunction::MyType, { 0, 0, 0, 0 }, "DefaultClassConstructorFunction", DefaultClassConstructorFunction::virtualDestroy, DefaultClassConstructorFunction::Data::markObjects, DefaultClassConstructorFunction::virtualIsEqualTo, DefaultClassConstructorFunction::virtualGet, DefaultClassConstructorFunction::virtualPut, DefaultClassConstructorFunction::virtualDeleteProperty, DefaultClassConstructorFunction::virtualHasProperty, DefaultClassConstructorFunction::virtualGetOwnProperty, DefaultClassConstructorFunction::virtualDefineOwnProperty, DefaultClassConstructorFunction::virtualIsExtensible, DefaultClassConstructorFunction::virtualPreventExtensions, DefaultClassConstructorFunction::virtualGetPrototypeOf, DefaultClassConstructorFunction::virtualSetPrototypeOf, DefaultClassConstructorFunction::virtualGetLength, DefaultClassConstructorFunction::virtualAdvanceIterator, DefaultClassConstructorFunction::virtualInstanceOf, DefaultClassConstructorFunction::virtualCall, DefaultClassConstructorFunction::virtualCallAsConstructor, };-
539-
540ReturnedValue DefaultClassConstructorFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget)-
541{-
542 const DefaultClassConstructorFunction *c = static_cast<const DefaultClassConstructorFunction *>(f);-
543 ExecutionEngine *v4 = f->engine();-
544-
545 Scope scope(v4);-
546-
547 if (!c->d()->isDerivedConstructor
!c->d()->isDerivedConstructorDescription
TRUEevaluated 2739 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 359 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
359-2739
548 ScopedObject proto(scope, static_cast<const Object *>(newTarget) ->get(scope.engine->id_prototype()));-
549 ScopedObject c(scope, scope.engine->newObject());-
550 c->setPrototypeUnchecked(proto);-
551 return
executed 2762 times by 1 test: return c->asReturnedValue();
Executed by:
  • tst_ecmascripttests
c->asReturnedValue();
executed 2762 times by 1 test: return c->asReturnedValue();
Executed by:
  • tst_ecmascripttests
2762
552 }-
553-
554 ScopedFunctionObject super(scope, f->getPrototypeOf());-
555 ((super->isFunctionObject()) ? static_cast<void>(0) : qt_assert("super->isFunctionObject()", __FILE__, 615));-
556-
557 CppStackFrame frame;-
558 frame.init(v4, nullptr, argv, argc);-
559 frame.setupJSFrame(v4->jsStackTop, *f, f->scope(),-
560 Primitive::undefinedValue(),-
561 newTarget ? *newTarget : Primitive::undefinedValue(), argc, argc);-
562-
563 frame.push();-
564 v4->jsStackTop += frame.requiredJSStackFrameSize(argc);-
565-
566-
567 ReturnedValue result = super->callAsConstructor(argv, argc, newTarget);-
568-
569 frame.pop();-
570-
571 if (__builtin_expect(!!(v4->hasException), false)
__builtin_expe...ption), false)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 347 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
12-347
572 return
executed 12 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 12 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
573 else if (Value::fromReturnedValue(result).isObject()
Value::fromRet...lt).isObject()Description
TRUEevaluated 348 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-348
574 return
executed 348 times by 1 test: return result;
Executed by:
  • tst_ecmascripttests
result;
executed 348 times by 1 test: return result;
Executed by:
  • tst_ecmascripttests
348
575 else if (!Value::fromReturnedValue(result).isUndefined()
!Value::fromRe....isUndefined()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
576 return
never executed: return v4->throwTypeError();
v4->throwTypeError();
never executed: return v4->throwTypeError();
0
577 return
never executed: return frame.jsFrame->thisObject.asReturnedValue();
frame.jsFrame->thisObject.asReturnedValue();
never executed: return frame.jsFrame->thisObject.asReturnedValue();
0
578}-
579-
580ReturnedValue DefaultClassConstructorFunction::virtualCall(const FunctionObject *f, const Value *, const Value *, int)-
581{-
582 return
executed 20 times by 1 test: return f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Cannot call a class constructor without |new|")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Cannot call a class constructor without |new|" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_ecmascripttests
f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Cannot call a class constructor without |new|")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Cannot call a class constructor without |new|" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 20 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 20 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}()));
executed 20 times by 1 test: return f->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Cannot call a class constructor without |new|")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Cannot call a class constructor without |new|" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_ecmascripttests
20
583}-
584-
585const QV4::VTable IndexedBuiltinFunction::static_vtbl = { (std::is_same<IndexedBuiltinFunction::SuperClass, Object>::value) ? nullptr : &IndexedBuiltinFunction::SuperClass::static_vtbl, (sizeof(IndexedBuiltinFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(IndexedBuiltinFunction::Data) + (IndexedBuiltinFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(IndexedBuiltinFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), IndexedBuiltinFunction::IsExecutionContext, IndexedBuiltinFunction::IsString, IndexedBuiltinFunction::IsObject, IndexedBuiltinFunction::IsFunctionObject, IndexedBuiltinFunction::IsErrorObject, IndexedBuiltinFunction::IsArrayData, IndexedBuiltinFunction::IsStringOrSymbol, IndexedBuiltinFunction::MyType, { 0, 0, 0, 0 }, "IndexedBuiltinFunction", IndexedBuiltinFunction::virtualDestroy, IndexedBuiltinFunction::Data::markObjects, IndexedBuiltinFunction::virtualIsEqualTo, IndexedBuiltinFunction::virtualGet, IndexedBuiltinFunction::virtualPut, IndexedBuiltinFunction::virtualDeleteProperty, IndexedBuiltinFunction::virtualHasProperty, IndexedBuiltinFunction::virtualGetOwnProperty, IndexedBuiltinFunction::virtualDefineOwnProperty, IndexedBuiltinFunction::virtualIsExtensible, IndexedBuiltinFunction::virtualPreventExtensions, IndexedBuiltinFunction::virtualGetPrototypeOf, IndexedBuiltinFunction::virtualSetPrototypeOf, IndexedBuiltinFunction::virtualGetLength, IndexedBuiltinFunction::virtualAdvanceIterator, IndexedBuiltinFunction::virtualInstanceOf, IndexedBuiltinFunction::virtualCall, IndexedBuiltinFunction::virtualCallAsConstructor, };-
586-
587const QV4::VTable BoundFunction::static_vtbl = { (std::is_same<BoundFunction::SuperClass, Object>::value) ? nullptr : &BoundFunction::SuperClass::static_vtbl, (sizeof(BoundFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(BoundFunction::Data) + (BoundFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(BoundFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), BoundFunction::IsExecutionContext, BoundFunction::IsString, BoundFunction::IsObject, BoundFunction::IsFunctionObject, BoundFunction::IsErrorObject, BoundFunction::IsArrayData, BoundFunction::IsStringOrSymbol, BoundFunction::MyType, { 0, 0, 0, 0 }, "BoundFunction", BoundFunction::virtualDestroy, BoundFunction::Data::markObjects, BoundFunction::virtualIsEqualTo, BoundFunction::virtualGet, BoundFunction::virtualPut, BoundFunction::virtualDeleteProperty, BoundFunction::virtualHasProperty, BoundFunction::virtualGetOwnProperty, BoundFunction::virtualDefineOwnProperty, BoundFunction::virtualIsExtensible, BoundFunction::virtualPreventExtensions, BoundFunction::virtualGetPrototypeOf, BoundFunction::virtualSetPrototypeOf, BoundFunction::virtualGetLength, BoundFunction::virtualAdvanceIterator, BoundFunction::virtualInstanceOf, BoundFunction::virtualCall, BoundFunction::virtualCallAsConstructor, };-
588-
589void Heap::BoundFunction::init(QV4::ExecutionContext *scope, QV4::FunctionObject *target,-
590 const Value &boundThis, QV4::MemberData *boundArgs)-
591{-
592 Scope s(scope);-
593 Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "__bound function__")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "__bound function__" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 567 times by 3 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
qstring_literal_temp;
executed 567 times by 3 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
}()));
567
594 this->target.set(s.engine, target->d());-
595 this->boundArgs.set(s.engine, boundArgs ? boundArgs->d() : nullptr);-
596 this->boundThis.set(scope->engine(), boundThis);-
597-
598 ScopedObject f(s, this);-
599-
600 ScopedValue l(s, target->get(s.engine->id_length()));-
601 int len = l->toUInt32();-
602 if (boundArgs
boundArgsDescription
TRUEevaluated 90 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEevaluated 480 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
90-480
603 len -= boundArgs->size();
executed 90 times by 3 tests: len -= boundArgs->size();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
90
604 if (len < 0
len < 0Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 538 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
)
32-538
605 len = 0;
executed 32 times by 1 test: len = 0;
Executed by:
  • tst_ecmascripttests
32
606 f->defineReadonlyConfigurableProperty(s.engine->id_length(), Primitive::fromInt32(len));-
607-
608 ScopedProperty pd(s);-
609 pd->value = s.engine->thrower();-
610 pd->set = s.engine->thrower();-
611 f->insertMember(s.engine->id_arguments(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);-
612 f->insertMember(s.engine->id_caller(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);-
613}
executed 576 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
576
614-
615ReturnedValue BoundFunction::virtualCall(const FunctionObject *fo, const Value *, const Value *argv, int argc)-
616{-
617 const BoundFunction *f = static_cast<const BoundFunction *>(fo);-
618 Scope scope(f->engine());-
619-
620 if (scope.hasException()
scope.hasException()Description
TRUEnever evaluated
FALSEevaluated 186 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
)
0-186
621 return
never executed: return Encode::undefined();
Encode::undefined();
never executed: return Encode::undefined();
0
622-
623 Scoped<MemberData> boundArgs(scope, f->boundArgs());-
624 ScopedFunctionObject target(scope, f->target());-
625 JSCallData jsCallData(scope, (boundArgs ? boundArgs->size() : 0) + argc);-
626 *jsCallData->thisObject = f->boundThis();-
627 Value *argp = jsCallData->args;-
628 if (boundArgs
boundArgsDescription
TRUEevaluated 42 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 143 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
42-143
629 memcpy(argp, boundArgs->data(), boundArgs->size()*sizeof(Value));-
630 argp += boundArgs->size();-
631 }
executed 41 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
41
632 memcpy(argp, argv, argc*sizeof(Value));-
633 return
executed 184 times by 2 tests: return target->call(jsCallData);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
target->call(jsCallData);
executed 184 times by 2 tests: return target->call(jsCallData);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
184
634}-
635-
636ReturnedValue BoundFunction::virtualCallAsConstructor(const FunctionObject *fo, const Value *argv, int argc, const Value *)-
637{-
638 const BoundFunction *f = static_cast<const BoundFunction *>(fo);-
639 Scope scope(f->engine());-
640-
641 if (scope.hasException()
scope.hasException()Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-100
642 return
never executed: return Encode::undefined();
Encode::undefined();
never executed: return Encode::undefined();
0
643-
644 Scoped<MemberData> boundArgs(scope, f->boundArgs());-
645 ScopedFunctionObject target(scope, f->target());-
646 JSCallData jsCallData(scope, (boundArgs ? boundArgs->size() : 0) + argc);-
647 Value *argp = jsCallData->args;-
648 if (boundArgs
boundArgsDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
36-64
649 memcpy(argp, boundArgs->data(), boundArgs->size()*sizeof(Value));-
650 argp += boundArgs->size();-
651 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
36
652 memcpy(argp, argv, argc*sizeof(Value));-
653 return
executed 100 times by 1 test: return target->callAsConstructor(jsCallData);
Executed by:
  • tst_ecmascripttests
target->callAsConstructor(jsCallData);
executed 100 times by 1 test: return target->callAsConstructor(jsCallData);
Executed by:
  • tst_ecmascripttests
100
654}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0