| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4argumentsobject_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||||||||
| 2 | ** | - | ||||||||||||
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||||||||
| 4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||||||||
| 5 | ** | - | ||||||||||||
| 6 | ** This file is part of the QtQml module of the Qt Toolkit. | - | ||||||||||||
| 7 | ** | - | ||||||||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||||||||
| 9 | ** Commercial License Usage | - | ||||||||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||||||||
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||||||||
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||||||||
| 16 | ** | - | ||||||||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||||||||
| 19 | ** General Public License version 3 as published by the Free Software | - | ||||||||||||
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||||||||
| 21 | ** packaging of this file. Please review the following information to | - | ||||||||||||
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||||||||
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||||||||
| 24 | ** | - | ||||||||||||
| 25 | ** GNU General Public License Usage | - | ||||||||||||
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||||||||
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||||||||
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||||||||
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||||||||
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||||||||
| 31 | ** included in the packaging of this file. Please review the following | - | ||||||||||||
| 32 | ** information to ensure the GNU General Public License requirements will | - | ||||||||||||
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||||||||
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||||||||
| 35 | ** | - | ||||||||||||
| 36 | ** $QT_END_LICENSE$ | - | ||||||||||||
| 37 | ** | - | ||||||||||||
| 38 | ****************************************************************************/ | - | ||||||||||||
| 39 | #ifndef QV4ARGUMENTSOBJECTS_H | - | ||||||||||||
| 40 | #define QV4ARGUMENTSOBJECTS_H | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | // | - | ||||||||||||
| 43 | // W A R N I N G | - | ||||||||||||
| 44 | // ------------- | - | ||||||||||||
| 45 | // | - | ||||||||||||
| 46 | // This file is not part of the Qt API. It exists purely as an | - | ||||||||||||
| 47 | // implementation detail. This header file may change from version to | - | ||||||||||||
| 48 | // version without notice, or even be removed. | - | ||||||||||||
| 49 | // | - | ||||||||||||
| 50 | // We mean it. | - | ||||||||||||
| 51 | // | - | ||||||||||||
| 52 | - | |||||||||||||
| 53 | #include "qv4object_p.h" | - | ||||||||||||
| 54 | #include "qv4functionobject_p.h" | - | ||||||||||||
| 55 | - | |||||||||||||
| 56 | QT_BEGIN_NAMESPACE | - | ||||||||||||
| 57 | - | |||||||||||||
| 58 | namespace QV4 { | - | ||||||||||||
| 59 | - | |||||||||||||
| 60 | namespace Heap { | - | ||||||||||||
| 61 | - | |||||||||||||
| 62 | #define ArgumentsGetterFunctionMembers(class, Member) \ | - | ||||||||||||
| 63 | Member(class, NoMark, uint, index) | - | ||||||||||||
| 64 | - | |||||||||||||
| 65 | DECLARE_HEAP_OBJECT(ArgumentsGetterFunction, FunctionObject) { | - | ||||||||||||
| 66 | DECLARE_MARKOBJECTS(ArgumentsGetterFunction); never executed: end of block | 0 | ||||||||||||
| 67 | inline void init(QV4::ExecutionContext *scope, uint index); | - | ||||||||||||
| 68 | }; | - | ||||||||||||
| 69 | - | |||||||||||||
| 70 | #define ArgumentsSetterFunctionMembers(class, Member) \ | - | ||||||||||||
| 71 | Member(class, NoMark, uint, index) | - | ||||||||||||
| 72 | - | |||||||||||||
| 73 | DECLARE_HEAP_OBJECT(ArgumentsSetterFunction, FunctionObject) { | - | ||||||||||||
| 74 | DECLARE_MARKOBJECTS(ArgumentsSetterFunction); never executed: end of block | 0 | ||||||||||||
| 75 | inline void init(QV4::ExecutionContext *scope, uint index); | - | ||||||||||||
| 76 | }; | - | ||||||||||||
| 77 | - | |||||||||||||
| 78 | #define ArgumentsObjectMembers(class, Member) \ | - | ||||||||||||
| 79 | Member(class, Pointer, CallContext *, context) \ | - | ||||||||||||
| 80 | Member(class, Pointer, MemberData *, mappedArguments) \ | - | ||||||||||||
| 81 | Member(class, NoMark, bool, fullyCreated) \ | - | ||||||||||||
| 82 | Member(class, NoMark, int, nFormals) | - | ||||||||||||
| 83 | - | |||||||||||||
| 84 | DECLARE_HEAP_OBJECT(ArgumentsObject, Object) { | - | ||||||||||||
| 85 | DECLARE_MARKOBJECTS(ArgumentsObject); executed 4 times by 1 test: end of blockExecuted by:
executed 4 times by 1 test: o->context.heapObject()->mark(stack);Executed by:
never executed: o->mappedArguments.heapObject()->mark(stack);
| 0-4 | ||||||||||||
| 86 | enum { | - | ||||||||||||
| 87 | LengthPropertyIndex = 0, | - | ||||||||||||
| 88 | SymbolIteratorPropertyIndex = 1, | - | ||||||||||||
| 89 | CalleePropertyIndex = 2 | - | ||||||||||||
| 90 | }; | - | ||||||||||||
| 91 | void init(CppStackFrame *frame); | - | ||||||||||||
| 92 | }; | - | ||||||||||||
| 93 | - | |||||||||||||
| 94 | #define StrictArgumentsObjectMembers(class, Member) | - | ||||||||||||
| 95 | - | |||||||||||||
| 96 | DECLARE_HEAP_OBJECT(StrictArgumentsObject, Object) { | - | ||||||||||||
| 97 | enum { | - | ||||||||||||
| 98 | LengthPropertyIndex = 0, | - | ||||||||||||
| 99 | SymbolIteratorPropertyIndex = 1, | - | ||||||||||||
| 100 | CalleePropertyIndex = 2 | - | ||||||||||||
| 101 | }; | - | ||||||||||||
| 102 | void init(CppStackFrame *frame); | - | ||||||||||||
| 103 | }; | - | ||||||||||||
| 104 | - | |||||||||||||
| 105 | } | - | ||||||||||||
| 106 | - | |||||||||||||
| 107 | struct ArgumentsGetterFunction: FunctionObject | - | ||||||||||||
| 108 | { | - | ||||||||||||
| 109 | V4_OBJECT2(ArgumentsGetterFunction, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 4694 times by 1 test: return &static_vtbl;Executed by:
executed 3223 times by 1 test: return static_cast<QV4::Heap::ArgumentsGetterFunction *>(m());Executed by:
executed 1660 times by 1 test: return dptr;Executed by:
| 0-4694 | ||||||||||||
| 110 | - | |||||||||||||
| 111 | uint index() const { return d()->index; } executed 96 times by 1 test: return d()->index;Executed by:
| 96 | ||||||||||||
| 112 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 113 | }; | - | ||||||||||||
| 114 | - | |||||||||||||
| 115 | inline void | - | ||||||||||||
| 116 | Heap::ArgumentsGetterFunction::init(QV4::ExecutionContext *scope, uint index) | - | ||||||||||||
| 117 | { | - | ||||||||||||
| 118 | Heap::FunctionObject::init(scope); | - | ||||||||||||
| 119 | this->index = index; | - | ||||||||||||
| 120 | } executed 1565 times by 1 test: end of blockExecuted by:
| 1565 | ||||||||||||
| 121 | - | |||||||||||||
| 122 | struct ArgumentsSetterFunction: FunctionObject | - | ||||||||||||
| 123 | { | - | ||||||||||||
| 124 | V4_OBJECT2(ArgumentsSetterFunction, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 4691 times by 1 test: return &static_vtbl;Executed by:
executed 3234 times by 1 test: return static_cast<QV4::Heap::ArgumentsSetterFunction *>(m());Executed by:
executed 1669 times by 1 test: return dptr;Executed by:
| 0-4691 | ||||||||||||
| 125 | - | |||||||||||||
| 126 | uint index() const { return d()->index; } executed 102 times by 1 test: return d()->index;Executed by:
| 102 | ||||||||||||
| 127 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 128 | }; | - | ||||||||||||
| 129 | - | |||||||||||||
| 130 | inline void | - | ||||||||||||
| 131 | Heap::ArgumentsSetterFunction::init(QV4::ExecutionContext *scope, uint index) | - | ||||||||||||
| 132 | { | - | ||||||||||||
| 133 | Heap::FunctionObject::init(scope); | - | ||||||||||||
| 134 | this->index = index; | - | ||||||||||||
| 135 | } executed 1567 times by 1 test: end of blockExecuted by:
| 1567 | ||||||||||||
| 136 | - | |||||||||||||
| 137 | - | |||||||||||||
| 138 | struct ArgumentsObject: Object { | - | ||||||||||||
| 139 | V4_OBJECT2(ArgumentsObject, Object) executed 30057 times by 36 tests: end of blockExecuted by:
never executed: end of blockexecuted 169827 times by 153 tests: return &static_vtbl;Executed by:
executed 11555 times by 4 tests: return static_cast<QV4::Heap::ArgumentsObject *>(m());Executed by:
executed 11560 times by 4 tests: return dptr;Executed by:
| 0-169827 | ||||||||||||
| 140 | Q_MANAGED_TYPE(ArgumentsObject) | - | ||||||||||||
| 141 | - | |||||||||||||
| 142 | Heap::CallContext *context() const { return d()->context; } executed 4090 times by 4 tests: return d()->context;Executed by:
| 4090 | ||||||||||||
| 143 | bool fullyCreated() const { return d()->fullyCreated; } executed 4952 times by 4 tests: return d()->fullyCreated;Executed by:
| 4952 | ||||||||||||
| 144 | - | |||||||||||||
| 145 | static bool isNonStrictArgumentsObject(Managed *m) { | - | ||||||||||||
| 146 | return m->vtable() == staticVTable(); executed 25667 times by 3 tests: return m->vtable() == staticVTable();Executed by:
| 25667 | ||||||||||||
| 147 | } | - | ||||||||||||
| 148 | - | |||||||||||||
| 149 | static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *desc, PropertyAttributes attrs); | - | ||||||||||||
| 150 | static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty); | - | ||||||||||||
| 151 | static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver); | - | ||||||||||||
| 152 | static bool virtualDeleteProperty(Managed *m, PropertyKey id); | - | ||||||||||||
| 153 | static PropertyAttributes virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p); | - | ||||||||||||
| 154 | static qint64 virtualGetLength(const Managed *m); | - | ||||||||||||
| 155 | - | |||||||||||||
| 156 | void fullyCreate(); | - | ||||||||||||
| 157 | - | |||||||||||||
| 158 | }; | - | ||||||||||||
| 159 | - | |||||||||||||
| 160 | struct StrictArgumentsObject : Object { | - | ||||||||||||
| 161 | V4_OBJECT2(StrictArgumentsObject, Object) never executed: end of blocknever executed: end of blockexecuted 110509 times by 153 tests: return &static_vtbl;Executed by:
never executed: return static_cast<QV4::Heap::StrictArgumentsObject *>(m());never executed: return dptr; | 0-110509 | ||||||||||||
| 162 | Q_MANAGED_TYPE(ArgumentsObject) | - | ||||||||||||
| 163 | }; | - | ||||||||||||
| 164 | - | |||||||||||||
| 165 | } | - | ||||||||||||
| 166 | - | |||||||||||||
| 167 | QT_END_NAMESPACE | - | ||||||||||||
| 168 | - | |||||||||||||
| 169 | #endif | - | ||||||||||||
| 170 | - | |||||||||||||
| Source code | Switch to Preprocessed file |