| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4functionobject_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 QV4FUNCTIONOBJECT_H | - | ||||||||||||
| 40 | #define QV4FUNCTIONOBJECT_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 "qv4function_p.h" | - | ||||||||||||
| 55 | #include "qv4context_p.h" | - | ||||||||||||
| 56 | #include <private/qv4mm_p.h> | - | ||||||||||||
| 57 | - | |||||||||||||
| 58 | QT_BEGIN_NAMESPACE | - | ||||||||||||
| 59 | - | |||||||||||||
| 60 | struct QQmlSourceLocation; | - | ||||||||||||
| 61 | - | |||||||||||||
| 62 | namespace QV4 { | - | ||||||||||||
| 63 | - | |||||||||||||
| 64 | struct IndexedBuiltinFunction; | - | ||||||||||||
| 65 | struct JSCallData; | - | ||||||||||||
| 66 | - | |||||||||||||
| 67 | namespace Heap { | - | ||||||||||||
| 68 | - | |||||||||||||
| 69 | - | |||||||||||||
| 70 | #define FunctionObjectMembers(class, Member) \ | - | ||||||||||||
| 71 | Member(class, Pointer, ExecutionContext *, scope) \ | - | ||||||||||||
| 72 | Member(class, NoMark, Function *, function) \ | - | ||||||||||||
| 73 | Member(class, NoMark, VTable::Call, jsCall) \ | - | ||||||||||||
| 74 | Member(class, NoMark, VTable::CallAsConstructor, jsConstruct) | - | ||||||||||||
| 75 | - | |||||||||||||
| 76 | DECLARE_HEAP_OBJECT(FunctionObject, Object) { | - | ||||||||||||
| 77 | DECLARE_MARKOBJECTS(FunctionObject); executed 111380 times by 27 tests: end of blockExecuted by:
executed 111380 times by 27 tests: o->scope.heapObject()->mark(stack);Executed by:
| 0-111380 | ||||||||||||
| 78 | enum { | - | ||||||||||||
| 79 | Index_Prototype = 0, | - | ||||||||||||
| 80 | Index_ProtoConstructor = 0 | - | ||||||||||||
| 81 | }; | - | ||||||||||||
| 82 | - | |||||||||||||
| 83 | Q_QML_PRIVATE_EXPORT void init(QV4::ExecutionContext *scope, QV4::String *name, ReturnedValue (*code)(const QV4::FunctionObject *, const Value *thisObject, const Value *argv, int argc)); | - | ||||||||||||
| 84 | void init(QV4::ExecutionContext *scope, QV4::String *name = nullptr, bool createProto = false); | - | ||||||||||||
| 85 | void init(QV4::ExecutionContext *scope, QV4::Function *function, bool createProto = false); | - | ||||||||||||
| 86 | void init(QV4::ExecutionContext *scope, const QString &name, bool createProto = false); | - | ||||||||||||
| 87 | void init(); | - | ||||||||||||
| 88 | void destroy(); | - | ||||||||||||
| 89 | - | |||||||||||||
| 90 | void setFunction(Function *f); | - | ||||||||||||
| 91 | - | |||||||||||||
| 92 | unsigned int formalParameterCount() { return function ? function->nFormals : 0; } executed 5764 times by 34 tests: return function ? function->nFormals : 0;Executed by:
| 5764 | ||||||||||||
| 93 | unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; } never executed: return function ? function->compiledFunction->nLocals : 0; | 0 | ||||||||||||
| 94 | - | |||||||||||||
| 95 | const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->as<QV4::Object>(); } executed 4285299 times by 12 tests: return propertyData(Index_Prototype)->as<QV4::Object>();Executed by:
| 4285299 | ||||||||||||
| 96 | }; | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | struct FunctionCtor : FunctionObject { | - | ||||||||||||
| 99 | void init(QV4::ExecutionContext *scope); | - | ||||||||||||
| 100 | }; | - | ||||||||||||
| 101 | - | |||||||||||||
| 102 | struct FunctionPrototype : FunctionObject { | - | ||||||||||||
| 103 | void init(); | - | ||||||||||||
| 104 | }; | - | ||||||||||||
| 105 | - | |||||||||||||
| 106 | struct IndexedBuiltinFunction : FunctionObject { | - | ||||||||||||
| 107 | inline void init(QV4::ExecutionContext *scope, uint index, ReturnedValue (*code)(const QV4::FunctionObject *, const Value *, const Value *, int)); | - | ||||||||||||
| 108 | uint index; | - | ||||||||||||
| 109 | }; | - | ||||||||||||
| 110 | - | |||||||||||||
| 111 | #define ScriptFunctionMembers(class, Member) \ | - | ||||||||||||
| 112 | Member(class, Pointer, InternalClass *, cachedClassForConstructor) | - | ||||||||||||
| 113 | - | |||||||||||||
| 114 | DECLARE_HEAP_OBJECT(ScriptFunction, FunctionObject) { | - | ||||||||||||
| 115 | DECLARE_MARKOBJECTS(ScriptFunction) executed 93564 times by 17 tests: end of blockExecuted by:
never executed: o->cachedClassForConstructor.heapObject()->mark(stack);
| 0-93564 | ||||||||||||
| 116 | enum { | - | ||||||||||||
| 117 | Index_Name = FunctionObject::Index_Prototype + 1, | - | ||||||||||||
| 118 | Index_Length | - | ||||||||||||
| 119 | }; | - | ||||||||||||
| 120 | void init(QV4::ExecutionContext *scope, Function *function); | - | ||||||||||||
| 121 | }; | - | ||||||||||||
| 122 | - | |||||||||||||
| 123 | struct ConstructorFunction : ScriptFunction | - | ||||||||||||
| 124 | { | - | ||||||||||||
| 125 | bool isDerivedConstructor; | - | ||||||||||||
| 126 | }; | - | ||||||||||||
| 127 | - | |||||||||||||
| 128 | struct MemberFunction : ScriptFunction | - | ||||||||||||
| 129 | { | - | ||||||||||||
| 130 | }; | - | ||||||||||||
| 131 | - | |||||||||||||
| 132 | struct DefaultClassConstructorFunction : FunctionObject | - | ||||||||||||
| 133 | { | - | ||||||||||||
| 134 | bool isDerivedConstructor; | - | ||||||||||||
| 135 | }; | - | ||||||||||||
| 136 | - | |||||||||||||
| 137 | #define BoundFunctionMembers(class, Member) \ | - | ||||||||||||
| 138 | Member(class, Pointer, FunctionObject *, target) \ | - | ||||||||||||
| 139 | Member(class, HeapValue, HeapValue, boundThis) \ | - | ||||||||||||
| 140 | Member(class, Pointer, MemberData *, boundArgs) | - | ||||||||||||
| 141 | - | |||||||||||||
| 142 | DECLARE_HEAP_OBJECT(BoundFunction, FunctionObject) { | - | ||||||||||||
| 143 | DECLARE_MARKOBJECTS(BoundFunction); never executed: end of blocknever executed: o->target.heapObject()->mark(stack);never executed: o->boundArgs.heapObject()->mark(stack);
| 0 | ||||||||||||
| 144 | - | |||||||||||||
| 145 | void init(QV4::ExecutionContext *scope, QV4::FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs); | - | ||||||||||||
| 146 | }; | - | ||||||||||||
| 147 | - | |||||||||||||
| 148 | } | - | ||||||||||||
| 149 | - | |||||||||||||
| 150 | struct Q_QML_EXPORT FunctionObject: Object { | - | ||||||||||||
| 151 | enum { | - | ||||||||||||
| 152 | IsFunctionObject = true | - | ||||||||||||
| 153 | }; | - | ||||||||||||
| 154 | V4_OBJECT2(FunctionObject, Object) never executed: end of blocknever executed: end of blockexecuted 102974416 times by 154 tests: return &static_vtbl;Executed by:
executed 202037829 times by 154 tests: return static_cast<QV4::Heap::FunctionObject *>(m());Executed by:
executed 168245430 times by 154 tests: return dptr;Executed by:
| 0-202037829 | ||||||||||||
| 155 | Q_MANAGED_TYPE(FunctionObject) | - | ||||||||||||
| 156 | V4_INTERNALCLASS(FunctionObject) executed 37769959 times by 154 tests: return e->internalClasses(QV4::EngineBase::Class_FunctionObject);Executed by:
| 37769959 | ||||||||||||
| 157 | V4_PROTOTYPE(functionPrototype) executed 39311498 times by 154 tests: return e->functionPrototype();Executed by:
| 39311498 | ||||||||||||
| 158 | V4_NEEDS_DESTROY never executed: end of block | 0 | ||||||||||||
| 159 | enum { NInlineProperties = 1 }; | - | ||||||||||||
| 160 | - | |||||||||||||
| 161 | Heap::ExecutionContext *scope() const { return d()->scope; } executed 15910012 times by 154 tests: return d()->scope;Executed by:
| 15910012 | ||||||||||||
| 162 | Function *function() const { return d()->function; } executed 15022628 times by 60 tests: return d()->function;Executed by:
| 15022628 | ||||||||||||
| 163 | - | |||||||||||||
| 164 | ReturnedValue name() const; | - | ||||||||||||
| 165 | unsigned int formalParameterCount() const { return d()->formalParameterCount(); } executed 5764 times by 34 tests: return d()->formalParameterCount();Executed by:
| 5764 | ||||||||||||
| 166 | unsigned int varCount() const { return d()->varCount(); } never executed: return d()->varCount(); | 0 | ||||||||||||
| 167 | - | |||||||||||||
| 168 | void setName(String *name) { | - | ||||||||||||
| 169 | defineReadonlyConfigurableProperty(engine()->id_name(), *name); | - | ||||||||||||
| 170 | } executed 38967115 times by 154 tests: end of blockExecuted by:
| 38967115 | ||||||||||||
| 171 | void createDefaultPrototypeProperty(uint protoSlot, uint protoConstructorSlot); | - | ||||||||||||
| 172 | - | |||||||||||||
| 173 | inline ReturnedValue callAsConstructor(const JSCallData &data) const; | - | ||||||||||||
| 174 | ReturnedValue callAsConstructor(const Value *argv, int argc, const Value *newTarget = nullptr) const { | - | ||||||||||||
| 175 | return d()->jsConstruct(this, argv, argc, newTarget ? newTarget : this); executed 117811 times by 18 tests: return d()->jsConstruct(this, argv, argc, newTarget ? newTarget : this);Executed by:
| 117811 | ||||||||||||
| 176 | } | - | ||||||||||||
| 177 | inline ReturnedValue call(const JSCallData &data) const; | - | ||||||||||||
| 178 | ReturnedValue call(const Value *thisObject, const Value *argv, int argc) const { | - | ||||||||||||
| 179 | return d()->jsCall(this, thisObject, argv, argc); executed 57429125 times by 87 tests: return d()->jsCall(this, thisObject, argv, argc);Executed by:
| 57429125 | ||||||||||||
| 180 | } | - | ||||||||||||
| 181 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 182 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 183 | - | |||||||||||||
| 184 | static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function); | - | ||||||||||||
| 185 | static Heap::FunctionObject *createConstructorFunction(ExecutionContext *scope, Function *function, bool isDerivedConstructor); | - | ||||||||||||
| 186 | static Heap::FunctionObject *createMemberFunction(ExecutionContext *scope, Function *function); | - | ||||||||||||
| 187 | static Heap::FunctionObject *createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount); | - | ||||||||||||
| 188 | - | |||||||||||||
| 189 | bool strictMode() const { return d()->function ? d()->function->isStrict() : false; } never executed: return d()->function ? d()->function->isStrict() : false; | 0 | ||||||||||||
| 190 | bool isBinding() const; | - | ||||||||||||
| 191 | bool isBoundFunction() const; | - | ||||||||||||
| 192 | - | |||||||||||||
| 193 | QQmlSourceLocation sourceLocation() const; | - | ||||||||||||
| 194 | }; | - | ||||||||||||
| 195 | - | |||||||||||||
| 196 | template<> | - | ||||||||||||
| 197 | inline const FunctionObject *Value::as() const { | - | ||||||||||||
| 198 | return isManaged() && m()->internalClass->vtable->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : nullptr; executed 12476520 times by 154 tests: return isManaged() && m()->internalClass->vtable->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : nullptr;Executed by:
| 12476520 | ||||||||||||
| 199 | } | - | ||||||||||||
| 200 | - | |||||||||||||
| 201 | - | |||||||||||||
| 202 | struct FunctionCtor: FunctionObject | - | ||||||||||||
| 203 | { | - | ||||||||||||
| 204 | V4_OBJECT2(FunctionCtor, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 296941 times by 154 tests: return &static_vtbl;Executed by:
executed 197825 times by 154 tests: return static_cast<QV4::Heap::FunctionCtor *>(m());Executed by:
executed 99044 times by 154 tests: return dptr;Executed by:
| 0-296941 | ||||||||||||
| 205 | - | |||||||||||||
| 206 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 207 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 208 | protected: | - | ||||||||||||
| 209 | enum Type { | - | ||||||||||||
| 210 | Type_Function, | - | ||||||||||||
| 211 | Type_Generator | - | ||||||||||||
| 212 | }; | - | ||||||||||||
| 213 | static QQmlRefPointer<CompiledData::CompilationUnit> parse(ExecutionEngine *engine, const Value *argv, int argc, Type t = Type_Function); | - | ||||||||||||
| 214 | }; | - | ||||||||||||
| 215 | - | |||||||||||||
| 216 | struct FunctionPrototype: FunctionObject | - | ||||||||||||
| 217 | { | - | ||||||||||||
| 218 | V4_OBJECT2(FunctionPrototype, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 296938 times by 154 tests: return &static_vtbl;Executed by:
never executed: return static_cast<QV4::Heap::FunctionPrototype *>(m());never executed: return dptr; | 0-296938 | ||||||||||||
| 219 | - | |||||||||||||
| 220 | void init(ExecutionEngine *engine, Object *ctor); | - | ||||||||||||
| 221 | - | |||||||||||||
| 222 | static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 223 | static ReturnedValue method_apply(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 224 | static ReturnedValue method_call(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 225 | static ReturnedValue method_bind(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 226 | static ReturnedValue method_hasInstance(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 227 | }; | - | ||||||||||||
| 228 | - | |||||||||||||
| 229 | struct IndexedBuiltinFunction : FunctionObject | - | ||||||||||||
| 230 | { | - | ||||||||||||
| 231 | V4_OBJECT2(IndexedBuiltinFunction, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 5616 times by 2 tests: return &static_vtbl;Executed by:
executed 6364 times by 2 tests: return static_cast<QV4::Heap::IndexedBuiltinFunction *>(m());Executed by:
executed 4492 times by 2 tests: return dptr;Executed by:
| 0-6364 | ||||||||||||
| 232 | }; | - | ||||||||||||
| 233 | - | |||||||||||||
| 234 | void Heap::IndexedBuiltinFunction::init(QV4::ExecutionContext *scope, uint index, | - | ||||||||||||
| 235 | ReturnedValue (*code)(const QV4::FunctionObject *, const Value *thisObject, const Value *argv, int argc)) | - | ||||||||||||
| 236 | { | - | ||||||||||||
| 237 | Heap::FunctionObject::init(scope); | - | ||||||||||||
| 238 | this->jsCall = code; | - | ||||||||||||
| 239 | this->index = index; | - | ||||||||||||
| 240 | } executed 1872 times by 2 tests: end of blockExecuted by:
| 1872 | ||||||||||||
| 241 | - | |||||||||||||
| 242 | - | |||||||||||||
| 243 | struct ScriptFunction : FunctionObject { | - | ||||||||||||
| 244 | V4_OBJECT2(ScriptFunction, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 4620740 times by 154 tests: return &static_vtbl;Executed by:
executed 3077016 times by 62 tests: return static_cast<QV4::Heap::ScriptFunction *>(m());Executed by:
executed 1569928 times by 62 tests: return dptr;Executed by:
| 0-4620740 | ||||||||||||
| 245 | V4_INTERNALCLASS(ScriptFunction) executed 1509217 times by 62 tests: return e->internalClasses(QV4::EngineBase::Class_ScriptFunction);Executed by:
| 1509217 | ||||||||||||
| 246 | enum { NInlineProperties = 3 }; | - | ||||||||||||
| 247 | - | |||||||||||||
| 248 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 249 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 250 | - | |||||||||||||
| 251 | Heap::InternalClass *classForConstructor() const; | - | ||||||||||||
| 252 | }; | - | ||||||||||||
| 253 | - | |||||||||||||
| 254 | struct ConstructorFunction : ScriptFunction { | - | ||||||||||||
| 255 | V4_OBJECT2(ConstructorFunction, ScriptFunction) never executed: end of blocknever executed: end of blockexecuted 101054 times by 154 tests: return &static_vtbl;Executed by:
executed 1918 times by 1 test: return static_cast<QV4::Heap::ConstructorFunction *>(m());Executed by:
executed 1259 times by 1 test: return dptr;Executed by:
| 0-101054 | ||||||||||||
| 256 | V4_INTERNALCLASS(ConstructorFunction) executed 660 times by 1 test: return e->internalClasses(QV4::EngineBase::Class_ConstructorFunction);Executed by:
| 660 | ||||||||||||
| 257 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 258 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 259 | }; | - | ||||||||||||
| 260 | - | |||||||||||||
| 261 | struct MemberFunction : ScriptFunction { | - | ||||||||||||
| 262 | V4_OBJECT2(MemberFunction, ScriptFunction) never executed: end of blocknever executed: end of blockexecuted 113220 times by 154 tests: return &static_vtbl;Executed by:
executed 9452 times by 1 test: return static_cast<QV4::Heap::MemberFunction *>(m());Executed by:
executed 4745 times by 1 test: return dptr;Executed by:
| 0-113220 | ||||||||||||
| 263 | V4_INTERNALCLASS(MemberFunction) executed 4732 times by 1 test: return e->internalClasses(QV4::EngineBase::Class_MemberFunction);Executed by:
| 4732 | ||||||||||||
| 264 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 265 | }; | - | ||||||||||||
| 266 | - | |||||||||||||
| 267 | - | |||||||||||||
| 268 | struct DefaultClassConstructorFunction : FunctionObject { | - | ||||||||||||
| 269 | V4_OBJECT2(DefaultClassConstructorFunction, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 25054 times by 1 test: return &static_vtbl;Executed by:
executed 19848 times by 1 test: return static_cast<QV4::Heap::DefaultClassConstructorFunction *>(m());Executed by:
executed 11498 times by 1 test: return dptr;Executed by:
| 0-25054 | ||||||||||||
| 270 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 271 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 272 | }; | - | ||||||||||||
| 273 | - | |||||||||||||
| 274 | struct BoundFunction: FunctionObject { | - | ||||||||||||
| 275 | V4_OBJECT2(BoundFunction, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 4306107 times by 17 tests: return &static_vtbl;Executed by:
executed 1980 times by 3 tests: return static_cast<QV4::Heap::BoundFunction *>(m());Executed by:
executed 1409 times by 3 tests: return dptr;Executed by:
| 0-4306107 | ||||||||||||
| 276 | - | |||||||||||||
| 277 | static Heap::BoundFunction *create(ExecutionContext *scope, FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs) | - | ||||||||||||
| 278 | { | - | ||||||||||||
| 279 | return scope->engine()->memoryManager->allocate<BoundFunction>(scope, target, boundThis, boundArgs); executed 575 times by 3 tests: return scope->engine()->memoryManager->allocate<BoundFunction>(scope, target, boundThis, boundArgs);Executed by:
| 575 | ||||||||||||
| 280 | } | - | ||||||||||||
| 281 | - | |||||||||||||
| 282 | Heap::FunctionObject *target() const { return d()->target; } executed 310 times by 2 tests: return d()->target;Executed by:
| 310 | ||||||||||||
| 283 | Value boundThis() const { return d()->boundThis; } executed 207 times by 2 tests: return d()->boundThis;Executed by:
| 207 | ||||||||||||
| 284 | Heap::MemberData *boundArgs() const { return d()->boundArgs; } executed 309 times by 3 tests: return d()->boundArgs;Executed by:
| 309 | ||||||||||||
| 285 | - | |||||||||||||
| 286 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); | - | ||||||||||||
| 287 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||||||||
| 288 | }; | - | ||||||||||||
| 289 | - | |||||||||||||
| 290 | } | - | ||||||||||||
| 291 | - | |||||||||||||
| 292 | QT_END_NAMESPACE | - | ||||||||||||
| 293 | - | |||||||||||||
| 294 | #endif // QMLJS_OBJECTS_H | - | ||||||||||||
| Source code | Switch to Preprocessed file |