Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jit/qv4jithelpers.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | namespace QV4 { | - | ||||||||||||||||||
6 | namespace JIT { | - | ||||||||||||||||||
7 | namespace Helpers { | - | ||||||||||||||||||
8 | - | |||||||||||||||||||
9 | void convertThisToObject(ExecutionEngine *engine, Value *t) | - | ||||||||||||||||||
10 | { | - | ||||||||||||||||||
11 | if (!t->isObject()
| 0-14 | ||||||||||||||||||
12 | if (t->isNullOrUndefined()
| 0 | ||||||||||||||||||
13 | *t = engine->globalObject->asReturnedValue(); | - | ||||||||||||||||||
14 | } never executed: else {end of block | 0 | ||||||||||||||||||
15 | *t = t->toObject(engine)->asReturnedValue(); | - | ||||||||||||||||||
16 | } never executed: end of block | 0 | ||||||||||||||||||
17 | } | - | ||||||||||||||||||
18 | } executed 14 times by 1 test: end of block Executed by:
| 14 | ||||||||||||||||||
19 | - | |||||||||||||||||||
20 | ReturnedValue loadGlobalLookup(ExecutionEngine *engine, Function *f, int index) | - | ||||||||||||||||||
21 | { | - | ||||||||||||||||||
22 | Lookup *l = f->compilationUnit->runtimeLookups + index; | - | ||||||||||||||||||
23 | return executed 44 times by 3 tests: l->globalGetter(l, engine);return l->globalGetter(l, engine); Executed by:
executed 44 times by 3 tests: return l->globalGetter(l, engine); Executed by:
| 44 | ||||||||||||||||||
24 | } | - | ||||||||||||||||||
25 | - | |||||||||||||||||||
26 | ReturnedValue loadSuperConstructor(ExecutionEngine *engine, const Value *t) | - | ||||||||||||||||||
27 | { | - | ||||||||||||||||||
28 | if (!t->isObject()
| 0 | ||||||||||||||||||
29 | engine->throwTypeError(); | - | ||||||||||||||||||
30 | return never executed: Encode::undefined();return Encode::undefined(); never executed: return Encode::undefined(); | 0 | ||||||||||||||||||
31 | } | - | ||||||||||||||||||
32 | return never executed: static_cast<const Object *>(t)->getPrototypeOf()->asReturnedValue();return static_cast<const Object *>(t)->getPrototypeOf()->asReturnedValue(); never executed: return static_cast<const Object *>(t)->getPrototypeOf()->asReturnedValue(); | 0 | ||||||||||||||||||
33 | } | - | ||||||||||||||||||
34 | - | |||||||||||||||||||
35 | ReturnedValue toObject(ExecutionEngine *engine, const Value &obj) | - | ||||||||||||||||||
36 | { | - | ||||||||||||||||||
37 | if (obj.isObject()
| 0 | ||||||||||||||||||
38 | return never executed: obj.asReturnedValue();return obj.asReturnedValue(); never executed: return obj.asReturnedValue(); | 0 | ||||||||||||||||||
39 | - | |||||||||||||||||||
40 | return never executed: obj.toObject(engine)->asReturnedValue();return obj.toObject(engine)->asReturnedValue(); never executed: return obj.toObject(engine)->asReturnedValue(); | 0 | ||||||||||||||||||
41 | } | - | ||||||||||||||||||
42 | - | |||||||||||||||||||
43 | ReturnedValue exp(const Value &base, const Value &exp) | - | ||||||||||||||||||
44 | { | - | ||||||||||||||||||
45 | double b = base.toNumber(); | - | ||||||||||||||||||
46 | double e = exp.toNumber(); | - | ||||||||||||||||||
47 | if (qt_is_inf(e)
| 0 | ||||||||||||||||||
48 | return never executed: Encode(qt_snan());return Encode(qt_snan()); never executed: return Encode(qt_snan()); | 0 | ||||||||||||||||||
49 | return never executed: Encode(pow(b,e));return Encode(pow(b,e)); never executed: return Encode(pow(b,e)); | 0 | ||||||||||||||||||
50 | } | - | ||||||||||||||||||
51 | - | |||||||||||||||||||
52 | ReturnedValue getLookup(ExecutionEngine *engine, Function *f, int index, const Value &base) | - | ||||||||||||||||||
53 | { | - | ||||||||||||||||||
54 | Lookup *l = f->compilationUnit->runtimeLookups + index; | - | ||||||||||||||||||
55 | return executed 176 times by 3 tests: l->getter(l, engine, base);return l->getter(l, engine, base); Executed by:
executed 176 times by 3 tests: return l->getter(l, engine, base); Executed by:
| 176 | ||||||||||||||||||
56 | } | - | ||||||||||||||||||
57 | - | |||||||||||||||||||
58 | void setLookup(Function *f, int index, Value &base, const Value &value) | - | ||||||||||||||||||
59 | { | - | ||||||||||||||||||
60 | ExecutionEngine *engine = f->internalClass->engine; | - | ||||||||||||||||||
61 | QV4::Lookup *l = f->compilationUnit->runtimeLookups + index; | - | ||||||||||||||||||
62 | if (!l->setter(l, engine, base, value)
| 0 | ||||||||||||||||||
63 | engine->throwTypeError(); never executed: engine->throwTypeError(); | 0 | ||||||||||||||||||
64 | } never executed: end of block | 0 | ||||||||||||||||||
65 | - | |||||||||||||||||||
66 | void pushBlockContext(Value *stack, int index) | - | ||||||||||||||||||
67 | { | - | ||||||||||||||||||
68 | ExecutionContext *c = static_cast<ExecutionContext *>(stack + CallData::Context); | - | ||||||||||||||||||
69 | stack[CallData::Context] = Runtime::method_createBlockContext(c, index); | - | ||||||||||||||||||
70 | } never executed: end of block | 0 | ||||||||||||||||||
71 | - | |||||||||||||||||||
72 | void cloneBlockContext(Value *contextSlot) | - | ||||||||||||||||||
73 | { | - | ||||||||||||||||||
74 | *contextSlot = Runtime::method_cloneBlockContext(static_cast<QV4::ExecutionContext *>(contextSlot)); | - | ||||||||||||||||||
75 | } never executed: end of block | 0 | ||||||||||||||||||
76 | - | |||||||||||||||||||
77 | void pushScriptContext(Value *stack, ExecutionEngine *engine, int index) | - | ||||||||||||||||||
78 | { | - | ||||||||||||||||||
79 | stack[CallData::Context] = Runtime::method_createScriptContext(engine, index); | - | ||||||||||||||||||
80 | } never executed: end of block | 0 | ||||||||||||||||||
81 | - | |||||||||||||||||||
82 | void popScriptContext(Value *stack, ExecutionEngine *engine) | - | ||||||||||||||||||
83 | { | - | ||||||||||||||||||
84 | stack[CallData::Context] = Runtime::method_popScriptContext(engine); | - | ||||||||||||||||||
85 | } never executed: end of block | 0 | ||||||||||||||||||
86 | - | |||||||||||||||||||
87 | ReturnedValue deleteProperty(QV4::Function *function, const QV4::Value &base, const QV4::Value &index) | - | ||||||||||||||||||
88 | { | - | ||||||||||||||||||
89 | auto engine = function->internalClass->engine; | - | ||||||||||||||||||
90 | if (!Runtime::method_deleteProperty(engine, base, index)
| 0 | ||||||||||||||||||
91 | if (function->isStrict()
| 0 | ||||||||||||||||||
92 | engine->throwTypeError(); never executed: engine->throwTypeError(); | 0 | ||||||||||||||||||
93 | return never executed: Encode(false);return Encode(false); never executed: return Encode(false); | 0 | ||||||||||||||||||
94 | } else { | - | ||||||||||||||||||
95 | return never executed: Encode(true);return Encode(true); never executed: return Encode(true); | 0 | ||||||||||||||||||
96 | } | - | ||||||||||||||||||
97 | } | - | ||||||||||||||||||
98 | - | |||||||||||||||||||
99 | ReturnedValue deleteName(Function *function, int name) | - | ||||||||||||||||||
100 | { | - | ||||||||||||||||||
101 | auto engine = function->internalClass->engine; | - | ||||||||||||||||||
102 | if (!Runtime::method_deleteName(engine, name)
| 0 | ||||||||||||||||||
103 | if (function->isStrict()
| 0 | ||||||||||||||||||
104 | engine->throwTypeError(); never executed: engine->throwTypeError(); | 0 | ||||||||||||||||||
105 | return never executed: Encode(false);return Encode(false); never executed: return Encode(false); | 0 | ||||||||||||||||||
106 | } else { | - | ||||||||||||||||||
107 | return never executed: Encode(true);return Encode(true); never executed: return Encode(true); | 0 | ||||||||||||||||||
108 | } | - | ||||||||||||||||||
109 | } | - | ||||||||||||||||||
110 | - | |||||||||||||||||||
111 | } | - | ||||||||||||||||||
112 | } | - | ||||||||||||||||||
113 | } | - | ||||||||||||||||||
114 | - | |||||||||||||||||||
Switch to Source code | Preprocessed file |