aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-11-02 16:30:26 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-05 18:54:51 +0100
commit025365f1dc6dc9c3244a125882433e55b57fa672 (patch)
tree6cab46d0595e7c9a8b61c8f2eb620dba009f30f8 /src/qml/compiler
parentc9a90b3181723061e27e7545b70a66dda4f4306d (diff)
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 <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp10
-rw-r--r--src/qml/compiler/qv4compileddata_p.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 51f39e7e6c..ce0c7abf9e 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -158,20 +158,20 @@ void CompilationUnit::unlink()
runtimeFunctions.clear();
}
-void CompilationUnit::markObjects()
+void CompilationUnit::markObjects(QV4::ExecutionEngine *e)
{
for (uint i = 0; i < data->stringTableSize; ++i)
- runtimeStrings[i].mark();
+ runtimeStrings[i].mark(e);
if (runtimeRegularExpressions) {
for (uint i = 0; i < data->regexpTableSize; ++i)
- runtimeRegularExpressions[i].mark();
+ runtimeRegularExpressions[i].mark(e);
}
for (int i = 0; i < runtimeFunctions.count(); ++i)
if (runtimeFunctions[i])
- runtimeFunctions[i]->mark();
+ runtimeFunctions[i]->mark(e);
if (runtimeLookups) {
for (uint i = 0; i < data->lookupTableSize; ++i)
- runtimeLookups[i].name->mark();
+ runtimeLookups[i].name->mark(e);
}
}
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 1c0d72e521..bfbb40445a 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -505,7 +505,7 @@ struct Q_QML_EXPORT CompilationUnit
// ### runtime data
// pointer to qml data for QML unit
- void markObjects();
+ void markObjects(QV4::ExecutionEngine *e);
protected:
virtual void linkBackendToEngine(QV4::ExecutionEngine *engine) = 0;