3#ifndef QV4STATICVALUE_P_H
4#define QV4STATICVALUE_P_H
19#include <QtCore/private/qnumeric_p.h>
20#include <private/qtqmlglobal_p.h>
25#define QV4_NEARLY_ALWAYS_INLINE Q_ALWAYS_INLINE
27#define QV4_NEARLY_ALWAYS_INLINE inline
57 template<
typename Value>
60 template<
typename Value>
63 template<
typename Value>
132#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
137 static inline int tagOffset() {
return 0; }
169 Special = 0b00000000000001000000 << 12,
170 IntCompat = 0b00000000000000100000 << 12,
171 Unmanaged = 0b00000000000000010000 << 12,
172 IntOrBool = 0b00000000000000001000 << 12,
173 Number = 0b00000000000000000100 << 12,
336 return a.integerCompatible() &&
b.integerCompatible();
340 return a.isDouble() &&
b.isDouble();
362 memcpy(&
d, &unmasked, 8);
375 memcpy(&
_val, &
d, 8);
397 return (
i ==
d && !(
d == 0 && std::signbit(
d)));
423 return static_cast<bool>(
int_32());
430 return d && !std::isnan(
d);
441 return QJSNumberCoercion::toInteger(
doubleValue());
448 Q_UNREACHABLE_RETURN(0);
471 if (
i <
uint(std::numeric_limits<int>::max())) {
483 if (!
d || std::isinf(
d))
485 return d >= 0 ? std::floor(
d) : std::ceil(
d);
490 return QJSNumberCoercion::toInteger(
d);
502#if QT_POINTER_SIZE == 8
512#if 0 && defined(Q_OS_ANDROID) && defined(Q_PROCESSOR_ARM_64)
523#elif defined(Q_PROCESSOR_IA64)
529#elif defined(Q_PROCESSOR_SPARC_64)
548 template<
int Offset, qu
int64 Mask>
558 template<
int Offset, qu
int64 Mask>
561 constexpr quint64 OriginMask = movePointerBits<-
Offset, Mask>(Mask);
562 return movePointerBits<Offset, OriginMask>(
val);
565 template<
int Offset, qu
int64 Mask>
568 return movePointerBits<-
Offset, Mask>(
val);
576 const quint64 tmp = retrievePointerBits<Top1Shift, Top1Mask>(
577 retrievePointerBits<Upper3Shift, Upper3Mask>(
578 retrievePointerBits<Lower5Shift, Lower5Mask>(
_val)));
593 _val = storePointerBits<Top1Shift, Top1Mask>(
594 storePointerBits<Upper3Shift, Upper3Mask>(
595 storePointerBits<Lower5Shift, Lower5Mask>(tmp)));
597#elif QT_POINTER_SIZE == 4
613# error "unsupported pointer size"
645 :
val(
v.asReturnedValue())
649 template<
typename HeapBase>
654 val =
o->asReturnedValue();
659 return Encode(
static_cast<int>(
d));
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
#define Q_STATIC_ASSERT(Condition)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static Q_DECL_CONST_FUNCTION bool qt_is_nan(double d)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
#define QML_NEARLY_ALWAYS_INLINE
unsigned long long quint64
#define QV4_NEARLY_ALWAYS_INLINE
static ReturnedValue smallestNumber(double d)
constexpr Encode(StaticValue v)
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
constexpr Encode(ReturnedValue v)
QV4_NEARLY_ALWAYS_INLINE constexpr void setTagValue(quint32 tag, quint32 value)
StaticValue & operator=(ReturnedValue v)
QV4_NEARLY_ALWAYS_INLINE constexpr quint64 rawValue() const
static constexpr quint64 DoubleMask
quint64 quickType() const
static bool integerCompatible(StaticValue a, StaticValue b)
const Value & asValue() const
static StaticValue fromDouble(double d)
bool isManagedOrUndefined() const
static int toInt32(double d)
StaticValue & operator=(const Value &)
static constexpr StaticValue fromBoolean(bool b)
constexpr ReturnedValue asReturnedValue() const
static constexpr quint64 NumberDiscriminator
static QV4_NEARLY_ALWAYS_INLINE bool isInt32(double d)
static constexpr quint64 IntOrBoolMask
static double toInteger(double d)
static constexpr quint64 Upper3Mask
static constexpr quint64 IntCompatMask
QV4_NEARLY_ALWAYS_INLINE double doubleValue() const
static constexpr quint64 DoubleDiscriminator
QV4_NEARLY_ALWAYS_INLINE void setDouble(double d)
bool isPositiveInt() const
static constexpr StaticValue fromInt32(int i)
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 value() const
static StaticValue fromUInt32(uint i)
QV4_NEARLY_ALWAYS_INLINE constexpr void setInt_32(int i)
static constexpr quint64 EncodeMask
bool integerCompatible() const
static constexpr quint64 tagBitMask(TagBit bit)
QV4_NEARLY_ALWAYS_INLINE uint uint_32() const
static constexpr quint64 ManagedMask
static constexpr StaticValue emptyValue()
static constexpr quint64 NumberMask
bool tryIntegerConversion()
static constexpr quint64 Lower5Mask
static constexpr quint64 tagValue(quint32 tag, quint32 value)
static unsigned int toUInt32(double d)
static constexpr StaticValue undefinedValue()
QV4_NEARLY_ALWAYS_INLINE constexpr void setRawValue(quint64 raw)
bool isNullOrUndefined() const
constexpr StaticValue(quint64 val)
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 tag() const
bool booleanValue() const
QV4_NEARLY_ALWAYS_INLINE constexpr int int_32() const
ReturnedValue * data_ptr()
static constexpr quint64 ExponentMask
static constexpr StaticValue nullValue()
static bool bothDouble(StaticValue a, StaticValue b)
static constexpr quint64 Top1Mask
QV4_NEARLY_ALWAYS_INLINE constexpr void setTag(quint32 tag)
static constexpr StaticValue fromReturnedValue(ReturnedValue val)
@ IsIntegerConvertible_Value
@ IsIntegerConvertible_Shift
QV4_NEARLY_ALWAYS_INLINE constexpr void setEmpty()
QV4_NEARLY_ALWAYS_INLINE constexpr quint64 & rawValueRef()