OpenCoverage

qv4functionobject_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4functionobject_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
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-
58QT_BEGIN_NAMESPACE-
59-
60struct QQmlSourceLocation;-
61-
62namespace QV4 {-
63-
64struct IndexedBuiltinFunction;-
65struct JSCallData;-
66-
67namespace 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-
76DECLARE_HEAP_OBJECT(FunctionObject, Object) {-
77 DECLARE_MARKOBJECTS(FunctionObject);
executed 111380 times by 27 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltypeloader
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_qquickwindow
  • tst_quicktestmainwithsetup
  • tst_qv4mm
  • ...
executed 111380 times by 27 tests: o->scope.heapObject()->mark(stack);
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltypeloader
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_qquickwindow
  • tst_quicktestmainwithsetup
  • tst_qv4mm
  • ...
o->scopeDescription
TRUEevaluated 111380 times by 27 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltypeloader
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_qquickwindow
  • tst_quicktestmainwithsetup
  • tst_qv4mm
  • ...
FALSEnever evaluated
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:
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickcustomparticle
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickloader
  • ...
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:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickworkerscript
4285299
96};-
97-
98struct FunctionCtor : FunctionObject {-
99 void init(QV4::ExecutionContext *scope);-
100};-
101-
102struct FunctionPrototype : FunctionObject {-
103 void init();-
104};-
105-
106struct 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-
114DECLARE_HEAP_OBJECT(ScriptFunction, FunctionObject) {-
115 DECLARE_MARKOBJECTS(ScriptFunction)
executed 93564 times by 17 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickvisualdatamodel
  • tst_quicktestmainwithsetup
  • tst_testfiltering
never executed: o->cachedClassForConstructor.heapObject()->mark(stack);
o->cachedClassForConstructorDescription
TRUEnever evaluated
FALSEevaluated 93564 times by 17 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquickvisualdatamodel
  • tst_quicktestmainwithsetup
  • tst_testfiltering
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-
123struct ConstructorFunction : ScriptFunction-
124{-
125 bool isDerivedConstructor;-
126};-
127-
128struct MemberFunction : ScriptFunction-
129{-
130};-
131-
132struct 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-
142DECLARE_HEAP_OBJECT(BoundFunction, FunctionObject) {-
143 DECLARE_MARKOBJECTS(BoundFunction);
never executed: end of block
never executed: o->target.heapObject()->mark(stack);
never executed: o->boundArgs.heapObject()->mark(stack);
o->targetDescription
TRUEnever evaluated
FALSEnever evaluated
o->boundArgsDescription
TRUEnever evaluated
FALSEnever evaluated
0
144-
145 void init(QV4::ExecutionContext *scope, QV4::FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs);-
146};-
147-
148}-
149-
150struct Q_QML_EXPORT FunctionObject: Object {-
151 enum {-
152 IsFunctionObject = true-
153 };-
154 V4_OBJECT2(FunctionObject, Object)
never executed: end of block
never executed: end of block
executed 102974416 times by 154 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 202037829 times by 154 tests: return static_cast<QV4::Heap::FunctionObject *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 168245430 times by 154 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
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:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
37769959
157 V4_PROTOTYPE(functionPrototype)
executed 39311498 times by 154 tests: return e->functionPrototype();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
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:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
15910012
162 Function *function() const { return d()->function; }
executed 15022628 times by 60 tests: return d()->function;
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • tst_qqmlproperty
  • tst_qqmlqt
  • ...
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:
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickcustomparticle
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickloader
  • ...
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 block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
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:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmllocale
  • tst_qqmlqt
  • tst_qqmlvaluetypeproviders
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickgridview
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
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:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
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-
196template<>-
197inline 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:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
12476520
199}-
200-
201-
202struct FunctionCtor: FunctionObject-
203{-
204 V4_OBJECT2(FunctionCtor, FunctionObject)
never executed: end of block
never executed: end of block
executed 296941 times by 154 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 197825 times by 154 tests: return static_cast<QV4::Heap::FunctionCtor *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 99044 times by 154 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
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);-
208protected:-
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-
216struct FunctionPrototype: FunctionObject-
217{-
218 V4_OBJECT2(FunctionPrototype, FunctionObject)
never executed: end of block
never executed: end of block
executed 296938 times by 154 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
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-
229struct IndexedBuiltinFunction : FunctionObject-
230{-
231 V4_OBJECT2(IndexedBuiltinFunction, FunctionObject)
never executed: end of block
never executed: end of block
executed 5616 times by 2 tests: return &static_vtbl;
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
executed 6364 times by 2 tests: return static_cast<QV4::Heap::IndexedBuiltinFunction *>(m());
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
executed 4492 times by 2 tests: return dptr;
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
0-6364
232};-
233-
234void 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 block
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
1872
241-
242-
243struct ScriptFunction : FunctionObject {-
244 V4_OBJECT2(ScriptFunction, FunctionObject)
never executed: end of block
never executed: end of block
executed 4620740 times by 154 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 3077016 times by 62 tests: return static_cast<QV4::Heap::ScriptFunction *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
executed 1569928 times by 62 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
0-4620740
245 V4_INTERNALCLASS(ScriptFunction)
executed 1509217 times by 62 tests: return e->internalClasses(QV4::EngineBase::Class_ScriptFunction);
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlprofilerservice
  • ...
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-
254struct ConstructorFunction : ScriptFunction {-
255 V4_OBJECT2(ConstructorFunction, ScriptFunction)
never executed: end of block
never executed: end of block
executed 101054 times by 154 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 1918 times by 1 test: return static_cast<QV4::Heap::ConstructorFunction *>(m());
Executed by:
  • tst_ecmascripttests
executed 1259 times by 1 test: return dptr;
Executed by:
  • tst_ecmascripttests
0-101054
256 V4_INTERNALCLASS(ConstructorFunction)
executed 660 times by 1 test: return e->internalClasses(QV4::EngineBase::Class_ConstructorFunction);
Executed by:
  • tst_ecmascripttests
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-
261struct MemberFunction : ScriptFunction {-
262 V4_OBJECT2(MemberFunction, ScriptFunction)
never executed: end of block
never executed: end of block
executed 113220 times by 154 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
executed 9452 times by 1 test: return static_cast<QV4::Heap::MemberFunction *>(m());
Executed by:
  • tst_ecmascripttests
executed 4745 times by 1 test: return dptr;
Executed by:
  • tst_ecmascripttests
0-113220
263 V4_INTERNALCLASS(MemberFunction)
executed 4732 times by 1 test: return e->internalClasses(QV4::EngineBase::Class_MemberFunction);
Executed by:
  • tst_ecmascripttests
4732
264 static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *);-
265};-
266-
267-
268struct DefaultClassConstructorFunction : FunctionObject {-
269 V4_OBJECT2(DefaultClassConstructorFunction, FunctionObject)
never executed: end of block
never executed: end of block
executed 25054 times by 1 test: return &static_vtbl;
Executed by:
  • tst_ecmascripttests
executed 19848 times by 1 test: return static_cast<QV4::Heap::DefaultClassConstructorFunction *>(m());
Executed by:
  • tst_ecmascripttests
executed 11498 times by 1 test: return dptr;
Executed by:
  • tst_ecmascripttests
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-
274struct BoundFunction: FunctionObject {-
275 V4_OBJECT2(BoundFunction, FunctionObject)
never executed: end of block
never executed: end of block
executed 4306107 times by 17 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlitemmodels
  • tst_qqmllistmodelworkerscript
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquickloader
  • tst_qquickworkerscript
executed 1980 times by 3 tests: return static_cast<QV4::Heap::BoundFunction *>(m());
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
executed 1409 times by 3 tests: return dptr;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
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:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
575
280 }-
281-
282 Heap::FunctionObject *target() const { return d()->target; }
executed 310 times by 2 tests: return d()->target;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
310
283 Value boundThis() const { return d()->boundThis; }
executed 207 times by 2 tests: return d()->boundThis;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
207
284 Heap::MemberData *boundArgs() const { return d()->boundArgs; }
executed 309 times by 3 tests: return d()->boundArgs;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
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-
292QT_END_NAMESPACE-
293-
294#endif // QMLJS_OBJECTS_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0