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::SparseArrayData Struct Reference

#include <qv4arraydata_p.h>

+ Inheritance diagram for QV4::SparseArrayData:
+ Collaboration diagram for QV4::SparseArrayData:

Public Member Functions

V4_NEEDS_DESTROY SparseArraysparse () const
 
void setSparse (SparseArray *s)
 
uint mappedIndex (uint index) const
 
- Public Member Functions inherited from QV4::ArrayData
uint alloc () const
 
uintalloc ()
 
void setAlloc (uint a)
 
Type type () const
 
void setType (Type t)
 
PropertyAttributesattrs () const
 
void setAttrs (PropertyAttributes *a)
 
const ValuearrayData () const
 
void setArrayData (EngineBase *e, uint index, Value newVal)
 
const ArrayVTablevtable () const
 
bool isSparse () const
 
uint length () const
 
bool hasAttributes () const
 
PropertyAttributes attributes (uint i) const
 
bool isEmpty (uint i) const
 
ReturnedValue get (uint i) const
 
- Public Member Functions inherited from QV4::Managed
Heap::InternalClassinternalClass () const
 
const VTablevtable () const
 
ExecutionEngineengine () const
 
bool isV4SequenceType () const
 
bool isQmlListPropertyType () const
 
bool isArrayLike () const
 
bool isArrayObject () const
 
bool isStringObject () const
 
bool isSymbolObject () const
 
QString className () const
 
bool isEqualTo (const Managed *other) const
 
bool inUse () const
 
bool markBit () const
 
void mark (MarkStack *markStack)
 
Q_ALWAYS_INLINE Heap::BaseheapObject () const
 
template<typename T >
T * cast ()
 
template<typename T >
const T * cast () const
 
- Public Member Functions inherited from QV4::Value
 Value ()=default
 
constexpr Value (quint64 val)
 
bool isString () const
 
bool isStringOrSymbol () const
 
bool isSymbol () const
 
bool isObject () const
 
bool isFunctionObject () const
 
QML_NEARLY_ALWAYS_INLINE StringstringValue () const
 
QML_NEARLY_ALWAYS_INLINE StringOrSymbolstringOrSymbolValue () const
 
QML_NEARLY_ALWAYS_INLINE SymbolsymbolValue () const
 
QML_NEARLY_ALWAYS_INLINE ObjectobjectValue () const
 
QML_NEARLY_ALWAYS_INLINE ManagedPtr managed () const
 
QML_NEARLY_ALWAYS_INLINE Value::HeapBasePtr heapObject () const
 
int toUInt16 () const
 
int toInt32 () const
 
unsigned int toUInt32 () const
 
qint64 toLength () const
 
qint64 toIndex () const
 
bool toBoolean () const
 
double toInteger () const
 
ReturnedValue convertedToNumber () const
 
double toNumber () const
 
double toNumberImpl () const
 
QString toQStringNoThrow () const
 
QString toQString () const
 
QString toQString (bool *ok) const
 
Heap::StringtoString (ExecutionEngine *e) const
 
QV4::PropertyKey toPropertyKey (ExecutionEngine *e) const
 
Heap::Object * toObject (ExecutionEngine *e) const
 
bool isPrimitive () const
 
template<typename T >
const T * as () const
 
template<typename T >
T * as ()
 
template<typename T >
T * cast ()
 
template<typename T >
const T * cast () const
 
uint asArrayLength (bool *ok) const
 
bool sameValue (Value other) const
 
bool sameValueZero (Value other) const
 
void mark (MarkStack *markStack)
 
Valueoperator= (const ScopedValue &v)
 
Valueoperator= (ReturnedValue v)
 
Valueoperator= (ManagedPtr m)
 
Valueoperator= (HeapBasePtr o)
 
template<typename T >
Valueoperator= (const Scoped< T > &t)
 
template<>
const DateObjectas () const
 
template<>
const ErrorObjectas () const
 
template<>
const FunctionObjectas () const
 
template<>
const Managedas () const
 
template<>
const Objectas () const
 
template<>
const ArrayObjectas () const
 
template<>
const StringOrSymbolas () const
 
template<>
const Stringas () const
 
template<>
const UrlObjectas () const
 
template<>
const UrlSearchParamsObjectas () const
 
- Public Member Functions inherited from QV4::StaticValue
 StaticValue ()=default
 
constexpr StaticValue (quint64 val)
 
StaticValueoperator= (ReturnedValue v)
 
template<typename Value >
StaticValueoperator= (const Value &)
 
template<typename Value >
const ValueasValue () const
 
template<typename Value >
ValueasValue ()
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint64rawValueRef ()
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint64 rawValue () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setRawValue (quint64 raw)
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setTagValue (quint32 tag, quint32 value)
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 value () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 tag () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setTag (quint32 tag)
 
QV4_NEARLY_ALWAYS_INLINE constexpr int int_32 () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setInt_32 (int i)
 
QV4_NEARLY_ALWAYS_INLINE uint uint_32 () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setEmpty ()
 
Type type () const
 
quint64 quickType () const
 
bool isEmpty () const
 
bool isNull () const
 
bool isBoolean () const
 
bool isInteger () const
 
bool isNullOrUndefined () const
 
bool isUndefined () const
 
bool isDouble () const
 
bool isNumber () const
 
bool isManagedOrUndefined () const
 
bool isManaged () const
 
bool isIntOrBool () const
 
bool integerCompatible () const
 
bool isNaN () const
 
bool isPositiveInt () const
 
QV4_NEARLY_ALWAYS_INLINE double doubleValue () const
 
QV4_NEARLY_ALWAYS_INLINE void setDouble (double d)
 
bool isInt32 ()
 
double asDouble () const
 
bool booleanValue () const
 
int integerValue () const
 
bool tryIntegerConversion ()
 
bool toBoolean () const
 
int toInt32 () const
 
ReturnedValuedata_ptr ()
 
constexpr ReturnedValue asReturnedValue () const
 
template<>
StaticValueoperator= (const Value &value)
 
template<typename Managed >
StaticValueoperator= (const Managed &m)
 
template<>
ValueasValue ()
 
template<>
const ValueasValue () const
 

Static Public Member Functions

static uint allocate (Object *o, bool doubleSlot=false)
 
static void free (Heap::ArrayData *d, uint idx)
 
static Heap::ArrayData * reallocate (Object *o, uint n, bool enforceAttributes)
 
static ReturnedValue get (const Heap::ArrayData *d, uint index)
 
static bool put (Object *o, uint index, const Value &value)
 
static bool putArray (Object *o, uint index, const Value *values, uint n)
 
static bool del (Object *o, uint index)
 
static void setAttribute (Object *o, uint index, PropertyAttributes attrs)
 
static void push_front (Object *o, const Value *values, uint n)
 
static ReturnedValue pop_front (Object *o)
 
static uint truncate (Object *o, uint newLen)
 
static uint length (const Heap::ArrayData *d)
 
- Static Public Member Functions inherited from QV4::ArrayData
static void ensureAttributes (Object *o)
 
static void realloc (Object *o, Type newType, uint alloc, bool enforceAttributes)
 
static void sort (ExecutionEngine *engine, Object *thisObject, const Value &comparefn, uint dataLen)
 
static uint append (Object *obj, ArrayObject *otherObj, uint n)
 
static void insert (Object *o, uint index, const Value *v, bool isAccessor=false)
 
- Static Public Member Functions inherited from QV4::Value
static constexpr Value fromStaticValue (StaticValue staticValue)
 
static Value fromHeapObject (HeapBasePtr m)
 
static bool toBooleanImpl (Value val)
 
static double toNumberImpl (Value v)
 
static Heap::StringtoString (ExecutionEngine *e, Value val)
 
static Heap::Object * toObject (ExecutionEngine *e, Value val)
 
static constexpr Value fromReturnedValue (ReturnedValue val)
 
static double toInteger (double d)
 
static int toInt32 (double d)
 
static unsigned int toUInt32 (double d)
 
static constexpr Value emptyValue ()
 
static constexpr Value fromBoolean (bool b)
 
static constexpr Value fromInt32 (int i)
 
static constexpr Value undefinedValue ()
 
static constexpr Value nullValue ()
 
static Value fromDouble (double d)
 
static Value fromUInt32 (uint i)
 
- Static Public Member Functions inherited from QV4::StaticValue
static int valueOffset ()
 
static int tagOffset ()
 
static constexpr quint64 tagValue (quint32 tag, quint32 value)
 
static constexpr quint64 tagBitMask (TagBit bit)
 
static bool integerCompatible (StaticValue a, StaticValue b)
 
static bool bothDouble (StaticValue a, StaticValue b)
 
static QV4_NEARLY_ALWAYS_INLINE bool isInt32 (double d)
 
static constexpr StaticValue fromReturnedValue (ReturnedValue val)
 
static constexpr StaticValue emptyValue ()
 
static constexpr StaticValue fromBoolean (bool b)
 
static constexpr StaticValue fromInt32 (int i)
 
static constexpr StaticValue undefinedValue ()
 
static constexpr StaticValue nullValue ()
 
static StaticValue fromDouble (double d)
 
static StaticValue fromUInt32 (uint i)
 
static double toInteger (double d)
 
static int toInt32 (double d)
 
static unsigned int toUInt32 (double d)
 

Additional Inherited Members

- Public Types inherited from QV4::ArrayData
enum  { IsArrayData = true }
 
typedef Heap::ArrayData::Type Type
 
- Public Types inherited from QV4::Managed
enum  {
  IsExecutionContext = false , IsString = false , IsStringOrSymbol = false , IsObject = false ,
  IsFunctionObject = false , IsErrorObject = false , IsArrayData = false
}
 
enum  { NInlineProperties = 0 }
 
enum  Type {
  Type_Invalid , Type_String , Type_Object , Type_Symbol ,
  Type_ArrayObject , Type_FunctionObject , Type_GeneratorObject , Type_BooleanObject ,
  Type_NumberObject , Type_StringObject , Type_SymbolObject , Type_DateObject ,
  Type_RegExpObject , Type_ErrorObject , Type_ArgumentsObject , Type_JsonObject ,
  Type_MathObject , Type_ProxyObject , Type_UrlObject , Type_UrlSearchParamsObject ,
  Type_ExecutionContext , Type_InternalClass , Type_SetIteratorObject , Type_MapIteratorObject ,
  Type_ArrayIteratorObject , Type_StringIteratorObject , Type_ForInIterator , Type_RegExp ,
  Type_V4Sequence , Type_QmlListProperty
}
 
- Public Types inherited from QV4::Value
using ManagedPtr = Managed *
 
- Public Types inherited from QV4::StaticValue
enum class  TagBit {
  SpecialNegative = 0b10000000000000000000 << 12 , SpecialQNaN = 0b00000000000010000000 << 12 , Special = 0b00000000000001000000 << 12 , IntCompat = 0b00000000000000100000 << 12 ,
  Unmanaged = 0b00000000000000010000 << 12 , IntOrBool = 0b00000000000000001000 << 12 , Number = 0b00000000000000000100 << 12
}
 
enum  Type {
  Managed_Type = 0 , Double_Type = 1 , Undefined_Type = 2 , Empty_Type = quint32(TagBit::Unmanaged) ,
  Null_Type = Empty_Type | quint32(TagBit::IntCompat) , Boolean_Type = Null_Type | quint32(TagBit::IntOrBool) , Integer_Type = Boolean_Type | quint32(TagBit::Number)
}
 
enum  {
  Tag_Shift = 32 , IsIntegerConvertible_Shift = 48 , IsIntegerConvertible_Value = 3 , IsIntegerOrBool_Shift = 47 ,
  IsIntegerOrBool_Value = 7
}
 
enum class  QuickType : quint32 {
  Managed = Managed_Type , Empty = Empty_Type , Null = Null_Type , Boolean = Boolean_Type ,
  Integer = Integer_Type , PlusInf = quint32(TagBit::Number) | quint32(TagBit::Special) | quint32(TagBit::Unmanaged) , MinusInf = PlusInf | quint32(TagBit::SpecialNegative) , NaN = PlusInf | quint32(TagBit::SpecialQNaN) ,
  MinusNaN = NaN | quint32(TagBit::SpecialNegative)
}
 
enum  {
  QT_Empty = Empty_Type , QT_Null = Null_Type , QT_Bool = Boolean_Type , QT_Int = Integer_Type ,
  QuickType_Shift = Tag_Shift
}
 
using HeapBasePtr = Heap::Base *
 
using ValueTypeInternal = QuickType
 
- Public Attributes inherited from QV4::StaticValue
quint64 _val
 
- Static Public Attributes inherited from QV4::StaticValue
static constexpr quint64 ExponentMask = 0b0111111111110000ull << 48
 
static constexpr quint64 Top1Mask = 0b1000000000000000ull << 48
 
static constexpr quint64 Upper3Mask = 0b0000000000001110ull << 48
 
static constexpr quint64 Lower5Mask = 0b0000000000011111ull
 
static constexpr quint64 ManagedMask = ExponentMask | quint64(TagBit::Unmanaged) << Tag_Shift
 
static constexpr quint64 DoubleMask = ManagedMask | quint64(TagBit::Special) << Tag_Shift
 
static constexpr quint64 NumberMask = ManagedMask | quint64(TagBit::Number) << Tag_Shift
 
static constexpr quint64 IntOrBoolMask = ManagedMask | quint64(TagBit::IntOrBool) << Tag_Shift
 
static constexpr quint64 IntCompatMask = ManagedMask | quint64(TagBit::IntCompat) << Tag_Shift
 
static constexpr quint64 EncodeMask = DoubleMask | NumberMask
 
static constexpr quint64 DoubleDiscriminator = ((quint64(TagBit::Unmanaged) | quint64(TagBit::Special)) << Tag_Shift)
 
static constexpr quint64 NumberDiscriminator = ((quint64(TagBit::Unmanaged) | quint64(TagBit::Number)) << Tag_Shift)
 
- Static Protected Member Functions inherited from QV4::Managed
static bool virtualIsEqualTo (Managed *m, Managed *other)
 
- Static Protected Attributes inherited from QV4::VTableBase
static constexpr VTable::Destroy virtualDestroy = nullptr
 
static constexpr VTable::IsEqualTo virtualIsEqualTo = nullptr
 
static constexpr VTable::Get virtualGet = nullptr
 
static constexpr VTable::Put virtualPut = nullptr
 
static constexpr VTable::DeleteProperty virtualDeleteProperty = nullptr
 
static constexpr VTable::HasProperty virtualHasProperty = nullptr
 
static constexpr VTable::GetOwnProperty virtualGetOwnProperty = nullptr
 
static constexpr VTable::DefineOwnProperty virtualDefineOwnProperty = nullptr
 
static constexpr VTable::IsExtensible virtualIsExtensible = nullptr
 
static constexpr VTable::PreventExtensions virtualPreventExtensions = nullptr
 
static constexpr VTable::GetPrototypeOf virtualGetPrototypeOf = nullptr
 
static constexpr VTable::SetPrototypeOf virtualSetPrototypeOf = nullptr
 
static constexpr VTable::GetLength virtualGetLength = nullptr
 
static constexpr VTable::OwnPropertyKeys virtualOwnPropertyKeys = nullptr
 
static constexpr VTable::InstanceOf virtualInstanceOf = nullptr
 
static constexpr VTable::Call virtualCall = nullptr
 
static constexpr VTable::CallAsConstructor virtualCallAsConstructor = nullptr
 
static constexpr VTable::CallWithMetaTypes virtualCallWithMetaTypes = nullptr
 
static constexpr VTable::ResolveLookupGetter virtualResolveLookupGetter = nullptr
 
static constexpr VTable::ResolveLookupSetter virtualResolveLookupSetter = nullptr
 
static constexpr VTable::Metacall virtualMetacall = nullptr
 

Detailed Description

Definition at line 208 of file qv4arraydata_p.h.

Member Function Documentation

◆ allocate()

uint SparseArrayData::allocate ( Object * o,
bool doubleSlot = false )
static

Definition at line 323 of file qv4arraydata.cpp.

References QV4::ArrayData::alloc(), QV4::Attr_Accessor, QV4::Attr_Data, QV4::ArrayData::attrs(), QV4::StaticValue::int_32(), QV4::StaticValue::isInteger(), o, Q_ASSERT, and reallocate().

Referenced by QV4::ArrayData::insert(), push_front(), put(), and setAttribute().

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

◆ del()

bool SparseArrayData::del ( Object * o,
uint index )
static

Definition at line 388 of file qv4arraydata.cpp.

References QV4::Attr_Data, QV4::ArrayData::attrs(), QV4::PropertyAttributes::isAccessor(), QV4::PropertyAttributes::isConfigurable(), QV4::ArrayData::isEmpty(), o, Q_ASSERT, QV4::ArrayData::type(), and QV4::StaticValue::value().

+ Here is the call graph for this function:

◆ free()

void SparseArrayData::free ( Heap::ArrayData * d,
uint idx )
static

Definition at line 300 of file qv4arraydata.cpp.

References d, and Q_ASSERT.

Referenced by pop_front(), setAttribute(), and truncate().

+ Here is the caller graph for this function:

◆ get()

ReturnedValue SparseArrayData::get ( const Heap::ArrayData * d,
uint index )
static

Definition at line 362 of file qv4arraydata.cpp.

References d, QV4::Value::emptyValue(), and QV4::Heap::SparseArrayData::mappedIndex().

+ Here is the call graph for this function:

◆ length()

uint SparseArrayData::length ( const Heap::ArrayData * d)
static

Definition at line 491 of file qv4arraydata.cpp.

References d.

◆ mappedIndex()

uint QV4::SparseArrayData::mappedIndex ( uint index) const
inline

Definition at line 220 of file qv4arraydata_p.h.

References d.

◆ pop_front()

ReturnedValue SparseArrayData::pop_front ( Object * o)
static

Definition at line 451 of file qv4arraydata.cpp.

References d, free(), o, Q_ASSERT, and QV4::Encode::undefined().

+ Here is the call graph for this function:

◆ push_front()

void SparseArrayData::push_front ( Object * o,
const Value * values,
uint n )
static

Definition at line 439 of file qv4arraydata.cpp.

References allocate(), d, i, o, Q_ASSERT, and QV4::ArrayData::setArrayData().

+ Here is the call graph for this function:

◆ put()

bool SparseArrayData::put ( Object * o,
uint index,
const Value & value )
static

Definition at line 371 of file qv4arraydata.cpp.

References allocate(), QV4::Attr_Data, o, Q_ASSERT, and QV4::ArrayData::setArrayData().

Referenced by putArray().

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

◆ putArray()

bool SparseArrayData::putArray ( Object * o,
uint index,
const Value * values,
uint n )
static

Definition at line 501 of file qv4arraydata.cpp.

References i, o, and put().

+ Here is the call graph for this function:

◆ reallocate()

Heap::ArrayData * SparseArrayData::reallocate ( Object * o,
uint n,
bool enforceAttributes )
static

Definition at line 316 of file qv4arraydata.cpp.

References o, and QV4::ArrayData::realloc().

Referenced by allocate().

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

◆ setAttribute()

void SparseArrayData::setAttribute ( Object * o,
uint index,
PropertyAttributes attrs )
static

Definition at line 422 of file qv4arraydata.cpp.

References allocate(), QV4::ArrayData::attrs(), d, free(), QV4::PropertyAttributes::isAccessor(), o, and QV4::SparseArrayNode::value.

+ Here is the call graph for this function:

◆ setSparse()

void QV4::SparseArrayData::setSparse ( SparseArray * s)
inline

Definition at line 215 of file qv4arraydata_p.h.

References d.

◆ sparse()

V4_NEEDS_DESTROY SparseArray * QV4::SparseArrayData::sparse ( ) const
inline

Definition at line 214 of file qv4arraydata_p.h.

References d.

◆ truncate()

uint SparseArrayData::truncate ( Object * o,
uint newLen )
static

Definition at line 466 of file qv4arraydata.cpp.

References begin(), d, QSet< T >::end(), QSet< T >::erase(), free(), it, and o.

+ Here is the call graph for this function:

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