OpenCoverage

qv4function.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4function.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8using namespace QV4;-
9-
10ReturnedValue Function::call(const Value *thisObject, const Value *argv, int argc, const ExecutionContext *context) {-
11 ExecutionEngine *engine = context->engine();-
12 CppStackFrame frame;-
13 frame.init(engine, this, argv, argc);-
14 frame.setupJSFrame(engine->jsStackTop, Primitive::undefinedValue(), context->d(),-
15 thisObject ? *thisObject : Primitive::undefinedValue(),-
16 Primitive::undefinedValue());-
17-
18 frame.push();-
19 engine->jsStackTop += frame.requiredJSStackFrameSize();-
20-
21 ReturnedValue result = Moth::VME::exec(&frame, engine);-
22-
23 frame.pop();-
24-
25 return
executed 2773696 times by 134 tests: return result;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
result;
executed 2773696 times by 134 tests: return result;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
2773696
26}-
27-
28Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function)-
29 : compiledFunction(function)-
30 , compilationUnit(unit)-
31 , codeData(function->code())-
32 , jittedCode(nullptr)-
33 , codeRef(nullptr)-
34 , hasQmlDependencies(function->hasQmlDependencies())-
35{-
36 Scope scope(engine);-
37 Scoped<InternalClass> ic(scope, engine->internalClasses(EngineBase::Class_CallContext));-
38-
39-
40 const quint32_le *localsIndices = compiledFunction->localsTable();-
41 for (quint32 i = 0; i < compiledFunction->nLocals
i < compiledFunction->nLocalsDescription
TRUEevaluated 109752 times by 14 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlconsole
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmlxmlhttprequest
  • tst_qquickworkerscript
  • tst_qv4debugger
FALSEevaluated 3439129 times by 137 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
; ++i)
109752-3439129
42 ic = ic->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
executed 109752 times by 14 tests: ic = ic->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlconsole
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmlxmlhttprequest
  • tst_qquickworkerscript
  • tst_qv4debugger
109752
43-
44 const quint32_le *formalsIndices = compiledFunction->formalsTable();-
45 for (quint32 i = 0; i < compiledFunction->nFormals
i < compiledFunction->nFormalsDescription
TRUEevaluated 1764175 times by 56 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlprofilerservice
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlsqldatabase
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickaccessible
  • tst_qquickanimatedsprite
  • ...
FALSEevaluated 3440292 times by 137 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
; ++i)
1764175-3440292
46 ic = ic->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[formalsIndices[i]]), Attr_NotConfigurable);
executed 1764265 times by 56 tests: ic = ic->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[formalsIndices[i]]), Attr_NotConfigurable);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlprofilerservice
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlsqldatabase
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickaccessible
  • tst_qquickanimatedsprite
  • ...
1764265
47 internalClass = ic->d();-
48-
49 nFormals = compiledFunction->nFormals;-
50}
executed 3439949 times by 137 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
3439949
51-
52Function::~Function()-
53{-
54 delete codeRef;-
55}
executed 3442436 times by 137 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
3442436
56-
57void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArray> &parameters)-
58{-
59 QStringList parameterNames;-
60-
61-
62 for (int i = 0, ei = parameters.count(); i != ei
i != eiDescription
TRUEevaluated 12 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
; ++i) {
10-12
63 const QByteArray &param = parameters.at(i);-
64 int duplicate = -1;-
65-
66 for (int j = i - 1; j >= 0
j >= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlconnections
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
; --j) {
2-12
67 const QByteArray &prevParam = parameters.at(j);-
68 if (param == prevParam
param == prevParamDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlconnections
) {
0-2
69 duplicate = j;-
70 break;
never executed: break;
0
71 }-
72 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlconnections
2
73-
74 if (duplicate == -1
duplicate == -1Description
TRUEevaluated 12 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
FALSEnever evaluated
) {
0-12
75 parameterNames.append(QString::fromUtf8(param));-
76 }
executed 12 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
else {
12
77 const QString &dup = parameterNames[duplicate];-
78 parameterNames.append(dup);-
79 parameterNames[duplicate] =-
80 QString(0xfffe) + QString::number(duplicate) + dup;-
81 }
never executed: end of block
0
82-
83 }-
84-
85 internalClass = engine->internalClasses(EngineBase::Class_CallContext);-
86-
87-
88 const quint32_le *localsIndices = compiledFunction->localsTable();-
89 for (quint32 i = 0; i < compiledFunction->nLocals
i < compiledFunction->nLocalsDescription
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
; ++i)
0-10
90 internalClass = internalClass->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
never executed: internalClass = internalClass->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
0
91-
92 Scope scope(engine);-
93 ScopedString arg(scope);-
94 for (const QString &parameterName : parameterNames) {-
95 arg = engine->newIdentifier(parameterName);-
96 internalClass = internalClass->addMember(arg->propertyKey(), Attr_NotConfigurable);-
97 }
executed 12 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
12
98 nFormals = parameters.size();-
99}
executed 10 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlconnections
  • tst_qquickapplication
10
100-
101QQmlSourceLocation Function::sourceLocation() const-
102{-
103 return
executed 90 times by 8 tests: return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlprofilerservice
  • tst_qqmlproperty
  • tst_qqmlpropertymap
  • tst_qqmlvaluetypes
  • tst_qquickpathview
  • tst_qquicktextinput
QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);
executed 90 times by 8 tests: return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlprofilerservice
  • tst_qqmlproperty
  • tst_qqmlpropertymap
  • tst_qqmlvaluetypes
  • tst_qquickpathview
  • tst_qquicktextinput
90
104}-
105-
106-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0