aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compiler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-11-02 20:35:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-12 18:20:30 +0100
commit7a092000169a8e9d537f3d341ef48277397f997d (patch)
treef29f189d57e4923dff2decfd073b8e04f4a211a8 /src/qml/compiler/qv4compiler.cpp
parent7c6d2d78fe0997dfebba5569f097bdacbba5a861 (diff)
Fix property dependency generation for accelerated QML QObject properties
The previous approach of collecting the dependencies through an IR visitor doesn't work, because it relies on a fixed structure - for example MEMBER(NAME, prop) - which we can't guarantee (it's usually MEMBER(TEMP, prop)). But it turns out that we can only pre-calculate dependencies for context, scope or id properties, so we can do that right away in the QML specific JS codegen, store that information in the IR function and use it from there in the data structure generator as well as in the isel as a parameter to getQObjectProperty to tell the run-time whether capture is required or not. Change-Id: I33711c3420d6534c653c2a6a4284f0fc12e941cf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r--src/qml/compiler/qv4compiler.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp
index b38c394bdc..cb17b86702 100644
--- a/src/qml/compiler/qv4compiler.cpp
+++ b/src/qml/compiler/qv4compiler.cpp
@@ -171,14 +171,10 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(int *total
for (int i = 0; i < f->locals.size(); ++i)
registerString(*f->locals.at(i));
- if (f->hasQmlDependencies) {
- QQmlJS::V4IR::QmlDependenciesCollector depCollector;
-
- QSet<int> idObjectDeps;
- QSet<QQmlPropertyData*> contextPropertyDeps;
- QSet<QQmlPropertyData*> scopePropertyDeps;
-
- depCollector.run(f, &idObjectDeps, &contextPropertyDeps, &scopePropertyDeps);
+ if (f->hasQmlDependencies()) {
+ QSet<int> idObjectDeps = f->idObjectDependencies;
+ QSet<QQmlPropertyData*> contextPropertyDeps = f->contextObjectDependencies;
+ QSet<QQmlPropertyData*> scopePropertyDeps = f->scopeObjectDependencies;
if (!idObjectDeps.isEmpty())
qmlIdObjectDependenciesPerFunction.insert(f, idObjectDeps);
@@ -206,7 +202,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(int *total
int qmlIdDepsCount = 0;
int qmlPropertyDepsCount = 0;
- if (f->hasQmlDependencies) {
+ if (f->hasQmlDependencies()) {
IdDependencyHash::ConstIterator idIt = qmlIdObjectDependenciesPerFunction.find(f);
if (idIt != qmlIdObjectDependenciesPerFunction.constEnd())
qmlIdDepsCount += idIt->count();
@@ -361,7 +357,7 @@ int QV4::Compiler::JSUnitGenerator::writeFunction(char *f, int index, QQmlJS::V4
QSet<QQmlPropertyData*> qmlContextPropertyDeps;
QSet<QQmlPropertyData*> qmlScopePropertyDeps;
- if (irFunction->hasQmlDependencies) {
+ if (irFunction->hasQmlDependencies()) {
qmlIdObjectDeps = qmlIdObjectDependenciesPerFunction.value(irFunction);
qmlContextPropertyDeps = qmlContextPropertyDependenciesPerFunction.value(irFunction);
qmlScopePropertyDeps = qmlScopePropertyDependenciesPerFunction.value(irFunction);