Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QV4::StaticValue Struct Reference

#include <qv4staticvalue_p.h>

Inheritance diagram for QV4::StaticValue:
Collaboration diagram for QV4::StaticValue:

Public Types

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 Member Functions

 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 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)

Public Attributes

quint64 _val

Static Public Attributes

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)

Detailed Description

Definition at line 44 of file qv4staticvalue_p.h.

Member Typedef Documentation

◆ HeapBasePtr

Definition at line 46 of file qv4staticvalue_p.h.

◆ ValueTypeInternal

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Tag_Shift 
IsIntegerConvertible_Shift 
IsIntegerConvertible_Value 
IsIntegerOrBool_Shift 
IsIntegerOrBool_Value 

Definition at line 190 of file qv4staticvalue_p.h.

◆ anonymous enum

anonymous enum
Enumerator
QT_Empty 
QT_Null 
QT_Bool 
QT_Int 
QuickType_Shift 

Definition at line 248 of file qv4staticvalue_p.h.

◆ QuickType

enum class QV4::StaticValue::QuickType : quint32
strong
Enumerator
Managed 
Empty 
Null 
Boolean 
Integer 
PlusInf 
MinusInf 
NaN 
MinusNaN 

Definition at line 228 of file qv4staticvalue_p.h.

◆ TagBit

enum class QV4::StaticValue::TagBit
strong
Enumerator
SpecialNegative 
SpecialQNaN 
Special 
IntCompat 
Unmanaged 
IntOrBool 
Number 

Definition at line 160 of file qv4staticvalue_p.h.

◆ Type

Enumerator
Managed_Type 
Double_Type 
Undefined_Type 
Empty_Type 
Null_Type 
Boolean_Type 
Integer_Type 

Definition at line 178 of file qv4staticvalue_p.h.

Constructor & Destructor Documentation

◆ StaticValue() [1/2]

QV4::StaticValue::StaticValue ( )
default

◆ StaticValue() [2/2]

QV4::StaticValue::StaticValue ( quint64 val)
inlineconstexpr

Definition at line 49 of file qv4staticvalue_p.h.

Member Function Documentation

◆ asDouble()

double QV4::StaticValue::asDouble ( ) const
inline

Definition at line 400 of file qv4staticvalue_p.h.

References doubleValue().

Here is the call graph for this function:

◆ asReturnedValue()

ReturnedValue QV4::StaticValue::asReturnedValue ( ) const
inlineconstexpr

Definition at line 452 of file qv4staticvalue_p.h.

◆ asValue() [1/4]

template<typename Value>
Value & QV4::StaticValue::asValue ( )

◆ asValue() [2/4]

template<>
Value & QV4::StaticValue::asValue ( )
inline

Definition at line 251 of file qv4value_p.h.

◆ asValue() [3/4]

template<typename Value>
const Value & QV4::StaticValue::asValue ( ) const

◆ asValue() [4/4]

template<>
const Value & QV4::StaticValue::asValue ( ) const
inline

Definition at line 257 of file qv4value_p.h.

◆ booleanValue()

bool QV4::StaticValue::booleanValue ( ) const
inline

Definition at line 406 of file qv4staticvalue_p.h.

◆ bothDouble()

bool QV4::StaticValue::bothDouble ( StaticValue a,
StaticValue b )
inlinestatic

Definition at line 339 of file qv4staticvalue_p.h.

References isDouble().

Here is the call graph for this function:

◆ data_ptr()

ReturnedValue * QV4::StaticValue::data_ptr ( )
inline

Definition at line 451 of file qv4staticvalue_p.h.

◆ doubleValue()

QV4_NEARLY_ALWAYS_INLINE double QV4::StaticValue::doubleValue ( ) const
inline

Definition at line 358 of file qv4staticvalue_p.h.

References isDouble().

Referenced by asDouble(), isInt32(), and toBoolean().

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

◆ emptyValue()

constexpr StaticValue QV4::StaticValue::emptyValue ( )
inlinestaticconstexpr

Definition at line 455 of file qv4staticvalue_p.h.

References Empty.

◆ fromBoolean()

constexpr StaticValue QV4::StaticValue::fromBoolean ( bool b)
inlinestaticconstexpr

Definition at line 456 of file qv4staticvalue_p.h.

References Boolean.

◆ fromDouble()

StaticValue QV4::StaticValue::fromDouble ( double d)
inlinestatic

Definition at line 461 of file qv4staticvalue_p.h.

References setDouble().

Here is the call graph for this function:

◆ fromInt32()

constexpr StaticValue QV4::StaticValue::fromInt32 ( int i)
inlinestaticconstexpr

Definition at line 457 of file qv4staticvalue_p.h.

References Integer.

◆ fromReturnedValue()

constexpr StaticValue QV4::StaticValue::fromReturnedValue ( ReturnedValue val)
inlinestaticconstexpr

Definition at line 453 of file qv4staticvalue_p.h.

◆ fromUInt32()

StaticValue QV4::StaticValue::fromUInt32 ( uint i)
inlinestatic

Definition at line 468 of file qv4staticvalue_p.h.

References Integer, and setDouble().

Here is the call graph for this function:

◆ int_32()

QV4_NEARLY_ALWAYS_INLINE constexpr int QV4::StaticValue::int_32 ( ) const
inlineconstexpr

Definition at line 145 of file qv4staticvalue_p.h.

◆ integerCompatible() [1/2]

bool QV4::StaticValue::integerCompatible ( ) const
inline

Definition at line 330 of file qv4staticvalue_p.h.

References isEmpty().

Referenced by integerCompatible(), and tryIntegerConversion().

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

◆ integerCompatible() [2/2]

bool QV4::StaticValue::integerCompatible ( StaticValue a,
StaticValue b )
inlinestatic

Definition at line 335 of file qv4staticvalue_p.h.

References integerCompatible().

Here is the call graph for this function:

◆ integerValue()

int QV4::StaticValue::integerValue ( ) const
inline

Definition at line 410 of file qv4staticvalue_p.h.

◆ isBoolean()

bool QV4::StaticValue::isBoolean ( ) const
inline

Definition at line 284 of file qv4staticvalue_p.h.

◆ isDouble()

bool QV4::StaticValue::isDouble ( ) const
inline

Definition at line 289 of file qv4staticvalue_p.h.

Referenced by bothDouble(), doubleValue(), isInt32(), and setDouble().

Here is the caller graph for this function:

◆ isEmpty()

bool QV4::StaticValue::isEmpty ( ) const
inline

Definition at line 282 of file qv4staticvalue_p.h.

Referenced by integerCompatible().

Here is the caller graph for this function:

◆ isInt32() [1/2]

bool QV4::StaticValue::isInt32 ( )
inline

Definition at line 382 of file qv4staticvalue_p.h.

References doubleValue(), isDouble(), isInt32(), and setInt_32().

Here is the call graph for this function:

◆ isInt32() [2/2]

QV4_NEARLY_ALWAYS_INLINE bool QV4::StaticValue::isInt32 ( double d)
inlinestatic

Definition at line 395 of file qv4staticvalue_p.h.

Referenced by isInt32(), and QV4::Encode::smallestNumber().

Here is the caller graph for this function:

◆ isInteger()

bool QV4::StaticValue::isInteger ( ) const
inline

Definition at line 285 of file qv4staticvalue_p.h.

◆ isIntOrBool()

bool QV4::StaticValue::isIntOrBool ( ) const
inline

Definition at line 323 of file qv4staticvalue_p.h.

◆ isManaged()

bool QV4::StaticValue::isManaged ( ) const
inline

Definition at line 318 of file qv4staticvalue_p.h.

References isManagedOrUndefined(), and isUndefined().

Here is the call graph for this function:

◆ isManagedOrUndefined()

bool QV4::StaticValue::isManagedOrUndefined ( ) const
inline

Definition at line 315 of file qv4staticvalue_p.h.

Referenced by isManaged(), and toBoolean().

Here is the caller graph for this function:

◆ isNaN()

bool QV4::StaticValue::isNaN ( ) const
inline

Definition at line 343 of file qv4staticvalue_p.h.

Referenced by setDouble().

Here is the caller graph for this function:

◆ isNull()

bool QV4::StaticValue::isNull ( ) const
inline

Definition at line 283 of file qv4staticvalue_p.h.

Referenced by isNullOrUndefined().

Here is the caller graph for this function:

◆ isNullOrUndefined()

bool QV4::StaticValue::isNullOrUndefined ( ) const
inline

Definition at line 286 of file qv4staticvalue_p.h.

References isNull(), and isUndefined().

Here is the call graph for this function:

◆ isNumber()

bool QV4::StaticValue::isNumber ( ) const
inline

Definition at line 302 of file qv4staticvalue_p.h.

◆ isPositiveInt()

bool QV4::StaticValue::isPositiveInt ( ) const
inline

Definition at line 354 of file qv4staticvalue_p.h.

◆ isUndefined()

bool QV4::StaticValue::isUndefined ( ) const
inline

Definition at line 287 of file qv4staticvalue_p.h.

Referenced by isManaged(), isNullOrUndefined(), and type().

Here is the caller graph for this function:

◆ nullValue()

constexpr StaticValue QV4::StaticValue::nullValue ( )
inlinestaticconstexpr

Definition at line 459 of file qv4staticvalue_p.h.

References Null.

Referenced by QV4::Encode::null().

Here is the caller graph for this function:

◆ operator=() [1/4]

template<typename Managed>
StaticValue & QV4::StaticValue::operator= ( const Managed & m)
inline

Definition at line 244 of file qv4value_p.h.

◆ operator=() [2/4]

template<typename Value>
StaticValue & QV4::StaticValue::operator= ( const Value & )

◆ operator=() [3/4]

template<>
StaticValue & QV4::StaticValue::operator= ( const Value & value)
inline

Definition at line 237 of file qv4value_p.h.

◆ operator=() [4/4]

StaticValue & QV4::StaticValue::operator= ( ReturnedValue v)
inline

Definition at line 51 of file qv4staticvalue_p.h.

◆ quickType()

quint64 QV4::StaticValue::quickType ( ) const
inline

Definition at line 279 of file qv4staticvalue_p.h.

◆ rawValue()

QV4_NEARLY_ALWAYS_INLINE constexpr quint64 QV4::StaticValue::rawValue ( ) const
inlineconstexpr

Definition at line 129 of file qv4staticvalue_p.h.

◆ rawValueRef()

QV4_NEARLY_ALWAYS_INLINE constexpr quint64 & QV4::StaticValue::rawValueRef ( )
inlineconstexpr

Definition at line 128 of file qv4staticvalue_p.h.

◆ setDouble()

QV4_NEARLY_ALWAYS_INLINE void QV4::StaticValue::setDouble ( double d)
inline

Definition at line 366 of file qv4staticvalue_p.h.

References isDouble(), and isNaN().

Referenced by fromDouble(), and fromUInt32().

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

◆ setEmpty()

QV4_NEARLY_ALWAYS_INLINE constexpr void QV4::StaticValue::setEmpty ( )
inlineconstexpr

Definition at line 155 of file qv4staticvalue_p.h.

◆ setInt_32()

QV4_NEARLY_ALWAYS_INLINE constexpr void QV4::StaticValue::setInt_32 ( int i)
inlineconstexpr

Definition at line 149 of file qv4staticvalue_p.h.

Referenced by isInt32().

Here is the caller graph for this function:

◆ setRawValue()

QV4_NEARLY_ALWAYS_INLINE constexpr void QV4::StaticValue::setRawValue ( quint64 raw)
inlineconstexpr

Definition at line 130 of file qv4staticvalue_p.h.

◆ setTag()

QV4_NEARLY_ALWAYS_INLINE constexpr void QV4::StaticValue::setTag ( quint32 tag)
inlineconstexpr

Definition at line 143 of file qv4staticvalue_p.h.

◆ setTagValue()

QV4_NEARLY_ALWAYS_INLINE constexpr void QV4::StaticValue::setTagValue ( quint32 tag,
quint32 value )
inlineconstexpr

Definition at line 140 of file qv4staticvalue_p.h.

◆ tag()

QV4_NEARLY_ALWAYS_INLINE constexpr quint32 QV4::StaticValue::tag ( ) const
inlineconstexpr

Definition at line 142 of file qv4staticvalue_p.h.

◆ tagBitMask()

constexpr quint64 QV4::StaticValue::tagBitMask ( TagBit bit)
inlinestaticconstexpr

Definition at line 176 of file qv4staticvalue_p.h.

References Tag_Shift.

◆ tagOffset()

int QV4::StaticValue::tagOffset ( )
inlinestatic

Definition at line 134 of file qv4staticvalue_p.h.

◆ tagValue()

constexpr quint64 QV4::StaticValue::tagValue ( quint32 tag,
quint32 value )
inlinestaticconstexpr

Definition at line 139 of file qv4staticvalue_p.h.

References Tag_Shift.

◆ toBoolean()

bool QV4::StaticValue::toBoolean ( ) const
inline

Definition at line 421 of file qv4staticvalue_p.h.

References doubleValue(), and isManagedOrUndefined().

Here is the call graph for this function:

◆ toInt32() [1/2]

int QV4::StaticValue::toInt32 ( ) const
inline

Definition at line 433 of file qv4staticvalue_p.h.

◆ toInt32() [2/2]

int QV4::StaticValue::toInt32 ( double d)
inlinestatic

Definition at line 484 of file qv4staticvalue_p.h.

Referenced by toUInt32().

Here is the caller graph for this function:

◆ toInteger()

double QV4::StaticValue::toInteger ( double d)
inlinestatic

Definition at line 479 of file qv4staticvalue_p.h.

◆ toUInt32()

unsigned int QV4::StaticValue::toUInt32 ( double d)
inlinestatic

Definition at line 489 of file qv4staticvalue_p.h.

References toInt32().

Here is the call graph for this function:

◆ tryIntegerConversion()

bool QV4::StaticValue::tryIntegerConversion ( )
inline

Definition at line 414 of file qv4staticvalue_p.h.

References integerCompatible().

Here is the call graph for this function:

◆ type()

Type QV4::StaticValue::type ( ) const
inline

Definition at line 256 of file qv4staticvalue_p.h.

References Boolean_Type, Double_Type, Empty_Type, Integer_Type, isUndefined(), Managed_Type, Null_Type, Undefined_Type, and Unmanaged.

Here is the call graph for this function:

◆ uint_32()

QV4_NEARLY_ALWAYS_INLINE uint QV4::StaticValue::uint_32 ( ) const
inline

Definition at line 153 of file qv4staticvalue_p.h.

◆ undefinedValue()

constexpr StaticValue QV4::StaticValue::undefinedValue ( )
inlinestaticconstexpr

Definition at line 458 of file qv4staticvalue_p.h.

Referenced by QV4::Encode::undefined().

Here is the caller graph for this function:

◆ value()

QV4_NEARLY_ALWAYS_INLINE constexpr quint32 QV4::StaticValue::value ( ) const
inlineconstexpr

Definition at line 141 of file qv4staticvalue_p.h.

◆ valueOffset()

int QV4::StaticValue::valueOffset ( )
inlinestatic

Definition at line 133 of file qv4staticvalue_p.h.

Member Data Documentation

◆ _val

quint64 QV4::StaticValue::_val

Definition at line 126 of file qv4staticvalue_p.h.

◆ DoubleDiscriminator

quint64 QV4::StaticValue::DoubleDiscriminator = ((quint64(TagBit::Unmanaged) | quint64(TagBit::Special)) << Tag_Shift)
staticconstexpr

Definition at line 222 of file qv4staticvalue_p.h.

◆ DoubleMask

quint64 QV4::StaticValue::DoubleMask = ManagedMask | quint64(TagBit::Special) << Tag_Shift
staticconstexpr

Definition at line 215 of file qv4staticvalue_p.h.

◆ EncodeMask

quint64 QV4::StaticValue::EncodeMask = DoubleMask | NumberMask
staticconstexpr

Definition at line 220 of file qv4staticvalue_p.h.

◆ ExponentMask

quint64 QV4::StaticValue::ExponentMask = 0b0111111111110000ull << 48
staticconstexpr

Definition at line 208 of file qv4staticvalue_p.h.

◆ IntCompatMask

quint64 QV4::StaticValue::IntCompatMask = ManagedMask | quint64(TagBit::IntCompat) << Tag_Shift
staticconstexpr

Definition at line 218 of file qv4staticvalue_p.h.

◆ IntOrBoolMask

quint64 QV4::StaticValue::IntOrBoolMask = ManagedMask | quint64(TagBit::IntOrBool) << Tag_Shift
staticconstexpr

Definition at line 217 of file qv4staticvalue_p.h.

◆ Lower5Mask

quint64 QV4::StaticValue::Lower5Mask = 0b0000000000011111ull
staticconstexpr

Definition at line 212 of file qv4staticvalue_p.h.

◆ ManagedMask

quint64 QV4::StaticValue::ManagedMask = ExponentMask | quint64(TagBit::Unmanaged) << Tag_Shift
staticconstexpr

Definition at line 214 of file qv4staticvalue_p.h.

◆ NumberDiscriminator

quint64 QV4::StaticValue::NumberDiscriminator = ((quint64(TagBit::Unmanaged) | quint64(TagBit::Number)) << Tag_Shift)
staticconstexpr

Definition at line 224 of file qv4staticvalue_p.h.

◆ NumberMask

quint64 QV4::StaticValue::NumberMask = ManagedMask | quint64(TagBit::Number) << Tag_Shift
staticconstexpr

Definition at line 216 of file qv4staticvalue_p.h.

◆ Top1Mask

quint64 QV4::StaticValue::Top1Mask = 0b1000000000000000ull << 48
staticconstexpr

Definition at line 210 of file qv4staticvalue_p.h.

◆ Upper3Mask

quint64 QV4::StaticValue::Upper3Mask = 0b0000000000001110ull << 48
staticconstexpr

Definition at line 211 of file qv4staticvalue_p.h.


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