Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4stackframe_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | namespace QV4 { | - | ||||||
8 | - | |||||||
9 | struct CallData | - | ||||||
10 | { | - | ||||||
11 | enum Offsets { | - | ||||||
12 | Function = 0, | - | ||||||
13 | Context = 1, | - | ||||||
14 | Accumulator = 2, | - | ||||||
15 | This = 3, | - | ||||||
16 | NewTarget = 4, | - | ||||||
17 | Argc = 5 | - | ||||||
18 | }; | - | ||||||
19 | - | |||||||
20 | Value function; | - | ||||||
21 | Value context; | - | ||||||
22 | Value accumulator; | - | ||||||
23 | Value thisObject; | - | ||||||
24 | Value newTarget; | - | ||||||
25 | Value _argc; | - | ||||||
26 | - | |||||||
27 | int argc() const { | - | ||||||
28 | ((_argc.isInteger()) ? static_cast<void>(0) : qt_assert("_argc.isInteger()", __FILE__, 71)); | - | ||||||
29 | return executed 2207750 times by 130 tests: _argc.int_32();return _argc.int_32(); Executed by:
executed 2207750 times by 130 tests: return _argc.int_32(); Executed by:
| 2207750 | ||||||
30 | } | - | ||||||
31 | - | |||||||
32 | void setArgc(int argc) { | - | ||||||
33 | ((argc >= 0) ? static_cast<void>(0) : qt_assert("argc >= 0", __FILE__, 76)); | - | ||||||
34 | _argc.setInt_32(argc); | - | ||||||
35 | } executed 19862422 times by 135 tests: end of block Executed by:
| 19862422 | ||||||
36 | - | |||||||
37 | inline ReturnedValue argument(int i) const { | - | ||||||
38 | return never executed: i < argc() ? args[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue();return i < argc() ? args[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue(); never executed: return i < argc() ? args[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue(); | 0 | ||||||
39 | } | - | ||||||
40 | - | |||||||
41 | Value args[1]; | - | ||||||
42 | - | |||||||
43 | static constexpr int HeaderSize() { return | - | ||||||
44 | __builtin_offsetof ( | - | ||||||
45 | CallData | - | ||||||
46 | , | - | ||||||
47 | args | - | ||||||
48 | ) | - | ||||||
49 | / sizeof(QV4::Value); } | - | ||||||
50 | }; | - | ||||||
51 | - | |||||||
52 | static_assert(bool(std::is_standard_layout<CallData>::value), "std::is_standard_layout<CallData>::value"); | - | ||||||
53 | static_assert(bool( | - | ||||||
54 | __builtin_offsetof ( | - | ||||||
55 | CallData | - | ||||||
56 | , | - | ||||||
57 | thisObject | - | ||||||
58 | ) | - | ||||||
59 | == CallData::This*sizeof(Value)), "offsetof(CallData, thisObject) == CallData::This*sizeof(Value)"); | - | ||||||
60 | static_assert(bool( | - | ||||||
61 | __builtin_offsetof ( | - | ||||||
62 | CallData | - | ||||||
63 | , | - | ||||||
64 | args | - | ||||||
65 | ) | - | ||||||
66 | == 6*sizeof(Value)), "offsetof(CallData, args) == 6*sizeof(Value)"); | - | ||||||
67 | - | |||||||
68 | struct CppStackFrame { | - | ||||||
69 | EngineBase *engine; | - | ||||||
70 | Value *savedStackTop; | - | ||||||
71 | CppStackFrame *parent; | - | ||||||
72 | Function *v4Function; | - | ||||||
73 | CallData *jsFrame; | - | ||||||
74 | const Value *originalArguments; | - | ||||||
75 | int originalArgumentsCount; | - | ||||||
76 | int instructionPointer; | - | ||||||
77 | const char *yield; | - | ||||||
78 | const char *unwindHandler; | - | ||||||
79 | const char *unwindLabel; | - | ||||||
80 | int unwindLevel; | - | ||||||
81 | - | |||||||
82 | void init(EngineBase *engine, Function *v4Function, const Value *argv, int argc) { | - | ||||||
83 | this->engine = engine; | - | ||||||
84 | - | |||||||
85 | this->v4Function = v4Function; | - | ||||||
86 | originalArguments = argv; | - | ||||||
87 | originalArgumentsCount = argc; | - | ||||||
88 | instructionPointer = 0; | - | ||||||
89 | yield = nullptr; | - | ||||||
90 | unwindHandler = nullptr; | - | ||||||
91 | unwindLabel = nullptr; | - | ||||||
92 | unwindLevel = 0; | - | ||||||
93 | } executed 17775220 times by 135 tests: end of block Executed by:
| 17775220 | ||||||
94 | - | |||||||
95 | void push() { | - | ||||||
96 | parent = engine->currentStackFrame; | - | ||||||
97 | engine->currentStackFrame = this; | - | ||||||
98 | savedStackTop = engine->jsStackTop; | - | ||||||
99 | } executed 17779491 times by 135 tests: end of block Executed by:
| 17779491 | ||||||
100 | - | |||||||
101 | void pop() { | - | ||||||
102 | engine->currentStackFrame = parent; | - | ||||||
103 | engine->jsStackTop = savedStackTop; | - | ||||||
104 | } executed 17723791 times by 135 tests: end of block Executed by:
| 17723791 | ||||||
105 | QString source() const; | - | ||||||
106 | QString function() const; | - | ||||||
107 | inline QV4::ExecutionContext *context() const { | - | ||||||
108 | return executed 8691557 times by 29 tests: static_cast<ExecutionContext *>(&jsFrame->context);return static_cast<ExecutionContext *>(&jsFrame->context); Executed by:
executed 8691557 times by 29 tests: return static_cast<ExecutionContext *>(&jsFrame->context); Executed by:
| 8691557 | ||||||
109 | } | - | ||||||
110 | int lineNumber() const; | - | ||||||
111 | - | |||||||
112 | inline QV4::Heap::CallContext *callContext() const { | - | ||||||
113 | Heap::ExecutionContext *ctx = static_cast<ExecutionContext &>(jsFrame->context).d(); | - | ||||||
114 | while (ctx->type != Heap::ExecutionContext::Type_CallContext
| 0 | ||||||
115 | ctx = ctx->outer; never executed: ctx = ctx->outer; | 0 | ||||||
116 | return never executed: static_cast<Heap::CallContext *>(ctx);return static_cast<Heap::CallContext *>(ctx); never executed: return static_cast<Heap::CallContext *>(ctx); | 0 | ||||||
117 | } | - | ||||||
118 | ReturnedValue thisObject() const; | - | ||||||
119 | }; | - | ||||||
120 | - | |||||||
121 | } | - | ||||||
122 | - | |||||||
123 | - | |||||||
Switch to Source code | Preprocessed file |