Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QV4::Heap::InternalClass Struct Reference

#include <qv4internalclass_p.h>

+ Inheritance diagram for QV4::Heap::InternalClass:
+ Collaboration diagram for QV4::Heap::InternalClass:

Classes

struct  IndexAndAttribute
 

Public Types

enum  Flag {
  NotExtensible = 1 << 0 , Sealed = 1 << 1 , Frozen = 1 << 2 , UsedAsProto = 1 << 3 ,
  Locked = 1 << 4
}
 
enum  { MaxRedundantTransitions = 255 }
 
typedef InternalClassTransition Transition
 

Public Member Functions

InternalClassTransitionlookupOrInsertTransition (const InternalClassTransition &t)
 
bool isExtensible () const
 
bool isSealed () const
 
bool isFrozen () const
 
bool isUsedAsProto () const
 
bool isLocked () const
 
void init (ExecutionEngine *engine)
 
void init (InternalClass *other)
 
void destroy ()
 
Q_QML_PRIVATE_EXPORT QString keyAt (uint index) const
 
Q_REQUIRED_RESULT InternalClassnonExtensible ()
 
Q_REQUIRED_RESULT InternalClasslocked ()
 
Q_REQUIRED_RESULT InternalClassaddMember (PropertyKey identifier, PropertyAttributes data, InternalClassEntry *entry=nullptr)
 
Q_REQUIRED_RESULT InternalClasschangeMember (PropertyKey identifier, PropertyAttributes data, InternalClassEntry *entry=nullptr)
 
PropertyHash::EntryfindEntry (const PropertyKey id)
 
InternalClassEntry find (const PropertyKey id)
 
IndexAndAttribute findValueOrGetter (const PropertyKey id)
 
IndexAndAttribute findValueOrSetter (const PropertyKey id)
 
uint indexOfValueOrGetter (const PropertyKey id)
 
bool verifyIndex (const PropertyKey id, uint index)
 
Q_REQUIRED_RESULT InternalClasssealed ()
 
Q_REQUIRED_RESULT InternalClassfrozen ()
 
Q_REQUIRED_RESULT InternalClasscanned ()
 
Q_REQUIRED_RESULT InternalClasscryopreserved ()
 
bool isImplicitlyFrozen () const
 
Q_REQUIRED_RESULT InternalClassasProtoClass ()
 
Q_REQUIRED_RESULT InternalClasschangeVTable (const VTable *vt)
 
Q_REQUIRED_RESULT InternalClasschangePrototype (Heap::Object *proto)
 
void updateProtoUsage (Heap::Object *o)
 
- Public Member Functions inherited from QV4::Heap::Base
voidoperator new (size_t)=delete
 
ReturnedValue asReturnedValue () const
 
void mark (QV4::MarkStack *markStack)
 
bool isMarked () const
 
void setMarkBit ()
 
bool inUse () const
 
voidoperator new (size_t, Managed *m)
 
voidoperator new (size_t, Base *m)
 
void operator delete (void *, Base *)
 
void init ()
 
void destroy ()
 
Q_ALWAYS_INLINE void _checkIsInitialized ()
 
Q_ALWAYS_INLINE void _checkIsDestroyed ()
 
Q_ALWAYS_INLINE void _setInitialized ()
 
Q_ALWAYS_INLINE void _setDestroyed ()
 

Static Public Member Functions

static void addMember (QV4::Object *object, PropertyKey id, PropertyAttributes data, InternalClassEntry *entry)
 
static void changeMember (QV4::Object *object, PropertyKey id, PropertyAttributes data, InternalClassEntry *entry=nullptr)
 
static void removeMember (QV4::Object *object, PropertyKey identifier)
 
static void markObjects (Heap::Base *ic, MarkStack *stack)
 
- Static Public Member Functions inherited from QV4::Heap::Base
static void markObjects (Base *, MarkStack *)
 

Public Attributes

ExecutionEngineengine
 
const VTablevtable
 
quintptr protoId
 
Heap::Object * prototype
 
InternalClassparent
 
PropertyHash propertyTable
 
SharedInternalClassData< PropertyKeynameMap
 
SharedInternalClassData< PropertyAttributespropertyData
 
std::vector< Transitiontransitions
 
uint size
 
quint8 numRedundantTransitions
 
quint8 flags
 
- Public Attributes inherited from QV4::Heap::Base
Pointer< InternalClass *, 0 > internalClass
 

Friends

struct ::QV4::ExecutionEngine
 

Detailed Description

Definition at line 297 of file qv4internalclass_p.h.

Member Typedef Documentation

◆ Transition

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxRedundantTransitions 

Definition at line 305 of file qv4internalclass_p.h.

◆ Flag

Enumerator
NotExtensible 
Sealed 
Frozen 
UsedAsProto 
Locked 

Definition at line 298 of file qv4internalclass_p.h.

Member Function Documentation

◆ addMember() [1/2]

Heap::InternalClass * QV4::Heap::InternalClass::addMember ( PropertyKey  identifier,
PropertyAttributes  data,
InternalClassEntry entry = nullptr 
)

Definition at line 553 of file qv4internalclass.cpp.

References changeMember(), e, findEntry(), QV4::PropertyKey::isStringOrSymbol(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ addMember() [2/2]

void QV4::Heap::InternalClass::addMember ( QV4::Object object,
PropertyKey  id,
PropertyAttributes  data,
InternalClassEntry entry 
)
static

Definition at line 538 of file qv4internalclass.cpp.

References changeMember(), e, QV4::Heap::Base::internalClass, and Q_ASSERT.

Referenced by QV4::ExecutionEngine::ExecutionEngine(), QV4::Object::insertMember(), and QV4::Function::updateInternalClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asProtoClass()

Heap::InternalClass * QV4::Heap::InternalClass::asProtoClass ( )

Definition at line 724 of file qv4internalclass.cpp.

References engine, flags, QV4::PropertyKey::invalid(), isUsedAsProto(), lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), QV4::InternalClassTransition::ProtoClass, Q_ASSERT, and UsedAsProto.

+ Here is the call graph for this function:

◆ canned()

InternalClass * QV4::Heap::InternalClass::canned ( )

Definition at line 692 of file qv4internalclass.cpp.

References engine, and sealed().

+ Here is the call graph for this function:

◆ changeMember() [1/2]

Heap::InternalClass * QV4::Heap::InternalClass::changeMember ( PropertyKey  identifier,
PropertyAttributes  data,
InternalClassEntry entry = nullptr 
)

Definition at line 411 of file qv4internalclass.cpp.

References QV4::Heap::addDummyEntry(), QV4::Heap::cleanInternalClass(), e, engine, findEntry(), lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), propertyData, Q_ASSERT, and size.

Referenced by addMember(), addMember(), changeMember(), removeMember(), and QV4::ArrayObject::virtualDefineOwnProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeMember() [2/2]

void QV4::Heap::InternalClass::changeMember ( QV4::Object object,
PropertyKey  id,
PropertyAttributes  data,
InternalClassEntry entry = nullptr 
)
static

Definition at line 288 of file qv4internalclass.cpp.

References changeMember(), QV4::Heap::Base::internalClass, and Q_ASSERT.

+ Here is the call graph for this function:

◆ changePrototype()

Q_REQUIRED_RESULT InternalClass * QV4::Heap::InternalClass::changePrototype ( Heap::Object *  proto)
inline

Definition at line 447 of file qv4internalclass_p.h.

References prototype.

Referenced by QV4::ExecutionEngine::ExecutionEngine(), QV4::StringPrototype::init(), and QV4::Object::virtualSetPrototypeOf().

+ Here is the caller graph for this function:

◆ changeVTable()

Q_REQUIRED_RESULT InternalClass * QV4::Heap::InternalClass::changeVTable ( const VTable vt)
inline

Definition at line 442 of file qv4internalclass_p.h.

References vtable.

Referenced by QV4::ExecutionEngine::ExecutionEngine().

+ Here is the caller graph for this function:

◆ cryopreserved()

InternalClass * QV4::Heap::InternalClass::cryopreserved ( )

Definition at line 700 of file qv4internalclass.cpp.

References engine, and frozen().

+ Here is the call graph for this function:

◆ destroy()

void QV4::Heap::InternalClass::destroy ( )

Definition at line 261 of file qv4internalclass.cpp.

References QV4::PropertyHash::~PropertyHash(), QV4::Heap::Base::destroy(), engine, QV4::Heap::Base::isMarked(), nameMap, parent, propertyData, propertyTable, Q_ASSERT, and transitions.

+ Here is the call graph for this function:

◆ find()

InternalClassEntry QV4::Heap::InternalClass::find ( const PropertyKey  id)
inline

Definition at line 355 of file qv4internalclass_p.h.

References QV4::Attr_Invalid, e, QV4::PropertyHash::lookup(), propertyData, propertyTable, and Q_ASSERT.

+ Here is the call graph for this function:

◆ findEntry()

PropertyHash::Entry * QV4::Heap::InternalClass::findEntry ( const PropertyKey  id)
inline

Definition at line 344 of file qv4internalclass_p.h.

References e, QV4::PropertyHash::lookup(), propertyTable, and Q_ASSERT.

Referenced by addMember(), changeMember(), and removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findValueOrGetter()

IndexAndAttribute QV4::Heap::InternalClass::findValueOrGetter ( const PropertyKey  id)
inline

Definition at line 375 of file qv4internalclass_p.h.

References QV4::Attr_Invalid, e, QV4::PropertyHash::lookup(), propertyData, propertyTable, and Q_ASSERT.

+ Here is the call graph for this function:

◆ findValueOrSetter()

IndexAndAttribute QV4::Heap::InternalClass::findValueOrSetter ( const PropertyKey  id)
inline

Definition at line 389 of file qv4internalclass_p.h.

References QV4::Attr_Invalid, e, QV4::PropertyHash::lookup(), propertyData, propertyTable, and Q_ASSERT.

+ Here is the call graph for this function:

◆ frozen()

Heap::InternalClass * QV4::Heap::InternalClass::frozen ( )

Definition at line 660 of file qv4internalclass.cpp.

References attrs, engine, QV4::InternalClassTransition::Frozen, Frozen, i, QV4::PropertyKey::invalid(), isFrozen(), lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), propertyData, Q_ASSERT, and size.

Referenced by cryopreserved().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ indexOfValueOrGetter()

uint QV4::Heap::InternalClass::indexOfValueOrGetter ( const PropertyKey  id)
inline

Definition at line 408 of file qv4internalclass_p.h.

References e, QV4::PropertyHash::lookup(), propertyData, propertyTable, and Q_ASSERT.

+ Here is the call graph for this function:

◆ init() [1/2]

void QV4::Heap::InternalClass::init ( ExecutionEngine engine)

Definition at line 217 of file qv4internalclass.cpp.

References engine, QV4::Heap::Base::init(), QV4::Heap::Base::internalClass, nameMap, QV4::ExecutionEngine::newProtoId(), propertyData, propertyTable, protoId, transitions, and vtable.

Referenced by QV4::ExecutionEngine::ExecutionEngine(), and QV4::ExecutionEngine::newClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init() [2/2]

void QV4::Heap::InternalClass::init ( Heap::InternalClass other)

Definition at line 241 of file qv4internalclass.cpp.

References engine, QV4::Heap::Base::init(), QV4::Heap::Base::internalClass, nameMap, QV4::ExecutionEngine::newProtoId(), numRedundantTransitions, other(), parent, propertyData, propertyTable, protoId, prototype, transitions, and vtable.

+ Here is the call graph for this function:

◆ isExtensible()

bool QV4::Heap::InternalClass::isExtensible ( ) const
inline

Definition at line 325 of file qv4internalclass_p.h.

References NotExtensible.

Referenced by nonExtensible(), and QV4::Object::virtualSetPrototypeOf().

+ Here is the caller graph for this function:

◆ isFrozen()

bool QV4::Heap::InternalClass::isFrozen ( ) const
inline

Definition at line 327 of file qv4internalclass_p.h.

References Frozen.

Referenced by freeze_recursive(), frozen(), isImplicitlyFrozen(), sealed(), and QV4::QObjectWrapper::virtualPut().

+ Here is the caller graph for this function:

◆ isImplicitlyFrozen()

bool QV4::Heap::InternalClass::isImplicitlyFrozen ( ) const

Definition at line 708 of file qv4internalclass.cpp.

References attrs, i, isFrozen(), propertyData, and size.

+ Here is the call graph for this function:

◆ isLocked()

bool QV4::Heap::InternalClass::isLocked ( ) const
inline

Definition at line 329 of file qv4internalclass_p.h.

References Locked.

Referenced by locked(), QV4::ExecutionEngine::lockObject(), and QV4::Object::virtualSetPrototypeOf().

+ Here is the caller graph for this function:

◆ isSealed()

bool QV4::Heap::InternalClass::isSealed ( ) const
inline

Definition at line 326 of file qv4internalclass_p.h.

References Sealed.

Referenced by sealed().

+ Here is the caller graph for this function:

◆ isUsedAsProto()

bool QV4::Heap::InternalClass::isUsedAsProto ( ) const
inline

Definition at line 328 of file qv4internalclass_p.h.

References UsedAsProto.

Referenced by asProtoClass(), and updateProtoUsage().

+ Here is the caller graph for this function:

◆ keyAt()

QString QV4::Heap::InternalClass::keyAt ( uint  index) const

Definition at line 283 of file qv4internalclass.cpp.

References nameMap.

Referenced by QV4DataCollector::collectScope(), and QV4::Module::virtualOwnPropertyKeys().

+ Here is the caller graph for this function:

◆ locked()

InternalClass * QV4::Heap::InternalClass::locked ( )

Definition at line 520 of file qv4internalclass.cpp.

References engine, flags, QV4::PropertyKey::invalid(), isLocked(), QV4::InternalClassTransition::Locked, Locked, lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ lookupOrInsertTransition()

InternalClassTransition & QV4::Heap::InternalClass::lookupOrInsertTransition ( const InternalClassTransition t)

Definition at line 297 of file qv4internalclass.cpp.

References it, and transitions.

Referenced by asProtoClass(), changeMember(), frozen(), locked(), nonExtensible(), and sealed().

+ Here is the caller graph for this function:

◆ markObjects()

void QV4::Heap::InternalClass::markObjects ( Heap::Base ic,
MarkStack stack 
)
static

Definition at line 762 of file qv4internalclass.cpp.

References QV4::Heap::Base::mark(), nameMap, parent, and prototype.

+ Here is the call graph for this function:

◆ nonExtensible()

Heap::InternalClass * QV4::Heap::InternalClass::nonExtensible ( )

Definition at line 502 of file qv4internalclass.cpp.

References engine, flags, QV4::PropertyKey::invalid(), isExtensible(), lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), QV4::InternalClassTransition::NotExtensible, NotExtensible, and Q_ASSERT.

+ Here is the call graph for this function:

◆ removeMember()

void QV4::Heap::InternalClass::removeMember ( QV4::Object object,
PropertyKey  identifier 
)
static

Definition at line 611 of file qv4internalclass.cpp.

References QV4::Attr_Invalid, changeMember(), findEntry(), QV4::Heap::Base::internalClass, Q_ASSERT, and size.

+ Here is the call graph for this function:

◆ sealed()

Heap::InternalClass * QV4::Heap::InternalClass::sealed ( )

Definition at line 628 of file qv4internalclass.cpp.

References attrs, engine, i, QV4::PropertyKey::invalid(), isFrozen(), isSealed(), lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), propertyData, Q_ASSERT, QV4::InternalClassTransition::Sealed, Sealed, and size.

Referenced by canned().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProtoUsage()

void QV4::Heap::InternalClass::updateProtoUsage ( Heap::Object *  o)

Definition at line 753 of file qv4internalclass.cpp.

References QV4::EngineBase::Class_Empty, engine, QV4::EngineBase::internalClasses(), isUsedAsProto(), o, prototype, Q_ASSERT, and QV4::Heap::updateProtoUsage().

+ Here is the call graph for this function:

◆ verifyIndex()

bool QV4::Heap::InternalClass::verifyIndex ( const PropertyKey  id,
uint  index 
)
inline

Definition at line 421 of file qv4internalclass_p.h.

References e, QV4::PropertyHash::lookup(), propertyData, propertyTable, and Q_ASSERT.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ ::QV4::ExecutionEngine

friend struct ::QV4::ExecutionEngine
friend

Definition at line 463 of file qv4internalclass_p.h.

Member Data Documentation

◆ engine

◆ flags

quint8 QV4::Heap::InternalClass::flags

Definition at line 323 of file qv4internalclass_p.h.

Referenced by asProtoClass(), locked(), and nonExtensible().

◆ nameMap

◆ numRedundantTransitions

quint8 QV4::Heap::InternalClass::numRedundantTransitions

Definition at line 322 of file qv4internalclass_p.h.

Referenced by QV4::Heap::cleanInternalClass(), and init().

◆ parent

InternalClass* QV4::Heap::InternalClass::parent

Definition at line 311 of file qv4internalclass_p.h.

Referenced by QV4::Heap::cleanInternalClass(), destroy(), init(), and markObjects().

◆ propertyData

◆ propertyTable

◆ protoId

quintptr QV4::Heap::InternalClass::protoId

Definition at line 309 of file qv4internalclass_p.h.

Referenced by init(), init(), and QV4::Heap::updateProtoUsage().

◆ prototype

Heap::Object* QV4::Heap::InternalClass::prototype

◆ size

◆ transitions

std::vector<Transition> QV4::Heap::InternalClass::transitions

◆ vtable

const VTable* QV4::Heap::InternalClass::vtable

Definition at line 308 of file qv4internalclass_p.h.

Referenced by QV4::MemoryManager::allocManaged(), changeVTable(), init(), and init().


The documentation for this struct was generated from the following files: