Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QV4::RuntimeHelpers Struct Reference

#include <qv4runtime_p.h>

+ Collaboration diagram for QV4::RuntimeHelpers:

Static Public Member Functions

static ReturnedValue objectDefaultValue (const Object *object, int typeHint)
 
static ReturnedValue toPrimitive (const Value &value, TypeHint typeHint)
 
static ReturnedValue ordinaryToPrimitive (ExecutionEngine *engine, const Object *object, String *typeHint)
 
static double stringToNumber (const QString &s)
 
static Heap::StringstringFromNumber (ExecutionEngine *engine, double number)
 
static double toNumber (const Value &value)
 
static void numberToString (QString *result, double num, int radix=10)
 
static Heap::StringconvertToString (ExecutionEngine *engine, Value value, TypeHint=STRING_HINT)
 
static Heap::Object * convertToObject (ExecutionEngine *engine, const Value &value)
 
static Bool equalHelper (const Value &x, const Value &y)
 
static Bool strictEqual (const Value &x, const Value &y)
 
static ReturnedValue addHelper (ExecutionEngine *engine, const Value &left, const Value &right)
 

Detailed Description

Definition at line 61 of file qv4runtime_p.h.

Member Function Documentation

◆ addHelper()

QV4::ReturnedValue QV4::RuntimeHelpers::addHelper ( ExecutionEngine engine,
const Value left,
const Value right 
)
static

Definition at line 600 of file qv4runtime.cpp.

References QV4::MemoryManager::alloc(), QV4::StaticValue::asReturnedValue(), QV4::convert_to_string_add(), engine, QV4::PREFERREDTYPE_HINT, QV4::ScopedValue::ptr, and QV4::Value::stringValue().

+ Here is the call graph for this function:

◆ convertToObject()

Heap::Object * QV4::RuntimeHelpers::convertToObject ( ExecutionEngine engine,
const Value value 
)
static

Definition at line 534 of file qv4runtime.cpp.

References engine, and Q_ASSERT.

Referenced by QV4::Lookup::setterGeneric(), and QV4::Value::toObject().

+ Here is the caller graph for this function:

◆ convertToString()

Heap::String * QV4::RuntimeHelpers::convertToString ( ExecutionEngine engine,
Value  value,
TypeHint  hint = STRING_HINT 
)
static

Definition at line 557 of file qv4runtime.cpp.

References d, engine, hint(), and Q_ASSERT.

Referenced by QV4::Value::toString().

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

◆ equalHelper()

uint QV4::RuntimeHelpers::equalHelper ( const Value x,
const Value y 
)
static

Definition at line 1194 of file qv4runtime.cpp.

References QV4::Managed::engine(), QV4::Value::objectValue(), QV4::PREFERREDTYPE_HINT, and Q_ASSERT.

+ Here is the call graph for this function:

◆ numberToString()

void QV4::RuntimeHelpers::numberToString ( QString result,
double  num,
int  radix = 10 
)
static

Definition at line 192 of file qv4runtime.cpp.

References dot(), next, QString::number(), Q_ASSERT, qdtoa(), QStringLiteral, qt_is_inf(), sign(), and zero.

Referenced by QV4::NumberPrototype::method_toString(), and primitiveToQString().

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

◆ objectDefaultValue()

ReturnedValue QV4::RuntimeHelpers::objectDefaultValue ( const Object object,
int  typeHint 
)
static

Definition at line 455 of file qv4runtime.cpp.

References engine, hint(), QV4::NUMBER_HINT, and QV4::STRING_HINT.

Referenced by compareEqualInt(), and toPrimitive().

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

◆ ordinaryToPrimitive()

ReturnedValue QV4::RuntimeHelpers::ordinaryToPrimitive ( ExecutionEngine engine,
const Object object,
String typeHint 
)
static

Definition at line 493 of file qv4runtime.cpp.

References QV4::Value::as(), engine, o, QV4::StringOrSymbol::propertyKey(), Q_ASSERT, and qSwap().

Referenced by QV4::DatePrototype::method_symbolToPrimitive().

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

◆ strictEqual()

Bool QV4::RuntimeHelpers::strictEqual ( const Value x,
const Value y 
)
static

Definition at line 1231 of file qv4runtime.cpp.

References TRACE2.

Referenced by QV4::ArrayPrototype::method_indexOf(), QV4::IntrinsicTypedArrayPrototype::method_indexOf(), QV4::ArrayPrototype::method_lastIndexOf(), QV4::IntrinsicTypedArrayPrototype::method_lastIndexOf(), QJSManagedValue::strictlyEquals(), and QJSValue::strictlyEquals().

+ Here is the caller graph for this function:

◆ stringFromNumber()

Heap::String * QV4::RuntimeHelpers::stringFromNumber ( ExecutionEngine engine,
double  number 
)
static

Definition at line 448 of file qv4runtime.cpp.

References engine, and number.

Referenced by QV4::NumberPrototype::method_toFixed().

+ Here is the caller graph for this function:

◆ stringToNumber()

double QV4::RuntimeHelpers::stringToNumber ( const QString s)
static

Definition at line 403 of file qv4runtime.cpp.

References ba, base, begin(), QByteArray::constData(), d, ok, Q_INFINITY, qQNaN(), qstrtod(), QByteArray::size(), and QStringView::trimmed().

Referenced by compareEqualInt(), js_equal(), QJSValue::toInt(), QJSValue::toNumber(), QV4::Value::toNumberImpl(), QJSValue::toUInt(), and QV4::String::toUInt().

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

◆ toNumber()

double QV4::RuntimeHelpers::toNumber ( const Value value)
inlinestatic

Definition at line 89 of file qv4runtime_p.h.

Referenced by QV4::StringPrototype::method_lastIndexOf().

+ Here is the caller graph for this function:

◆ toPrimitive()

ReturnedValue QV4::RuntimeHelpers::toPrimitive ( const Value value,
TypeHint  typeHint 
)
inlinestatic

Definition at line 82 of file qv4runtime_p.h.

References objectDefaultValue().

Referenced by js_equal(), QV4::DatePrototype::method_toJSON(), QV4::Value::toNumberImpl(), QV4::Value::toPropertyKey(), QV4::Value::toQString(), QV4::Value::toQString(), QV4::Value::toQStringNoThrow(), and QV4::DateCtor::virtualCallAsConstructor().

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

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