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
QJSValuePrivate Class Reference

#include <qjsvalue_p.h>

+ Collaboration diagram for QJSValuePrivate:

Public Types

enum class  Kind {
  Undefined = 0x0 , Null = 0x2 , IntValue = 0x4 , BoolValue = 0x6 ,
  DoublePtr = 0x0 | s_pointerBit , QV4ValuePtr = 0x2 | s_pointerBit , QStringPtr = 0x4 | s_pointerBit
}
 

Static Public Member Functions

static Kind tag (quint64 raw)
 
static voidpointer (quint64 raw)
 
static quint64 encodePointer (void *pointer, Kind tag)
 
static quint64 encodeUndefined ()
 
static quint64 encodeNull ()
 
static int intValue (quint64 v)
 
static quint64 encode (int intValue)
 
static quint64 encode (uint uintValue)
 
static bool boolValue (quint64 v)
 
static quint64 encode (bool boolValue)
 
static double * doublePtr (quint64 v)
 
static quint64 encode (double doubleValue)
 
static QV4::Valueqv4ValuePtr (quint64 v)
 
static quint64 encode (const QV4::Value &qv4Value)
 
static QStringqStringPtr (quint64 v)
 
static quint64 encode (QString stringValue)
 
static quint64 encode (QLatin1String stringValue)
 
static QJSValue fromReturnedValue (QV4::ReturnedValue d)
 
template<typename T >
static const T * asManagedType (const QJSValue *jsval)
 
static QV4::ValuetakeManagedValue (QJSValue *jsval)
 
static QV4::ReturnedValue asPrimitiveType (const QJSValue *jsval)
 
static const QStringasQString (const QJSValue *jsval)
 
static QV4::ReturnedValue asReturnedValue (const QJSValue *jsval)
 
static void setString (QJSValue *jsval, QString s)
 
static void adoptPersistentValue (QJSValue *jsval, QV4::Value *v)
 
static void setValue (QJSValue *jsval, const QV4::Value &v)
 
static void manageStringOnV4Heap (QV4::ExecutionEngine *e, QJSValue *jsval)
 
static QV4::ReturnedValue convertToReturnedValue (QV4::ExecutionEngine *e, const QJSValue &jsval)
 
static QV4::ExecutionEngineengine (const QJSValue *jsval)
 
static bool checkEngine (QV4::ExecutionEngine *e, const QJSValue &jsval)
 
static void free (QJSValue *jsval)
 

Static Public Attributes

static constexpr quint64 s_minAlignment = 1 << s_tagBits
 

Detailed Description

Definition at line 30 of file qjsvalue_p.h.

Member Enumeration Documentation

◆ Kind

enum class QJSValuePrivate::Kind
strong
Enumerator
Undefined 
Null 
IntValue 
BoolValue 
DoublePtr 
QV4ValuePtr 
QStringPtr 

Definition at line 38 of file qjsvalue_p.h.

Member Function Documentation

◆ adoptPersistentValue()

static void QJSValuePrivate::adoptPersistentValue ( QJSValue * jsval,
QV4::Value * v )
inlinestatic

Definition at line 285 of file qjsvalue_p.h.

References encodePointer(), and QV4ValuePtr.

Referenced by QJSValue::QJSValue().

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

◆ asManagedType()

template<typename T >
static const T * QJSValuePrivate::asManagedType ( const QJSValue * jsval)
inlinestatic

Definition at line 205 of file qjsvalue_p.h.

References QV4ValuePtr, qv4ValuePtr(), and tag.

+ Here is the call graph for this function:

◆ asPrimitiveType()

static QV4::ReturnedValue QJSValuePrivate::asPrimitiveType ( const QJSValue * jsval)
inlinestatic

Definition at line 226 of file qjsvalue_p.h.

References BoolValue, boolValue(), DoublePtr, doublePtr(), IntValue, intValue(), QV4::Encode::null(), Null, QStringPtr, QV4ValuePtr, tag, QV4::Encode::undefined(), and Undefined.

Referenced by convertToReturnedValue().

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

◆ asQString()

static const QString * QJSValuePrivate::asQString ( const QJSValue * jsval)
inlinestatic

Definition at line 248 of file qjsvalue_p.h.

References QStringPtr, qStringPtr(), and tag.

Referenced by QJSManagedValue::QJSManagedValue(), convertToReturnedValue(), QJSValue::equals(), QV4::QQmlContextWrapper::getPropertyAndBase(), manageStringOnV4Heap(), QJSValue::operator=(), QJSValue::strictlyEquals(), QJSValue::toBool(), QJSValue::toInt(), QJSValue::toNumber(), QJSValue::toPrimitive(), QJSValue::toString(), QJSValue::toUInt(), and QJSValue::toVariant().

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

◆ asReturnedValue()

◆ boolValue()

static bool QJSValuePrivate::boolValue ( quint64 v)
inlinestatic

Definition at line 117 of file qjsvalue_p.h.

References BoolValue, Q_ASSERT, and tag.

Referenced by asPrimitiveType(), asReturnedValue(), and encode().

+ Here is the caller graph for this function:

◆ checkEngine()

static bool QJSValuePrivate::checkEngine ( QV4::ExecutionEngine * e,
const QJSValue & jsval )
inlinestatic

Definition at line 331 of file qjsvalue_p.h.

References engine.

Referenced by QJSValue::call(), QJSManagedValue::call(), QJSValue::callAsConstructor(), QJSManagedValue::callAsConstructor(), QJSValue::callWithInstance(), QJSManagedValue::callWithInstance(), QJSManagedValue::jsMetaInstantiate(), QJSValue::setProperty(), and QJSValue::setProperty().

+ Here is the caller graph for this function:

◆ convertToReturnedValue()

static QV4::ReturnedValue QJSValuePrivate::convertToReturnedValue ( QV4::ExecutionEngine * e,
const QJSValue & jsval )
inlinestatic

◆ doublePtr()

static double * QJSValuePrivate::doublePtr ( quint64 v)
inlinestatic

Definition at line 128 of file qjsvalue_p.h.

References DoublePtr, Q_ASSERT, and tag.

Referenced by QJSValue::QJSValue(), asPrimitiveType(), asReturnedValue(), and free().

+ Here is the caller graph for this function:

◆ encode() [1/7]

static quint64 QJSValuePrivate::encode ( bool boolValue)
inlinestatic

Definition at line 123 of file qjsvalue_p.h.

References BoolValue, and boolValue().

+ Here is the call graph for this function:

◆ encode() [2/7]

static quint64 QJSValuePrivate::encode ( const QV4::Value & qv4Value)
inlinestatic

◆ encode() [3/7]

static quint64 QJSValuePrivate::encode ( double doubleValue)
inlinestatic

Definition at line 134 of file qjsvalue_p.h.

References DoublePtr, and encodePointer().

+ Here is the call graph for this function:

◆ encode() [4/7]

static quint64 QJSValuePrivate::encode ( int intValue)
inlinestatic

Definition at line 105 of file qjsvalue_p.h.

References IntValue, and intValue().

Referenced by QJSValue::QJSValue(), QJSValue::QJSValue(), and QJSValue::QJSValue().

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

◆ encode() [5/7]

static quint64 QJSValuePrivate::encode ( QLatin1String stringValue)
inlinestatic

Definition at line 192 of file qjsvalue_p.h.

References encodePointer(), and QStringPtr.

+ Here is the call graph for this function:

◆ encode() [6/7]

static quint64 QJSValuePrivate::encode ( QString stringValue)
inlinestatic

Definition at line 187 of file qjsvalue_p.h.

References encodePointer(), and QStringPtr.

+ Here is the call graph for this function:

◆ encode() [7/7]

static quint64 QJSValuePrivate::encode ( uint uintValue)
inlinestatic

Definition at line 110 of file qjsvalue_p.h.

References encode.

◆ encodeNull()

static quint64 QJSValuePrivate::encodeNull ( )
inlinestatic

Definition at line 94 of file qjsvalue_p.h.

References Null.

Referenced by QJSValue::QJSValue(), and encode().

+ Here is the caller graph for this function:

◆ encodePointer()

static quint64 QJSValuePrivate::encodePointer ( void * pointer,
Kind tag )
inlinestatic

Definition at line 82 of file qjsvalue_p.h.

References Q_ASSERT, and tag.

Referenced by adoptPersistentValue(), encode(), encode(), encode(), and encode().

+ Here is the caller graph for this function:

◆ encodeUndefined()

static quint64 QJSValuePrivate::encodeUndefined ( )
inlinestatic

Definition at line 89 of file qjsvalue_p.h.

References Undefined.

Referenced by QJSValue::QJSValue(), encode(), and takeManagedValue().

+ Here is the caller graph for this function:

◆ engine()

static QV4::ExecutionEngine * QJSValuePrivate::engine ( const QJSValue * jsval)
inlinestatic

Definition at line 321 of file qjsvalue_p.h.

References QV4::PersistentValueStorage::getEngine(), QV4ValuePtr, qv4ValuePtr(), and tag.

Referenced by QJSValue::call(), QJSValue::callAsConstructor(), QJSValue::callWithInstance(), caughtResult(), QJSValue::deleteProperty(), QJSValue::hasOwnProperty(), QJSValue::hasProperty(), QJSValueIteratorPrivate::init(), QJSEngine::installExtensions(), QJSValue::property(), QJSValue::property(), QJSValue::prototype(), sequenceInterface(), QJSManagedValue::setProperty(), QJSValue::setProperty(), QJSManagedValue::setProperty(), QJSValue::setProperty(), QJSValue::setPrototype(), QJSValue::toQMetaObject(), and QJSValue::toQObject().

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

◆ free()

static void QJSValuePrivate::free ( QJSValue * jsval)
inlinestatic

Definition at line 337 of file qjsvalue_p.h.

References BoolValue, QThread::currentThread(), DoublePtr, doublePtr(), QV4::PersistentValueStorage::free(), QV4::PersistentValueStorage::getEngine(), IntValue, QMetaObject::invokeMethod(), Null, Q_ASSERT, QStringPtr, qStringPtr(), QV4ValuePtr, qv4ValuePtr(), tag, and Undefined.

Referenced by QJSValue::~QJSValue(), and QJSValue::operator=().

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

◆ fromReturnedValue()

static QJSValue QJSValuePrivate::fromReturnedValue ( QV4::ReturnedValue d)
inlinestatic

Definition at line 197 of file qjsvalue_p.h.

References d, and setValue().

Referenced by QtObject::binding(), QJSValue::call(), QJSManagedValue::call(), QJSValue::callAsConstructor(), QJSManagedValue::callAsConstructor(), QuickTestUtil::callerFile(), QJSValue::callWithInstance(), QJSManagedValue::callWithInstance(), QJSEngine::catchError(), QQuickCanvasItem::context(), createOrConstructValueType(), QQmlValueTypeProvider::createValueType(), QQmlDelegateModelGroupPrivate::emitChanges(), QJSEngine::evaluate(), QQuickSpinBoxPrivate::evaluateTextFromValue(), QQuickSpinBoxPrivate::evaluateValueFromText(), QQuickWorkerScript::event(), QQmlDelegateModelGroup::get(), QQmlListModel::get(), QJSEngine::globalObject(), QQmlContext::importedScript(), QJSEngine::importModule(), QQmlPrivate::AOTCompiledContext::javaScriptGlobalProperty(), QQmlPrivate::AOTCompiledContext::jsMetaType(), QV4Include::method_include(), QJSEngine::newArray(), QJSEngine::newErrorObject(), QJSEngine::newObject(), QJSEngine::newQMetaObject(), QJSEngine::newQObject(), QJSEngine::newSymbol(), objectToVariant(), QJSManagedValue::property(), QJSValue::property(), QJSManagedValue::property(), QJSValue::property(), QJSValue::prototype(), QV4::QObjectWrapper::setProperty(), QQmlBinding::slowWrite(), QJSManagedValue::toJSValue(), toVariant(), QuickTestUtil::typeName(), QJSValueIterator::value(), and QQmlPropertyPrivate::write().

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

◆ intValue()

static int QJSValuePrivate::intValue ( quint64 v)
inlinestatic

Definition at line 99 of file qjsvalue_p.h.

References IntValue, Q_ASSERT, and tag.

Referenced by asPrimitiveType(), asReturnedValue(), and encode().

+ Here is the caller graph for this function:

◆ manageStringOnV4Heap()

static void QJSValuePrivate::manageStringOnV4Heap ( QV4::ExecutionEngine * e,
QJSValue * jsval )
inlinestatic

Definition at line 296 of file qjsvalue_p.h.

References asQString(), encode, QV4::Value::fromHeapObject(), and QV4::ExecutionEngine::newString().

+ Here is the call graph for this function:

◆ pointer()

static void * QJSValuePrivate::pointer ( quint64 raw)
inlinestatic

Definition at line 76 of file qjsvalue_p.h.

References Q_ASSERT, and tag.

◆ qStringPtr()

static QString * QJSValuePrivate::qStringPtr ( quint64 v)
inlinestatic

Definition at line 181 of file qjsvalue_p.h.

References Q_ASSERT, QStringPtr, and tag.

Referenced by QJSValue::QJSValue(), asQString(), and free().

+ Here is the caller graph for this function:

◆ qv4ValuePtr()

static QV4::Value * QJSValuePrivate::qv4ValuePtr ( quint64 v)
inlinestatic

Definition at line 139 of file qjsvalue_p.h.

References Q_ASSERT, QV4ValuePtr, and tag.

Referenced by QJSValue::QJSValue(), asManagedType(), asReturnedValue(), engine(), free(), QJSValue::isString(), QJSValue::isUndefined(), and takeManagedValue().

+ Here is the caller graph for this function:

◆ setString()

static void QJSValuePrivate::setString ( QJSValue * jsval,
QString s )
inlinestatic

Definition at line 278 of file qjsvalue_p.h.

References encode.

Referenced by QJSValue::operator=().

+ Here is the caller graph for this function:

◆ setValue()

static void QJSValuePrivate::setValue ( QJSValue * jsval,
const QV4::Value & v )
inlinestatic

Definition at line 290 of file qjsvalue_p.h.

References encode.

Referenced by fromReturnedValue(), QV4::ExecutionEngine::metaTypeFromJS(), QJSValue::operator=(), and ListModel::set().

+ Here is the caller graph for this function:

◆ tag()

static Kind QJSValuePrivate::tag ( quint64 raw)
inlinestatic

Definition at line 56 of file qjsvalue_p.h.

Referenced by QJSValue::QJSValue(), QJSValue::isBool(), QJSValue::isNull(), QJSValue::isNumber(), QJSValue::isString(), and QJSValue::isUndefined().

+ Here is the caller graph for this function:

◆ takeManagedValue()

static QV4::Value * QJSValuePrivate::takeManagedValue ( QJSValue * jsval)
inlinestatic

Definition at line 215 of file qjsvalue_p.h.

References encodeUndefined(), QV4ValuePtr, qv4ValuePtr(), and tag.

Referenced by QJSManagedValue::QJSManagedValue(), QV4::QQmlContextWrapper::getPropertyAndBase(), and QQuickLoader::setSource().

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

Member Data Documentation

◆ s_minAlignment

constexpr quint64 QJSValuePrivate::s_minAlignment = 1 << s_tagBits
staticconstexpr

Definition at line 71 of file qjsvalue_p.h.


The documentation for this class was generated from the following file: