Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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_EXPORT ReturnedValue 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
 
QVarLengthArray< Transition, 1 > transitions
 
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 316 of file qv4internalclass_p.h.

Member Typedef Documentation

◆ Transition

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxRedundantTransitions 

Definition at line 324 of file qv4internalclass_p.h.

◆ Flag

Enumerator
NotExtensible 
Sealed 
Frozen 
UsedAsProto 
Locked 

Definition at line 317 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 572 of file qv4internalclass.cpp.

References changeMember(), 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 557 of file qv4internalclass.cpp.

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

Referenced by QV4::ExecutionEngine::ExecutionEngine(), QV4::InternalClass::addMember(), and QV4::Object::insertMember().

+ 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 743 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 711 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 426 of file qv4internalclass.cpp.

References QV4::Heap::addDummyEntry(), QV4::Heap::cleanInternalClass(), engine, findEntry(), QV4::PropertyHash::Entry::index, lookupOrInsertTransition(), QV4::ExecutionEngine::newClass(), propertyData, Q_ASSERT, QV4::PropertyHash::Entry::setterIndex, and size.

Referenced by addMember(), addMember(), QV4::InternalClass::changeMember(), 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 303 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 466 of file qv4internalclass_p.h.

References prototype.

Referenced by QV4::ExecutionEngine::ExecutionEngine(), QV4::InternalClass::changePrototype(), QV4::ErrorObject::create(), QV4::ErrorObject::create(), QV4::ErrorObject::create(), 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 461 of file qv4internalclass_p.h.

References vtable.

Referenced by QV4::ExecutionEngine::ExecutionEngine(), and QV4::InternalClass::changeVTable().

+ Here is the caller graph for this function:

◆ cryopreserved()

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

Definition at line 719 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 270 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 374 of file qv4internalclass_p.h.

References QV4::Attr_Invalid, QV4::PropertyHash::Entry::index, QV4::PropertyHash::lookup(), propertyData, propertyTable, Q_ASSERT, and QV4::PropertyHash::Entry::setterIndex.

+ Here is the call graph for this function:

◆ findEntry()

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

Definition at line 363 of file qv4internalclass_p.h.

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

Referenced by addMember(), and changeMember().

+ 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 394 of file qv4internalclass_p.h.

References QV4::Attr_Invalid, QV4::PropertyHash::Entry::index, 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 408 of file qv4internalclass_p.h.

References QV4::Attr_Invalid, QV4::PropertyHash::Entry::index, QV4::PropertyHash::lookup(), propertyData, propertyTable, Q_ASSERT, and QV4::PropertyHash::Entry::setterIndex.

+ Here is the call graph for this function:

◆ frozen()

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

Definition at line 679 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 427 of file qv4internalclass_p.h.

References QV4::PropertyHash::Entry::index, 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 221 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 245 of file qv4internalclass.cpp.

References engine, QV4::Heap::Base::init(), QV4::Heap::Base::internalClass, QV4::WriteBarrier::isInsertionBarrier, QV4::WriteBarrier::markCustom(), 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 344 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 346 of file qv4internalclass_p.h.

References Frozen.

Referenced by freeze_recursive(), frozen(), isImplicitlyFrozen(), and sealed().

+ Here is the caller graph for this function:

◆ isImplicitlyFrozen()

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

Definition at line 727 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 348 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 345 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 347 of file qv4internalclass_p.h.

References UsedAsProto.

Referenced by asProtoClass(), and updateProtoUsage().

+ Here is the caller graph for this function:

◆ keyAt()

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

Definition at line 292 of file qv4internalclass.cpp.

References nameMap, Q_ASSERT, and QV4::Encode::undefined().

Referenced by QV4DataCollector::collectScope().

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

◆ locked()

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

Definition at line 539 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 312 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 781 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 521 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 630 of file qv4internalclass.cpp.

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

+ Here is the call graph for this function:

◆ sealed()

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

Definition at line 647 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 772 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 440 of file qv4internalclass_p.h.

References QV4::PropertyHash::Entry::index, 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 482 of file qv4internalclass_p.h.

Member Data Documentation

◆ engine

◆ flags

quint8 QV4::Heap::InternalClass::flags

Definition at line 342 of file qv4internalclass_p.h.

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

◆ nameMap

◆ numRedundantTransitions

quint8 QV4::Heap::InternalClass::numRedundantTransitions

Definition at line 341 of file qv4internalclass_p.h.

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

◆ parent

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

Definition at line 330 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 328 of file qv4internalclass_p.h.

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

◆ prototype

◆ size

◆ transitions

QVarLengthArray<Transition, 1> QV4::Heap::InternalClass::transitions

◆ vtable

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

Definition at line 327 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: