Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4functionobject_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QV4FUNCTIONOBJECT_H
4#define QV4FUNCTIONOBJECT_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include "qv4object_p.h"
18#include "qv4function_p.h"
19#include "qv4context_p.h"
20#include <private/qv4mm_p.h>
21
23
25
26namespace QV4 {
27
28struct IndexedBuiltinFunction;
29struct JSCallData;
30
31// A FunctionObject is generally something that can be called, either with a JavaScript
32// signature (QV4::Value etc) or with a C++ signature (QMetaType etc). For this, it has
33// the Call and CallWithMetaTypes VTable entries.
34// Some FunctionObjects need to select the actual implementation of the call at run time.
35// This comese in two flavors:
36// 1. The implementation is a JavaScript function. For these we have
37// JavaScriptFunctionObject that holds a QV4::Function member to defer the call to.
38// 2. The implementation is a C++ function. For these we have DynamicFunctionObject that
39// holds another Call member in the heap object to defer the call to.
40// In addition, a FunctionObject may want to be called as constructor. For this we have
41// another VTable entry and a flag in the heap object.
42
43namespace Heap {
44
45#define FunctionObjectMembers(class, Member)
46DECLARE_HEAP_OBJECT(FunctionObject, Object) {
47 enum {
48 Index_ProtoConstructor = 0,
49 Index_Prototype = 0,
50 Index_HasInstance = 1,
51 };
52
53 Q_QML_EXPORT void init(QV4::ExecutionEngine *engine, QV4::String *name = nullptr);
54 Q_QML_EXPORT void init(QV4::ExecutionEngine *engine, const QString &name);
55 Q_QML_EXPORT void init();
56};
57
58#define JavaScriptFunctionObjectMembers(class, Member)
59 Member(class, Pointer, ExecutionContext *, scope)
60 Member(class, NoMark, Function *, function)
61
62DECLARE_HEAP_OBJECT(JavaScriptFunctionObject, FunctionObject) {
63 DECLARE_MARKOBJECTS(JavaScriptFunctionObject)
64
65 void init(QV4::ExecutionContext *scope, QV4::Function *function, QV4::String *n = nullptr);
66 Q_QML_EXPORT void destroy();
67
68 void setFunction(Function *f);
69
70 unsigned int formalParameterCount() { return function ? function->nFormals : 0; }
71 unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; }
72};
73
74#define DynamicFunctionObjectMembers(class, Member)
75 Member(class, NoMark, VTable::Call, jsCall)
76
78 // NB: We might add a CallWithMetaTypes member to this struct and implement our
79 // builtins with metatypes, to be called from C++ code. This would make them
80 // available to qmlcachegen's C++ code generation.
81 void init(ExecutionEngine *engine, QV4::String *name, VTable::Call call);
82};
83
85 void init(QV4::ExecutionEngine *engine);
86};
87
89 void init();
90};
91
92// A function object with an additional index into a list.
93// Used by Models to refer to property roles.
95 inline void init(QV4::ExecutionEngine *engine, qsizetype index, VTable::Call call);
97};
98
100 enum {
101 Index_Name = Index_HasInstance + 1,
103 };
104 void init(QV4::ExecutionContext *scope, Function *function, QV4::String *name = nullptr);
105};
106
107#define ScriptFunctionMembers(class, Member)
108 Member(class, Pointer, InternalClass *, cachedClassForConstructor)
109
111 DECLARE_MARKOBJECTS(ScriptFunction)
112 void init(QV4::ExecutionContext *scope, Function *function);
113};
114
115#define MemberFunctionMembers(class, Member)
116 Member(class, Pointer, Object *, homeObject)
117
119 DECLARE_MARKOBJECTS(MemberFunction)
120
121 void init(QV4::ExecutionContext *scope, Function *function, QV4::String *name = nullptr) {
122 ArrowFunction::init(scope, function, name);
123 }
124};
125
126#define ConstructorFunctionMembers(class, Member)
127 Member(class, Pointer, Object *, homeObject)
128
130 DECLARE_MARKOBJECTS(ConstructorFunction)
131 bool isDerivedConstructor;
132};
133
134#define DefaultClassConstructorFunctionMembers(class, Member)
135 Member(class, Pointer, ExecutionContext *, scope)
136
138 DECLARE_MARKOBJECTS(DefaultClassConstructorFunction)
139
140 bool isDerivedConstructor;
141
142 void init(QV4::ExecutionContext *scope);
143};
144
145#define BoundFunctionMembers(class, Member)
146 Member(class, Pointer, FunctionObject *, target)
147 Member(class, HeapValue, HeapValue, boundThis)
148 Member(class, Pointer, MemberData *, boundArgs)
149
150DECLARE_HEAP_OBJECT(BoundFunction, JavaScriptFunctionObject) {
151 DECLARE_MARKOBJECTS(BoundFunction)
152
153 void init(QV4::FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs);
154};
155
157
158}
159
165 enum { NInlineProperties = 1 };
166
167 bool canBeTailCalled() const { return vtable()->isTailCallable; }
168
169 ReturnedValue name() const;
170
175
177 const Value *argv, int argc, const Value *newTarget = nullptr) const
178 {
179 if (const auto callAsConstructor = vtable()->callAsConstructor)
180 return callAsConstructor(this, argv, argc, newTarget ? newTarget : this);
181 return failCallAsConstructor();
182 }
183
184 ReturnedValue call(const Value *thisObject, const Value *argv, int argc) const
185 {
186 if (const auto call = vtable()->call)
187 return call(this, thisObject, argv, argc);
188 return failCall();
189 }
190
191 void call(QObject *thisObject, void **argv, const QMetaType *types, int argc) const
192 {
193 if (const auto callWithMetaTypes = vtable()->callWithMetaTypes)
195 else
196 failCall();
197 }
198
199 inline ReturnedValue callAsConstructor(const JSCallData &data) const;
200 inline ReturnedValue call(const JSCallData &data) const;
201
202 ReturnedValue failCall() const;
204 static void virtualConvertAndCall(
206 void **argv, const QMetaType *types, int argc);
207
212
213 bool isBinding() const;
214 bool isBoundFunction() const;
215 bool isConstructor() const { return vtable()->callAsConstructor; }
216
218
225};
226
227template<>
228inline const FunctionObject *Value::as() const {
229 if (!isManaged())
230 return nullptr;
231
232 const VTable *vtable = m()->internalClass->vtable;
233 return (vtable->call || vtable->callAsConstructor)
234 ? reinterpret_cast<const FunctionObject *>(this)
235 : nullptr;
236}
237
239{
242
243 Heap::ExecutionContext *scope() const { return d()->scope; }
244
245 Function *function() const { return d()->function; }
246 unsigned int formalParameterCount() const { return d()->formalParameterCount(); }
247 unsigned int varCount() const { return d()->varCount(); }
248 bool strictMode() const { return d()->function ? d()->function->isStrict() : false; }
250};
251
253{
255
257 const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
258};
259
261{
262 V4_OBJECT2(FunctionCtor, FunctionObject)
263
264 static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *);
265 static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
266protected:
271 static QQmlRefPointer<ExecutableCompilationUnit> parse(ExecutionEngine *engine, const Value *argv, int argc, Type t = Type_Function);
272};
273
275{
276 V4_OBJECT2(FunctionPrototype, FunctionObject)
277
279
281 const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
282
283 static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
284 static ReturnedValue method_apply(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
285 static ReturnedValue method_call(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
286 static ReturnedValue method_bind(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
287 static ReturnedValue method_hasInstance(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
288};
289
294
296 QV4::ExecutionEngine *engine, qsizetype index, VTable::Call call)
297{
298 Heap::FunctionObject::init(engine);
299 this->jsCall = call;
300 this->index = index;
301}
302
304 V4_OBJECT2(ArrowFunction, JavaScriptFunctionObject)
306 enum {
309 };
310
311 static void virtualCallWithMetaTypes(const FunctionObject *f, QObject *thisObject,
312 void **a, const QMetaType *types, int argc);
313 static ReturnedValue virtualCall(const QV4::FunctionObject *f, const QV4::Value *thisObject,
314 const QV4::Value *argv, int argc);
315};
316
325
330
334 static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *);
335 static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
336};
337
339 V4_OBJECT2(DefaultClassConstructorFunction, FunctionObject)
340
341 Heap::ExecutionContext *scope() const { return d()->scope; }
342 static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *);
343 static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
344};
345
347 V4_OBJECT2(BoundFunction, JavaScriptFunctionObject)
348
349 Heap::FunctionObject *target() const { return d()->target; }
350 Value boundThis() const { return d()->boundThis; }
351 Heap::MemberData *boundArgs() const { return d()->boundArgs; }
352
353 static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
354};
355
358
360 const FunctionObject *f, const Value *argv, int argc, const Value *);
361};
362
363inline bool FunctionObject::isBoundFunction() const
364{
365 const VTable *vtable = d()->vtable();
367}
368
369inline ReturnedValue checkedResult(QV4::ExecutionEngine *v4, ReturnedValue result)
370{
371 return v4->hasException ? QV4::Encode::undefined() : result;
372}
373
374}
375
376QT_END_NAMESPACE
377
378#endif // QMLJS_OBJECTS_H
\inmodule QtQml
bool isString() const
Returns true if the type of this QJSManagedValue is string, or false otherwise.
QJSEngine * engine() const
Returns the QJSEngine this QJSManagedValue belongs to.
bool deleteProperty(quint32 arrayIndex)
Deletes the value stored at arrayIndex from this QJSManagedValue.
friend class QJSEngine
QJSValue toJSValue() const
Copies this QJSManagedValue into a new QJSValue.
QJSManagedValue jsMetaType() const
bool isBoolean() const
Returns true if the type of this QJSManagedValue is boolean, or false otherwise.
const QMetaObject * toQMetaObject() const
If this QJSManagedValue holds a QMetaObject pointer, returns it.
QStringList jsMetaMembers() const
bool isArray() const
Returns true if this value represents a JavaScript Array object, or false otherwise.
bool isError() const
Returns true if this value represents a JavaScript Error object, or false otherwise.
bool strictlyEquals(const QJSManagedValue &other) const
Invokes the JavaScript '===' operator on this QJSManagedValue and other, and returns the result.
bool hasProperty(const QString &name) const
Returns true if this QJSManagedValue has a property name, otherwise returns false.
QJSValue call(const QJSValueList &arguments={}) const
If this QJSManagedValue represents a JavaScript FunctionObject, calls it with the given arguments,...
QObject * toQObject() const
If this QJSManagedValue holds a QObject pointer, returns it.
bool isRegularExpression() const
Returns true if this value represents a JavaScript regular expression object, or false otherwise.
QJSValue property(const QString &name) const
Returns the property name of this QJSManagedValue.
QJSManagedValue jsMetaInstantiate(const QJSValueList &values={}) const
bool hasOwnProperty(quint32 arrayIndex) const
Returns true if this QJSManagedValue has an array index arrayIndex, otherwise returns false.
QVariant toVariant() const
Copies this QJSManagedValue into a new QVariant.
bool hasProperty(quint32 arrayIndex) const
Returns true if this QJSManagedValue has an array index arrayIndex, otherwise returns false.
double toNumber() const
Converts the manged value to a number.
QJSManagedValue & operator=(QJSManagedValue &&other)
Move-assigns a QJSManagedValue from other.
QJSValue callAsConstructor(const QJSValueList &arguments={}) const
If this QJSManagedValue represents a JavaScript FunctionObject, calls it as constructor with the give...
bool isVariant() const
Returns true if this value represents a QVariant managed on the JavaScript heap, or false otherwise.
bool isFunction() const
Returns true if the type of this QJSManagedValue is function, false otherwise.
QRegularExpression toRegularExpression() const
If this QJSManagedValue holds a JavaScript regular expression object, returns an equivalent QRegularE...
QJSManagedValue prototype() const
Returns the prototype for this QJSManagedValue.
bool isUndefined() const
Returns true if the type of this QJSManagedValue is undefined, or false otherwise.
bool isDate() const
Returns true if this value represents a JavaScript Date object, or false otherwise.
bool equals(const QJSManagedValue &other) const
Invokes the JavaScript '==' operator on this QJSManagedValue and other, and returns the result.
~QJSManagedValue()
Destroys the QJSManagedValue.
QJSPrimitiveValue toPrimitive() const
Converts the manged value to a QJSPrimitiveValue.
bool deleteProperty(const QString &name)
Deletes the property name from this QJSManagedValue.
bool isQMetaObject() const
Returns true if this value represents a QMetaObject pointer managed on the JavaScript heap,...
QDateTime toDateTime() const
If this QJSManagedValue holds a JavaScript Date object, returns an equivalent QDateTime.
int toInteger() const
Converts the manged value to an integer.
QString toString() const
Converts the manged value to a string.
QUrl toUrl() const
If this QJSManagedValue holds a JavaScript Url object, returns an equivalent QUrl.
bool isQObject() const
Returns true if this value represents a QObject pointer managed on the JavaScript heap,...
bool hasOwnProperty(const QString &name) const
Returns true if this QJSManagedValue has a property name, otherwise returns false.
void setPrototype(const QJSManagedValue &prototype)
Sets the prototype of this QJSManagedValue to prototype.
bool isUrl() const
Returns true if this value represents a JavaScript Url object, or false otherwise.
bool isInteger() const
Returns true if this QJSManagedValue holds an integer value, or false otherwise.
bool isNumber() const
Returns true if the type of this QJSManagedValue is number, or false otherwise.
bool isNull() const
Returns true if this QJSManagedValue holds the JavaScript null value, or false otherwise.
bool isSymbol() const
Returns true if the type of this QJSManagedValue is symbol, or false otherwise.
bool isObject() const
Returns true if the type of this QJSManagedValue is object, or false otherwise.
void setProperty(const QString &name, const QJSValue &value)
Sets the property name to value on this QJSManagedValue.
void setProperty(quint32 arrayIndex, const QJSValue &value)
Stores the value at arrayIndex in this QJSManagedValue.
bool toBoolean() const
Converts the manged value to a boolean.
QJSValue callWithInstance(const QJSValue &instance, const QJSValueList &arguments={}) const
If this QJSManagedValue represents a JavaScript FunctionObject, calls it on instance with the given a...
bool isJsMetaType() const
The QJSPrimitiveValue class operates on primitive types in JavaScript semantics.
static QV4::ExecutionEngine * engine(const QJSValue *jsval)
Definition qjsvalue_p.h:321
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
virtual Type type() const =0
Reimplement this function to return the paint engine \l{Type}.
virtual QVariant property(QPrintDevice::PrintDevicePropertyKey key) const
ArrayElementLessThan(ExecutionEngine *engine, const Value &comparefn)
bool operator()(Value v1, Value v2) const
ReturnedValue operator*() const
Definition qv4value_p.h:476
OptionalReturnedValue(ReturnedValue v)
Definition qv4value_p.h:469
ReturnedValue operator->() const
Definition qv4value_p.h:475
Combined button and popup list for selecting options.
DECLARE_EXPORTED_HEAP_OBJECT(Object, Base)
Definition qv4object_p.h:36
DECLARE_HEAP_OBJECT(MemberData, Base)
DECLARE_HEAP_OBJECT(BoundFunction, JavaScriptFunctionObject)
DECLARE_HEAP_OBJECT(ConstructorFunction, ScriptFunction)
DECLARE_HEAP_OBJECT(FunctionObject, Object)
DECLARE_HEAP_OBJECT(ArrayData, Base)
DECLARE_HEAP_OBJECT(RegExpCtor, FunctionObject)
Q_STATIC_ASSERT(std::is_trivial_v< ArrayData >)
DECLARE_HEAP_OBJECT(JavaScriptFunctionObject, FunctionObject)
DECLARE_HEAP_OBJECT(MemberFunction, ArrowFunction)
DECLARE_HEAP_OBJECT(ScriptFunction, ArrowFunction)
CallResultDestination
Definition qjsvalue.h:23
Scoped< FunctionObject > ScopedFunctionObject
void sortHelper(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
QVector< StackFrame > StackTrace
int qYouForgotTheQ_MANAGED_Macro(T, T)
bool hasExceptionOrIsInterrupted(ExecutionEngine *engine)
Scoped< Object > ScopedObject
ReturnedValue value_convert(ExecutionEngine *e, const Value &v)
Scoped< ArrayObject > ScopedArrayObject
ReturnedValue checkedResult(QV4::ExecutionEngine *v4, ReturnedValue result)
Scoped< String > ScopedString
Scoped< StringOrSymbol > ScopedStringOrSymbol
void qYouForgotTheQ_MANAGED_Macro(T1, T2)
PropertyFlag
@ Attr_Invalid
@ Attr_NotConfigurable
@ Attr_Data
@ Attr_NotEnumerable
@ Attr_ReadOnly
@ Attr_NotWritable
@ Attr_ReadOnly_ButConfigurable
@ Attr_Accessor
Q_STATIC_ASSERT(std::is_trivial_v< Value >)
Scoped< ExecutionContext > ScopedContext
T caughtResult(const QJSValue *v, T(QV4::Value::*convert)() const)
Definition qjsvalue.cpp:514
static bool js_equal(const QString &string, const QV4::Value &value)
Definition qjsvalue.cpp:972
QDataStream & operator<<(QDataStream &stream, const QJSValue &jsv)
QDataStream & operator>>(QDataStream &stream, QJSValue &jsv)
QList< QJSValue > QJSValueList
Definition qjsvalue.h:22
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
#define V4_ARRAYDATA(DataClass)
#define V4_MANAGED(DataClass, superClass)
#define V4_MANAGED_SIZE_TEST
#define V4_NEEDS_DESTROY
#define V4_MANAGED_ITSELF(DataClass, superClass)
#define Q_MANAGED_TYPE(type)
#define V4_INTERNALCLASS(c)
#define Q_MANAGED_CHECK
double d
[1]
static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *p, PropertyAttributes attrs)
static qint64 virtualGetLength(const Managed *m)
QStringList toQStringList() const
void(* setAttribute)(Object *o, uint index, PropertyAttributes attrs)
bool(* putArray)(Object *o, uint index, const Value *values, uint n)
bool(* put)(Object *o, uint index, const Value &value)
void(* push_front)(Object *o, const Value *values, uint n)
ReturnedValue(* get)(const Heap::ArrayData *d, uint index)
bool(* del)(Object *o, uint index)
ReturnedValue(* pop_front)(Object *o)
static ReturnedValue virtualCall(const QV4::FunctionObject *f, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
static QQmlRefPointer< ExecutableCompilationUnit > parse(ExecutionEngine *engine, const Value *argv, int argc, Type t=Type_Function)
static ReturnedValue method_bind(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_call(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_hasInstance(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_apply(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static constexpr size_t offset
Definition qv4value_p.h:407
void set(EngineBase *e, HeapBasePtr b)
Definition qv4value_p.h:417
HeapBasePtr base()
Definition qv4value_p.h:408
void set(EngineBase *e, const Value &newVal)
Definition qv4value_p.h:414
void init(const QStringList &list)
void init(QV4::ExecutionContext *scope, Function *function, QV4::String *name=nullptr)
void init(QV4::ExecutionEngine *engine)
void init(QV4::ExecutionEngine *engine, qsizetype index, VTable::Call call)
void init(InternalClass *other)
IndexAndAttribute findValueOrSetter(const PropertyKey id)
void init(ExecutionEngine *engine)
static void addMember(QV4::Object *object, PropertyKey id, PropertyAttributes data, InternalClassEntry *entry)
InternalClassEntry find(const PropertyKey id)
bool verifyIndex(const PropertyKey id, uint index)
QVarLengthArray< Transition, 1 > transitions
SharedInternalClassData< PropertyKey > nameMap
IndexAndAttribute findValueOrGetter(const PropertyKey id)
InternalClassTransition Transition
uint indexOfValueOrGetter(const PropertyKey id)
InternalClassTransition & lookupOrInsertTransition(const InternalClassTransition &t)
static void markObjects(Heap::Base *ic, MarkStack *stack)
static void removeMember(QV4::Object *object, PropertyKey identifier)
static void changeMember(QV4::Object *object, PropertyKey id, PropertyAttributes data, InternalClassEntry *entry=nullptr)
PropertyHash::Entry * findEntry(const PropertyKey id)
SharedInternalClassData< PropertyAttributes > propertyData
void init(double val)
PropertyAttributes attributes(uint i) const
uint mappedIndex(uint index) const
void setData(EngineBase *e, uint index, Value newVal)
const Value & data(uint index) const
uint mappedIndex(uint index) const
PropertyAttributes attributes(uint i) const
PropertyAttributes attributes
bool operator<(const InternalClassTransition &other) const
bool operator==(const InternalClassTransition &other) const
static Heap::MemberData * allocate(QV4::ExecutionEngine *e, uint n, Heap::MemberData *old=nullptr)
const Value * data() const
void set(EngineBase *e, uint index, Value v)
const Value & operator[](uint idx) const
void set(EngineBase *e, uint index, Heap::Base *b)
uint size() const
PropertyKey next(const Object *o, Property *pd=nullptr, PropertyAttributes *attrs=nullptr) override
PropertyHash::Entry * entries
void addEntry(const Entry &entry, int classSize)
PropertyHash(const PropertyHash &other)
PropertyHashData * d
PropertyHash & operator=(const PropertyHash &other)
void detach(bool grow, int classSize)
Entry * lookup(PropertyKey identifier) const
const Value * operator->() const
bool isNull() const
const Value & operator*() const
void set(EngineBase *e, Value newVal)
bool isStringOrSymbol() const
bool isValid() const
bool isArrayIndex() const
static PropertyKey fromId(quint64 id)
Heap::StringOrSymbol * toStringOrSymbol(ExecutionEngine *e)
bool isCanonicalNumericIndexString() const
Q_QML_EXPORT bool isSymbol() const
bool operator<(const PropertyKey &other) const
Q_QML_EXPORT bool isString() const
StringOrSymbol * asStringOrSymbol() const
uint asArrayIndex() const
bool operator==(const PropertyKey &other) const
static PropertyKey invalid()
static PropertyKey fromStringOrSymbol(Engine *engine, StringOrSymbol *b)
friend size_t qHash(const PropertyKey &key, size_t seed=0)
static PropertyKey fromArrayIndex(uint idx)
Heap::String * asFunctionName(ExecutionEngine *e, FunctionNamePrefix prefix) const
quint64 id() const
bool operator!=(const PropertyKey &other) const
void setGetter(FunctionObject *g)
Heap::FunctionObject * getter() const
bool isSubset(const PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs) const
void setSetter(FunctionObject *s)
void fullyPopulated(PropertyAttributes *attrs)
bool isCompatible(PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs) const
void copy(const Property *other, PropertyAttributes attrs)
void completed(PropertyAttributes *attrs)
Property(Heap::FunctionObject *getter, Heap::FunctionObject *setter)
Heap::FunctionObject * setter() const
void merge(PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs)
Value * alloc(qint64 nValues) const =delete
Scope(const Managed *m)
Scope(ExecutionEngine *e)
Scope(ExecutionContext *ctx)
ScopedPropertyKey & operator=(const PropertyKey &other)
ScopedPropertyKey(const Scope &scope)
ScopedPropertyKey(const Scope &scope, const PropertyKey &v)
bool operator==(const PropertyKey &other) const
bool operator==(const ScopedPropertyKey &other) const
bool operator!=(const ScopedPropertyKey &other) const
bool operator!=(const PropertyKey &other) const
ScopedProperty(Scope &scope)
ScopedValue(const Scope &scope, Managed *m)
ScopedValue & operator=(Managed *m)
ScopedValue & operator=(const Value &v)
ScopedValue(const Scope &scope, const Value &v)
ScopedValue(ScopedValue &&)=default
ScopedValue(const Scope &scope)
ScopedValue(const ScopedValue &)=default
ScopedValue(const Scope &scope, const ReturnedValue &v)
ScopedValue & operator=(const ScopedValue &other)
const Value * operator->() const
ScopedValue(const Scope &scope, Heap::Base *o)
ScopedValue & operator=(const ReturnedValue &v)
ScopedValue & operator=(Heap::Base *o)
Scoped< T > & operator=(typename T::Data *t)
operator bool() const
Scoped< T > & operator=(Value *v)
Scoped< T > & operator=(const ReturnedValue &v)
operator const Value &() const
Scoped< T > & operator=(Heap::Base *o)
Scoped< T > & operator=(const Value &v)
QML_NEARLY_ALWAYS_INLINE void setPointer(const Managed *p)
const T * getPointer() const
const T * operator->() const
Scoped< T > & operator=(T *t)
Heap::InternalClass * classForConstructor() const
SharedInternalClassDataPrivate(const SharedInternalClassDataPrivate &other, uint pos, PropertyKey value)
SharedInternalClassDataPrivate(const SharedInternalClassDataPrivate &other)
void set(uint pos, T value)
SharedInternalClassData(ExecutionEngine *e)
void add(uint pos, T value)
SharedInternalClassData & operator=(const SharedInternalClassData &other)
SharedInternalClassData(const SharedInternalClassData &other)
SparseArrayNode * right
SparseArrayNode * left
SparseArrayNode * copy(SparseArray *d) const
SparseArrayNode * lowerBound(uint key)
const SparseArrayNode * previousNode() const
SparseArrayNode * parent() const
SparseArrayNode * nextNode()
SparseArrayNode * upperBound(uint key)
const SparseArrayNode * nextNode() const
SparseArrayNode * previousNode()
void setParent(SparseArrayNode *pp)
SparseArrayNode * upperBound(uint key)
SparseArrayNode * erase(SparseArrayNode *n)
void push_back(uint at, uint len)
SparseArrayNode * lowerBound(uint key)
const SparseArrayNode * begin() const
SparseArrayNode * insert(uint akey)
void push_front(uint at)
uint pop_back(uint len)
QList< int > keys() const
SparseArrayNode * findNode(uint akey) const
void freeTree(SparseArrayNode *root, int alignment)
const SparseArrayNode * end() const
uint nEntries() const
const Value * data() const
Definition qv4value_p.h:449
Value values[1]
Definition qv4value_p.h:430
void set(EngineBase *e, uint index, Value v)
Definition qv4value_p.h:439
void set(EngineBase *e, uint index, Value::HeapBasePtr b)
Definition qv4value_p.h:442
void mark(MarkStack *markStack)
Definition qv4value_p.h:453
Value::HeapBasePtr base()
Definition qv4value_p.h:432
const Value & operator[](uint index) const
Definition qv4value_p.h:445
static constexpr size_t offset
Definition qv4value_p.h:427