From afbf1f74af678af0eda76035133406aa8883408a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 11 Nov 2014 15:08:30 +0100 Subject: Ported ExecutionEngine::newString and newIdentifier to Heap::String Avoid the use of Returned for newString and changed the identifier table to use Heap::String. This required moving some code back into Heap::String, but that's code that doesn't call back into the GC, so allocations and therefore future object moves aren't possible. Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720 Reviewed-by: Lars Knoll --- src/qml/compiler/qv4compileddata.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/qml/compiler') diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index c46392676b..34b270632d 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -68,8 +68,10 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine) runtimeStrings = (QV4::String **)malloc(data->stringTableSize * sizeof(QV4::String*)); // memset the strings to 0 in case a GC run happens while we're within the loop below memset(runtimeStrings, 0, data->stringTableSize * sizeof(QV4::String*)); - for (uint i = 0; i < data->stringTableSize; ++i) - runtimeStrings[i] = engine->newIdentifier(data->stringAt(i)); + for (uint i = 0; i < data->stringTableSize; ++i) { + // #### GC + runtimeStrings[i] = reinterpret_cast(engine->newIdentifier(data->stringAt(i))); + } runtimeRegularExpressions = new QV4::Value[data->regexpTableSize]; // memset the regexps to 0 in case a GC run happens while we're within the loop below -- cgit v1.2.3