aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-11-01 20:56:47 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-04 20:18:18 +0100
commit878b11e0a94e892c0377bca01b49706c150926ed (patch)
tree1b4a10f016d208a8514b394087ac18e419fcdc17 /src/qml/jsruntime/qv4engine_p.h
parent486948817b26da2c62802bb93a0f671715c609d4 (diff)
Let markObjects() operate directly on HeapObjects
This decouples things a bit better and helps moving over to directly store heapobject pointers in other objects. Change-Id: I798f922e018b0a3ca6f8768e4a810187f34d82f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r--src/qml/jsruntime/qv4engine_p.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 6186c3c3d8..1da54b1129 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -152,13 +152,13 @@ public:
jsStackTop -= nValues;
}
- void pushForGC(Managed *m) {
- *jsStackTop = Value::fromManaged(m);
+ void pushForGC(HeapObject *m) {
+ *jsStackTop = Value::fromHeapObject(m);
++jsStackTop;
}
- Managed *popForGC() {
+ HeapObject *popForGC() {
--jsStackTop;
- return jsStackTop->managed();
+ return jsStackTop->heapObject();
}
IdentifierTable *identifierTable;
@@ -386,6 +386,7 @@ private:
QmlExtensions *m_qmlExtensions;
};
+// ### Remove me
inline
void Managed::mark(QV4::ExecutionEngine *engine)
{
@@ -393,6 +394,17 @@ void Managed::mark(QV4::ExecutionEngine *engine)
if (markBit())
return;
d()->markBit = 1;
+ engine->pushForGC(d());
+}
+
+
+inline
+void HeapObject::mark(QV4::ExecutionEngine *engine)
+{
+ Q_ASSERT(inUse);
+ if (markBit)
+ return;
+ markBit = 1;
engine->pushForGC(this);
}