Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4function.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | using namespace QV4; | - | ||||||
9 | - | |||||||
10 | ReturnedValue 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: result;return result; Executed by:
executed 2773696 times by 134 tests: return result; Executed by:
| 2773696 | ||||||
26 | } | - | ||||||
27 | - | |||||||
28 | Function::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
| 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:
| 109752 | ||||||
43 | - | |||||||
44 | const quint32_le *formalsIndices = compiledFunction->formalsTable(); | - | ||||||
45 | for (quint32 i = 0; i < compiledFunction->nFormals
| 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:
| 1764265 | ||||||
47 | internalClass = ic->d(); | - | ||||||
48 | - | |||||||
49 | nFormals = compiledFunction->nFormals; | - | ||||||
50 | } executed 3439949 times by 137 tests: end of block Executed by:
| 3439949 | ||||||
51 | - | |||||||
52 | Function::~Function() | - | ||||||
53 | { | - | ||||||
54 | delete codeRef; | - | ||||||
55 | } executed 3442436 times by 137 tests: end of block Executed by:
| 3442436 | ||||||
56 | - | |||||||
57 | void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArray> ¶meters) | - | ||||||
58 | { | - | ||||||
59 | QStringList parameterNames; | - | ||||||
60 | - | |||||||
61 | - | |||||||
62 | for (int i = 0, ei = parameters.count(); i != ei
| 10-12 | ||||||
63 | const QByteArray ¶m = parameters.at(i); | - | ||||||
64 | int duplicate = -1; | - | ||||||
65 | - | |||||||
66 | for (int j = i - 1; j >= 0
| 2-12 | ||||||
67 | const QByteArray &prevParam = parameters.at(j); | - | ||||||
68 | if (param == prevParam
| 0-2 | ||||||
69 | duplicate = j; | - | ||||||
70 | break; never executed: break; | 0 | ||||||
71 | } | - | ||||||
72 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
73 | - | |||||||
74 | if (duplicate == -1
| 0-12 | ||||||
75 | parameterNames.append(QString::fromUtf8(param)); | - | ||||||
76 | } executed 12 times by 4 tests: else {end of block Executed by:
| 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
| 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 ¶meterName : 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:
| 12 | ||||||
98 | nFormals = parameters.size(); | - | ||||||
99 | } executed 10 times by 4 tests: end of block Executed by:
| 10 | ||||||
100 | - | |||||||
101 | QQmlSourceLocation Function::sourceLocation() const | - | ||||||
102 | { | - | ||||||
103 | return executed 90 times by 8 tests: QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column); Executed by:
executed 90 times by 8 tests: return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column); Executed by:
| 90 | ||||||
104 | } | - | ||||||
105 | - | |||||||
106 | - | |||||||
Switch to Source code | Preprocessed file |