aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompiler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-25 16:36:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-02 14:48:43 +0100
commit963875db263e4d1a04e03c4bb4fc20542bc8c21e (patch)
treecbb63607672e9d302d30389c8fe7553b27807b1f /src/qml/qml/qqmlcompiler.cpp
parent278ca02350c68a78c89bb34d99ee65968372a5fd (diff)
[new compiler] Compile functions and bindings in appropriate scopes
This enables accelerated property access also for this code path. Change-Id: Iafb177b1fe7878e6c54cfb258f2e8d8ea32aa59e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler.cpp')
-rw-r--r--src/qml/qml/qqmlcompiler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp
index b26b5530a3..3e2fc91cf5 100644
--- a/src/qml/qml/qqmlcompiler.cpp
+++ b/src/qml/qml/qqmlcompiler.cpp
@@ -3642,6 +3642,8 @@ bool QQmlCompiler::completeComponentBuild()
const QQmlScript::Parser &parser = unit->parser();
QQmlJS::Engine *jsEngine = parser.jsEngine();
QQmlJS::MemoryPool *pool = jsEngine->pool();
+ QStringList stringPool;
+ stringPool.append(QString());
for (JSBindingReference *b = compileState->bindings.first(); b; b = b->nextReference) {
@@ -3659,7 +3661,9 @@ bool QQmlCompiler::completeComponentBuild()
ComponentCompileState::PerObjectCompileData *cd = &compileState->jsCompileData[b->bindingContext.object];
QtQml::CompiledFunctionOrExpression f;
f.node = node;
- f.name = binding.property->name().toString().prepend(QStringLiteral("expression for "));
+ QString name = binding.property->name().toString().prepend(QStringLiteral("expression for "));
+ stringPool.append(name);
+ f.nameIndex = stringPool.count() - 1;
f.disableAcceleratedLookups = binding.disableLookupAcceleration;
cd->functionsToCompile.append(f);
binding.compiledIndex = cd->functionsToCompile.count() - 1;
@@ -3672,7 +3676,7 @@ bool QQmlCompiler::completeComponentBuild()
const QString &sourceCode = jsEngine->code();
AST::UiProgram *qmlRoot = parser.qmlRoot();
- JSCodeGen jsCodeGen(unit->finalUrlString(), sourceCode, jsModule.data(), jsEngine, qmlRoot, output->importCache);
+ JSCodeGen jsCodeGen(unit->finalUrlString(), sourceCode, jsModule.data(), jsEngine, qmlRoot, output->importCache, stringPool);
JSCodeGen::ObjectIdMapping idMapping;
if (compileState->ids.count() > 0) {