11#include <private/qprimefornumbits_p.h>
52 if (!
e.identifier.isValid() ||
e.index >=
static_cast<unsigned>(classSize))
80SharedInternalClassDataPrivate<PropertyKey>::SharedInternalClassDataPrivate(
const SharedInternalClassDataPrivate<PropertyKey> &
other,
86 memcpy(
data,
other.data,
sizeof(Heap::MemberData) -
sizeof(Value) +
pos*
sizeof(Value));
93 const uint a = alloc() * 2;
102 return data ?
data->values.alloc : 0;
107 return data ?
data->values.size : 0;
113 data->values.size =
s;
125 data->values.values[
i].rawValueRef() =
t.id();
140 m_engine(
other.m_engine)
145 m_engine->memoryManager->changeUnmanagedHeapSizeUsage(m_alloc *
sizeof(
PropertyAttributes));
148 :
other.m_inlineData;
150 if (m_alloc > NumAttributesInPointer)
162 m_alloc(
other.m_alloc),
163 m_size(
other.m_size),
164 m_engine(
other.m_engine)
166 m_engine->memoryManager->changeUnmanagedHeapSizeUsage(m_alloc *
sizeof(
PropertyAttributes));
167 if (m_alloc > NumAttributesInPointer) {
170 }
else if (m_alloc > 0) {
179 m_engine->memoryManager->changeUnmanagedHeapSizeUsage(
181 if (m_alloc > NumAttributesInPointer)
188 alloc = NumAttributesInPointer;
189 m_engine->memoryManager->changeUnmanagedHeapSizeUsage(alloc *
sizeof(
PropertyAttributes));
193 if (currentSize <
uint(std::numeric_limits<int>::max() / 2))
198 m_engine->memoryManager->changeUnmanagedHeapSizeUsage(
202 if (alloc > NumAttributesInPointer) {
204 if (m_alloc > NumAttributesInPointer) {
207 }
else if (m_alloc > 0) {
233 vtable = QV4::InternalClass::staticVTable();
268 t.lookup->parent =
nullptr;
273 parent->removeChildEntry(
this);
294 object->setInternalClass(newClass);
331 std::vector<InternalClassTransition> transitions;
339 int structureChanges = 0;
342 while (
parent && remainingRedundantTransitions > 0) {
344 const auto it = std::find_if(
345 parent->d()->transitions.begin(),
parent->d()->transitions.end(),
347 return child->d() == t.lookup;
353 if ((structureChanges &
it->flags) !=
it->flags) {
354 transitions.push_back(*
it);
355 structureChanges |=
it->flags;
357 --remainingRedundantTransitions;
366 transitions.push_back(*
it);
368 --remainingRedundantTransitions;
377 for (
auto it = transitions.rbegin();
it != transitions.rend(); ++
it) {
423 entry->setterIndex =
e->setterIndex;
437 if (
data.isAccessor() &&
e->setterIndex == UINT_MAX) {
443 e->setterIndex = newClass->
size;
460 proto->setUsedAsProto();
462 Q_ASSERT(!proto || proto->internalClass->isUsedAsProto());
465 temp.prototype = proto;
479Heap::InternalClass *InternalClass::changeVTableImpl(
const VTable *vt)
497 return vtable == QV4::InternalClass::staticVTable()
550 object->setInternalClass(newClass);
563 return addMemberImpl(identifier,
data,
entry);
573 entry->setterIndex =
data.isAccessor() ?
size + 1 : UINT_MAX;
583 InternalClass *newClass = ic->d();
584 PropertyHash::Entry
e = { identifier, newClass->size,
data.isAccessor() ? newClass->size + 1 : UINT_MAX };
585 newClass->propertyTable.addEntry(
e, newClass->size);
587 newClass->nameMap.add(newClass->size, identifier);
588 newClass->propertyData.add(newClass->size,
data);
590 if (
data.isAccessor())
598void InternalClass::removeChildEntry(InternalClass *
child)
624 ||
object->internalClass()->size == oldClass->
size);
650 attrs.setConfigurable(
false);
682 attrs.setWritable(
false);
683 attrs.setConfigurable(
false);
697 return ic->d()->nonExtensible();
705 return ic->d()->canned();
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static void updateProtoUsage(Heap::Object *o, Heap::InternalClass *ic)
static Heap::InternalClass * cleanInternalClass(Heap::InternalClass *orig)
static PropertyAttributes attributesFromFlags(int flags)
static void addDummyEntry(InternalClass *newClass, PropertyHash::Entry e)
\qmltype Particle \inqmlmodule QtQuick.Particles
static const QCssKnownValue properties[NumProperties - 1]
static int grow(QLayoutStruct &ls, int delta)
static struct AttrInfo attrs[]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
QT_BEGIN_NAMESPACE int qPrimeForNumBits(int numBits)
Heap::InternalClass * internalClasses(InternalClassType icType)
Heap::InternalClass * classes[NClasses]
Heap::InternalClass * newClass(Heap::InternalClass *other)
void mark(QV4::MarkStack *markStack)
Pointer< InternalClass *, 0 > internalClass
Q_REQUIRED_RESULT InternalClass * locked()
Q_REQUIRED_RESULT InternalClass * cryopreserved()
static void addMember(QV4::Object *object, PropertyKey id, PropertyAttributes data, InternalClassEntry *entry)
Q_REQUIRED_RESULT InternalClass * sealed()
PropertyHash propertyTable
SharedInternalClassData< PropertyKey > nameMap
Q_REQUIRED_RESULT InternalClass * nonExtensible()
bool isUsedAsProto() const
Q_REQUIRED_RESULT InternalClass * frozen()
Q_REQUIRED_RESULT InternalClass * canned()
bool isImplicitlyFrozen() const
quint8 numRedundantTransitions
InternalClassTransition Transition
Q_REQUIRED_RESULT InternalClass * asProtoClass()
bool isExtensible() const
Q_REQUIRED_RESULT InternalClass * changeMember(PropertyKey identifier, PropertyAttributes data, InternalClassEntry *entry=nullptr)
Q_QML_PRIVATE_EXPORT QString keyAt(uint index) const
std::vector< Transition > transitions
InternalClassTransition & lookupOrInsertTransition(const InternalClassTransition &t)
static void markObjects(Heap::Base *ic, MarkStack *stack)
static void removeMember(QV4::Object *object, PropertyKey identifier)
void updateProtoUsage(Heap::Object *o)
@ MaxRedundantTransitions
PropertyHash::Entry * findEntry(const PropertyKey id)
SharedInternalClassData< PropertyAttributes > propertyData
static Heap::MemberData * allocate(QV4::ExecutionEngine *e, uint n, Heap::MemberData *old=nullptr)
PropertyHashData(int numBits)
PropertyHash::Entry * entries
void addEntry(const Entry &entry, int classSize)
void detach(bool grow, int classSize)
bool isStringOrSymbol() const
static PropertyKey fromId(quint64 id)
static PropertyKey invalid()
static constexpr Value fromReturnedValue(ReturnedValue val)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent