From 025365f1dc6dc9c3244a125882433e55b57fa672 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 2 Nov 2013 16:30:26 +0100 Subject: Refactor marking GC'ed objects Don't use recursive function calls anymore. Instead, push marked objects onto the JS stack, and then pop them off when their children are being marked. Should reduce stack memory usage, and improves performance by ~5%. Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlcomponent.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/qml/qml/qqmlcomponent.cpp') diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index cb05a2bef8..ea88acd85f 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1120,7 +1120,7 @@ public: static QV4::ReturnedValue method_forceCompletion(QV4::SimpleCallContext *ctx); static void destroy(Managed *that); - static void markObjects(Managed *that); + static void markObjects(Managed *that, QV4::ExecutionEngine *e); QScopedPointer incubator; QV8Engine *v8; @@ -1538,14 +1538,14 @@ void QmlIncubatorObject::destroy(Managed *that) o->~QmlIncubatorObject(); } -void QmlIncubatorObject::markObjects(QV4::Managed *that) +void QmlIncubatorObject::markObjects(QV4::Managed *that, QV4::ExecutionEngine *e) { QmlIncubatorObject *o = that->as(); Q_ASSERT(o); - o->valuemap.mark(); - o->qmlGlobal.mark(); - o->m_statusChanged.mark(); - Object::markObjects(that); + o->valuemap.mark(e); + o->qmlGlobal.mark(e); + o->m_statusChanged.mark(e); + Object::markObjects(that, e); } void QmlIncubatorObject::statusChanged(QQmlIncubator::Status s) -- cgit v1.2.3