aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4heap_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/memory/qv4heap_p.h')
-rw-r--r--src/qml/memory/qv4heap_p.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h
index 606fd47cbb..a93e4191b0 100644
--- a/src/qml/memory/qv4heap_p.h
+++ b/src/qml/memory/qv4heap_p.h
@@ -60,10 +60,7 @@ struct VTable
namespace Heap {
struct Q_QML_EXPORT Base {
- union {
- const VTable *vtable;
- quintptr mm_data;
- };
+ quintptr mm_data; // vtable and markbit
inline ReturnedValue asReturnedValue() const;
inline void mark(QV4::ExecutionEngine *engine);
@@ -74,7 +71,11 @@ struct Q_QML_EXPORT Base {
PointerMask = ~0x3
};
- VTable *gcGetVtable() const {
+ void setVtable(const VTable *v) {
+ Q_ASSERT(!(mm_data & MarkBit));
+ mm_data = reinterpret_cast<quintptr>(v);
+ }
+ VTable *vtable() const {
return reinterpret_cast<VTable *>(mm_data & PointerMask);
}
inline bool isMarked() const {