32#define ObjectMembers(class, Member) \
33 Member(class, Pointer, MemberData *, memberData) \
34 Member(class, Pointer, ArrayData *, arrayData)
40 const VTable *vtable()
const {
41 return internalClass->vtable;
44 const Value *inlinePropertyDataWithOffset(
uint indexWithOffset)
const {
45 Q_ASSERT(indexWithOffset >= vtable()->inlinePropertyOffset && indexWithOffset <
uint(vtable()->inlinePropertyOffset + vtable()->nInlineProperties));
46 return reinterpret_cast<const Value *
>(
this) + indexWithOffset;
50 return reinterpret_cast<const Value *
>(
this) + vtable()->inlinePropertyOffset +
index;
53 Q_ASSERT(indexWithOffset >= vtable()->inlinePropertyOffset && indexWithOffset <
uint(vtable()->inlinePropertyOffset + vtable()->nInlineProperties));
54 Value *prop =
reinterpret_cast<Value *
>(
this) + indexWithOffset;
58 Q_ASSERT(indexWithOffset >= vtable()->inlinePropertyOffset && indexWithOffset <
uint(vtable()->inlinePropertyOffset + vtable()->nInlineProperties));
59 Value *prop =
reinterpret_cast<Value *
>(
this) + indexWithOffset;
64 uint nInline = vtable()->nInlineProperties;
72 uint nInline = vtable()->nInlineProperties;
74 return reinterpret_cast<const Value *
>(
this) + vtable()->inlinePropertyOffset +
index;
76 return memberData->values.data() +
index;
79 uint nInline = vtable()->nInlineProperties;
80 if (
index < nInline) {
81 setInlinePropertyWithOffset(
e,
index + vtable()->inlinePropertyOffset,
v);
85 memberData->values.set(
e,
index,
v);
88 uint nInline = vtable()->nInlineProperties;
89 if (
index < nInline) {
90 setInlinePropertyWithOffset(
e,
index + vtable()->inlinePropertyOffset,
b);
94 memberData->values.set(
e,
index,
b);
97 void setUsedAsProto();
99 Heap::Object *prototype()
const {
return internalClass->prototype; }
110 enum { NInlineProperties = 2 };
122 Heap::ArrayData *
arrayData()
const {
return d()->arrayData; }
135 return vtable()->getOwnProperty(
this,
id,
p);
141 return vtable()->hasProperty(
this,
id);
145 return vtable()->defineOwnProperty(
this,
id,
p,
attrs);
153 return v.asReturnedValue();
154 return getValueAccessor(thisObject,
v,
attrs);
157 return getValue(
this,
v,
attrs);
161 const Value *
v = propertyData(propertyIndex);
162 if (!
attrs.isAccessor())
163 return v->asReturnedValue();
164 return getValueAccessor(
this, *
v,
attrs);
175 void defineDefaultProperty(
const QString &
name, VTable::Call code,
179 void defineAccessorProperty(
const QString &
name, VTable::Call getter, VTable::Call setter);
180 void defineAccessorProperty(
StringOrSymbol *
name, VTable::Call getter, VTable::Call setter);
189 void addSymbolSpecies();
195 insertMember(
s,
p, attributes);
203 void setPrototypeUnchecked(
const Object *
p);
210 bool setArrayLength(
uint newLen);
211 void setArrayLengthUnchecked(
uint l);
217 return arrayData()->vtable()->put(
this,
index,
value);
220 return arrayData()->vtable()->putArray(
this,
index,
values,
n);
225 ArrayData::ensureAttributes(
this);
227 arrayData()->vtable()->setAttribute(
this,
i,
a);
231 void push_back(
const Value &
v);
234 return arrayData() ?
static_cast<ArrayData::Type>(
d()->arrayData->type) : Heap::ArrayData::Simple;
238 Q_ASSERT(
t != Heap::ArrayData::Simple &&
t != Heap::ArrayData::Sparse);
240 d()->arrayData->type =
t;
244 ArrayData::realloc(
this, Heap::ArrayData::Simple,
n,
false);
249 ArrayData::realloc(
this, Heap::ArrayData::Simple, 0,
false);
250#ifdef CHECK_SPARSE_ARRAYS
255 void initSparseArray();
263 while ((
p =
p->getPrototypeOf()))
271 {
if (!receiver) receiver =
this;
return vtable()->get(
this,
name->toPropertyKey(), receiver, hasProperty); }
273 {
if (!receiver) receiver =
this;
return vtable()->get(
this, PropertyKey::fromArrayIndex(idx), receiver, hasProperty); }
275 {
return get(idx, hasProperty); }
277 {
if (!receiver) receiver =
this;
return vtable()->get(
this,
id, receiver, hasProperty); }
281 {
if (!receiver) receiver =
this;
return vtable()->put(
this,
name->toPropertyKey(),
v, receiver); }
283 {
if (!receiver) receiver =
this;
return vtable()->put(
this, PropertyKey::fromArrayIndex(idx),
v, receiver); }
285 {
return put(idx,
v); }
287 {
if (!receiver) receiver =
this;
return vtable()->put(
this,
id,
v, receiver); }
298 bool ret = vtable()->put(
this, PropertyKey::fromArrayIndex(idx),
v,
this);
300 if (!
ret && shouldThrow == ThrowOnFailure::DoThrowOnRejection) {
302 if (!
e->hasException) {
314 bool ret = vtable()->put(
this,
name->toPropertyKey(),
v,
this);
316 if (!
ret && shouldThrow == ThrowOnFailure::DoThrowOnRejection) {
318 if (!
e->hasException) {
328 {
return vtable()->deleteProperty(
this,
id); }
330 {
return vtable()->ownPropertyKeys(
this,
target); }
333 {
return vtable()->instanceOf(
this,
var); }
335 bool isConcatSpreadable()
const;
336 bool isArray()
const;
339 bool setProtoFromNewTarget(
const Value *newTarget);
342 {
return vtable()->resolveLookupGetter(
this,
engine, lookup); }
344 {
return vtable()->resolveLookupSetter(
this,
engine, lookup,
value); }
347 {
return vtable()->metacall(
this, call,
index,
a); }
356 static bool virtualIsExtensible(
const Managed *
m);
357 static bool virtualPreventExtensions(
Managed *);
358 static Heap::Object *virtualGetPrototypeOf(
const Managed *);
359 static bool virtualSetPrototypeOf(
Managed *,
const Object *);
384 bool iterateOverSymbols =
false;
393 void init() { Object::init(); }
403 void init() { Object::init(); }
445 double
value()
const {
return d()->value; }
521 return v.toObject(
e)->asReturnedValue();
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
object setProperty("down", true)
Combined button and popup list for selecting options.
void write(EngineBase *engine, Heap::Base *base, ReturnedValue *slot, ReturnedValue value)
\qmltype Particle \inqmlmodule QtQuick.Particles
ReturnedValue value_convert< Object >(ExecutionEngine *e, const Value &v)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static QDBusError::ErrorType get(const char *name)
static struct AttrInfo attrs[]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei length
GLuint GLsizei const GLchar * message
QLatin1StringView QLatin1String
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define Q_MANAGED_TYPE(type)
#define V4_INTERNALCLASS(c)
#define DECLARE_EXPORTED_HEAP_OBJECT(name, base)
#define V4_OBJECT2(DataClass, superClass)
\inmodule QtCore \reentrant
static void insert(Object *o, uint index, const Value *v, bool isAccessor=false)
Heap::ArrayData::Type Type
QStringList toQStringList() const
void init(ExecutionEngine *engine)
ReturnedValue throwRangeError(const Value &value)
Heap::InternalClass * internalClass() const
bool isArrayObject() const
ExecutionEngine * engine() const
~ObjectOwnPropertyKeyIterator() override=default
ReturnedValue resolveLookupGetter(ExecutionEngine *engine, Lookup *lookup) const
void defineDefaultProperty(StringOrSymbol *name, const Value &value, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
const Value * propertyData(uint index) const
void arraySet(uint index, const Property *p, PropertyAttributes attributes=Attr_Data)
bool put(uint idx, const Value &v, Value *receiver=nullptr)
static ReturnedValue getValue(const Value *thisObject, const Value &v, PropertyAttributes attrs)
ReturnedValue resolveLookupSetter(ExecutionEngine *engine, Lookup *lookup, const Value &value)
void setArrayData(ArrayData *a)
bool defineOwnProperty(PropertyKey id, const Property *p, PropertyAttributes attrs)
bool arrayPut(uint index, const Value *values, uint n)
bool deleteProperty(PropertyKey id)
bool hasProperty(PropertyKey id) const
PropertyAttributes getOwnProperty(PropertyKey id, Property *p=nullptr) const
void setProperty(uint index, Heap::Base *b) const
void setProperty(uint index, Value v) const
ReturnedValue instanceOf(const Value &var) const
void setProperty(ExecutionEngine *engine, uint index, Value v) const
bool arrayPut(uint index, const Value &value)
bool isExtensible() const
int metacall(QMetaObject::Call call, int index, void **a)
Heap::ArrayData * arrayData() const
bool setIndexed(uint idx, const Value &v, ThrowOnFailure shouldThrow)
ArrayData::Type arrayType() const
void setArrayType(ArrayData::Type t)
bool put(StringOrSymbol *name, const Value &v, Value *receiver=nullptr)
QT_DEPRECATED ReturnedValue getIndexed(uint idx, bool *hasProperty=nullptr) const
bool set(StringOrSymbol *name, const Value &v, ThrowOnFailure shouldThrow)
const VTable * vtable() const
void setArrayAttributes(uint i, PropertyAttributes a)
void setProperty(const InternalClassEntry &entry, const Property *p)
SparseArrayNode * sparseEnd() const
void defineDefaultProperty(StringOrSymbol *name, VTable::Call code, int argumentCount=0, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
SparseArrayNode * sparseBegin() const
ReturnedValue getValueByIndex(uint propertyIndex) const
bool setPrototypeOf(const Object *p)
ReturnedValue getValue(const Value &v, PropertyAttributes attrs) const
ReturnedValue get(PropertyKey id, const Value *receiver=nullptr, bool *hasProperty=nullptr) const
void push_back(const Value &v)
ReturnedValue get(uint idx, bool *hasProperty=nullptr, const Value *receiver=nullptr) const
OwnPropertyKeyIterator * ownPropertyKeys(Value *target) const
void setProperty(ExecutionEngine *engine, uint index, Heap::Base *b) const
void setArrayLengthUnchecked(uint l)
void arrayReserve(uint n)
Heap::Object * getPrototypeOf() const
ReturnedValue get(StringOrSymbol *name, bool *hasProperty=nullptr, const Value *receiver=nullptr) const
void insertMember(StringOrSymbol *s, const Value &v, PropertyAttributes attributes=Attr_Data)
bool put(PropertyKey id, const Value &v, Value *receiver=nullptr)
QT_DEPRECATED bool putIndexed(uint idx, const Value &v)
constexpr ReturnedValue asReturnedValue() const
ReturnedValue * data_ptr()
static constexpr VTable::DefineOwnProperty virtualDefineOwnProperty
static constexpr VTable::GetLength virtualGetLength
static constexpr Value fromInt32(int i)
static Value fromHeapObject(HeapBasePtr m)
static Value fromUInt32(uint i)