summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-09-08 15:12:47 +0200
committerLars Knoll <lars.knoll@qt.io>2017-09-08 13:24:25 +0000
commit0167f5fc6115cbb52ecd1d882048c1f2cf70fc7f (patch)
tree0a4c9a2969bce9a66e550270cff72d87d8712490
parente11fe4290c7f0c4a876113e5e440db37ecd91bcc (diff)
Drain the markStack while collecting roots
This avoids overflows in the markStack for test cases where we have a huge amount of compilation units with many runtime strings that all want to get marked. Task-number: QTBUG-63063 Change-Id: I7c1df0fdb9afada1830f8c218a0e52ebcd093850 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r--src/qml/jsruntime/qv4engine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index caa6e8b7ac..8ca6b03950 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -982,10 +982,13 @@ void ExecutionEngine::markObjects(MarkStack *markStack)
}
classPool->markObjects(markStack);
+ markStack->drain();
for (QSet<CompiledData::CompilationUnit*>::ConstIterator it = compilationUnits.constBegin(), end = compilationUnits.constEnd();
- it != end; ++it)
+ it != end; ++it) {
(*it)->markObjects(markStack);
+ markStack->drain();
+ }
}
ReturnedValue ExecutionEngine::throwError(const Value &value)