diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-02-13 10:02:28 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-03-20 11:17:11 +0000 |
commit | 7b7297470cde5645b2ea1db4cec7ac4bec87c1a3 (patch) | |
tree | f6649d82123938b4ea79ebc9726480368af65335 /src/qml/memory/qv4heap_p.h | |
parent | 4e3fef5528587c3a360c7e8057ad8d9328f9e4cc (diff) |
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 <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/memory/qv4heap_p.h')
-rw-r--r-- | src/qml/memory/qv4heap_p.h | 23 |
1 files changed, 20 insertions, 3 deletions
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<ManagedVTable *>(mm_data & PointerMask); + VTable *gcGetVtable() const { + return reinterpret_cast<VTable *>(mm_data & PointerMask); } inline bool isMarked() const { return mm_data & MarkBit; |