From 7b7297470cde5645b2ea1db4cec7ac4bec87c1a3 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 13 Feb 2015 10:02:28 +0100 Subject: Cleanup some of the casting code Get rid of value_cast, and move the Managed::as() method into Value. Change-Id: I440ac44ae77f4fda1a8a837383fe631f432f6532 Reviewed-by: Simon Hausmann --- src/qml/memory/qv4heap_p.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/qml/memory/qv4heap_p.h') diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h index 3a7885467d..c396f0fd21 100644 --- a/src/qml/memory/qv4heap_p.h +++ b/src/qml/memory/qv4heap_p.h @@ -40,11 +40,28 @@ QT_BEGIN_NAMESPACE namespace QV4 { +struct VTable +{ + const VTable * const parent; + uint isExecutionContext : 1; + uint isString : 1; + uint isObject : 1; + uint isFunctionObject : 1; + uint isErrorObject : 1; + uint isArrayData : 1; + uint unused : 18; + uint type : 8; + const char *className; + void (*destroy)(Heap::Base *); + void (*markObjects)(Heap::Base *, ExecutionEngine *e); + bool (*isEqualTo)(Managed *m, Managed *other); +}; + namespace Heap { struct Q_QML_EXPORT Base { union { - const ManagedVTable *vtable; + const VTable *vtable; quintptr mm_data; }; @@ -57,8 +74,8 @@ struct Q_QML_EXPORT Base { PointerMask = ~0x3 }; - ManagedVTable *gcGetVtable() const { - return reinterpret_cast(mm_data & PointerMask); + VTable *gcGetVtable() const { + return reinterpret_cast(mm_data & PointerMask); } inline bool isMarked() const { return mm_data & MarkBit; -- cgit v1.2.3