21#include <QtCore/QString>
23#include <private/qv4heap_p.h>
24#include <private/qv4internalclass_p.h>
25#include <private/qv4staticvalue_p.h>
27#include <private/qnumeric_p.h>
28#include <private/qv4calldata_p.h>
61 return reinterpret_cast<
String *>(
const_cast<
Value *>(
this));
71 return reinterpret_cast<
Symbol *>(
const_cast<
Value *>(
this));
76 return reinterpret_cast<
Object*>(
const_cast<
Value *>(
this));
81 return reinterpret_cast<
Managed*>(
const_cast<
Value *>(
this));
96 inline unsigned int toUInt32()
const;
102 return static_cast<
bool>(
int_32());
134 template <
typename T>
140#if !defined(QT_NO_QOBJECT_CHECK)
146 return static_cast<
const T *>(
this);
151 template <
typename T>
154 return const_cast<
T *>(
const_cast<
const Value *>(
this)->
as<
T>());
162 template<
typename T>
inline const T *
cast()
const {
163 return static_cast<
const T *>(
managed());
246 *
static_cast<
Value *>(
this) =
m;
253 return *
static_cast<
Value *>(
this);
259 return *
static_cast<
const Value *>(
this);
369 return static_cast<
unsigned int>(
toInt32());
379 if (
i > (
static_cast<
qint64>(1) << 53) - 1)
380 return (
static_cast<
qint64>(1) << 53) - 1;
392 if (
idx > (
static_cast<
qint64>(1) << 53) - 1)
410 HeapBasePtr base =
reinterpret_cast<HeapBasePtr>(
this) - (offset/
sizeof(Heap::Base));
411 Q_ASSERT(base->inUse());
415 void set(EngineBase *e,
const Value &newVal) {
416 WriteBarrier::write(e, base(), data_ptr(), newVal.asReturnedValue());
418 void set(EngineBase *e, HeapBasePtr b) {
419 WriteBarrier::write(e, base(), data_ptr(), b->asReturnedValue());
421 void set(EngineBase *e, ReturnedValue rv) {
422 WriteBarrier::write(e, base(), data_ptr(), rv);
434 Value::HeapBasePtr base =
reinterpret_cast<Value::HeapBasePtr>(
this)
435 - (offset/
sizeof(Heap::Base));
436 Q_ASSERT(base->inUse());
440 void set(EngineBase *e, uint index, Value v) {
441 WriteBarrier::write(e, base(), values[index].data_ptr(), v.asReturnedValue());
443 void set(EngineBase *e, uint index, Value::HeapBasePtr b) {
444 WriteBarrier::write(e, base(), values[index].data_ptr(), Value::fromHeapObject(b).asReturnedValue());
446 inline const Value &
operator[] (uint index)
const {
447 Q_ASSERT(index <
alloc);
448 return values[index];
450 inline const Value *
data()
const {
454 void mark(MarkStack *markStack) {
455 for (Value *v = values, *end = values + alloc; v < end; ++v)
473 Q_ASSERT(!Value::fromReturnedValue(v).isEmpty());
478 explicit operator bool()
const {
return !Value::fromReturnedValue(value).isEmpty(); }
ReturnedValue operator*() const
OptionalReturnedValue(ReturnedValue v)
ReturnedValue operator->() const
DECLARE_HEAP_OBJECT(StrictArgumentsObject, Object)
DECLARE_EXPORTED_HEAP_OBJECT(Object, Base)
DECLARE_HEAP_OBJECT(ArgumentsObject, Object)
Scoped< FunctionObject > ScopedFunctionObject
QVector< StackFrame > StackTrace
int qYouForgotTheQ_MANAGED_Macro(T, T)
Scoped< Object > ScopedObject
ReturnedValue value_convert(ExecutionEngine *e, const Value &v)
Scoped< ArrayObject > ScopedArrayObject
Scoped< String > ScopedString
Scoped< StringOrSymbol > ScopedStringOrSymbol
void qYouForgotTheQ_MANAGED_Macro(T1, T2)
@ Attr_ReadOnly_ButConfigurable
Q_STATIC_ASSERT(sizeof(CppStackFrame)==sizeof(JSTypesStackFrame))
Scoped< ExecutionContext > ScopedContext
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
DEFINE_OBJECT_VTABLE(StrictArgumentsObject)
DEFINE_OBJECT_VTABLE(ArgumentsObject)
#define V4_MANAGED_SIZE_TEST
#define V4_MANAGED_ITSELF(DataClass, superClass)
#define Q_MANAGED_TYPE(type)
#define V4_INTERNALCLASS(c)
static qint64 virtualGetLength(const Managed *m)
static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *desc, PropertyAttributes attrs)
Heap::CallContext * context() const
static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
static OwnPropertyKeyIterator * virtualOwnPropertyKeys(const Object *m, Value *target)
static bool isNonStrictArgumentsObject(Managed *m)
static bool virtualDeleteProperty(Managed *m, PropertyKey id)
bool fullyCreated() const
void removeMapping(uint arg)
static PropertyAttributes virtualGetOwnProperty(const Managed *m, PropertyKey id, Property *p)
bool isMapped(uint arg) const
static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver)
static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *p, PropertyAttributes attrs)
static qint64 virtualGetLength(const Managed *m)
QStringList toQStringList() const
static constexpr size_t offset
void set(EngineBase *e, HeapBasePtr b)
void set(EngineBase *e, const Value &newVal)
void init(const QStringList &list)
PropertyKey next(const Object *o, Property *pd=nullptr, PropertyAttributes *attrs=nullptr) override
const Value * data() const
void set(EngineBase *e, uint index, Value v)
void set(EngineBase *e, uint index, Value::HeapBasePtr b)
void mark(MarkStack *markStack)
Value::HeapBasePtr base()
const Value & operator[](uint index) const
static constexpr size_t offset