aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4persistent.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-03-09 10:36:16 +0100
committerLars Knoll <lars.knoll@qt.io>2017-04-07 06:06:17 +0000
commit589f8a90fa8c158ec97f32d4a9539b47ba8486a2 (patch)
treea379d6cc9d85b6565d712943d0fcf763466403e0 /src/qml/jsruntime/qv4persistent.cpp
parent1e63f7c4833c19f760f4af0b7650311819d0f2b2 (diff)
Separate the stack used for GC from the regular JS stack
This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4persistent.cpp')
-rw-r--r--src/qml/jsruntime/qv4persistent.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp
index de82bf835f..0b31c971f9 100644
--- a/src/qml/jsruntime/qv4persistent.cpp
+++ b/src/qml/jsruntime/qv4persistent.cpp
@@ -215,17 +215,15 @@ void PersistentValueStorage::free(Value *v)
freePage(p);
}
-void PersistentValueStorage::mark(ExecutionEngine *e)
+void PersistentValueStorage::mark(MarkStack *markStack)
{
- Value *markBase = e->jsStackTop;
-
Page *p = static_cast<Page *>(firstPage);
while (p) {
for (int i = 0; i < kEntriesPerPage; ++i) {
if (Managed *m = p->values[i].as<Managed>())
- m->mark(e);
+ m->mark(markStack);
}
- e->memoryManager->drainMarkStack(markBase);
+ markStack->drain();
p = p->header.next;
}
@@ -384,11 +382,11 @@ void WeakValue::allocVal(ExecutionEngine *engine)
val = engine->memoryManager->m_weakValues->allocate();
}
-void WeakValue::markOnce(ExecutionEngine *e)
+void WeakValue::markOnce(MarkStack *markStack)
{
if (!val)
return;
- val->mark(e);
+ val->mark(markStack);
}
void WeakValue::free()