diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-04 03:18:37 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-04 03:34:52 (GMT) |
commit | 588093b3e12dd5039bcc4ee545d9d9112d25394f (patch) | |
tree | 2f401dd36f44004fb06cead7846965dad3b5738e /src/declarative/qml/qmlvme.cpp | |
parent | dbda9ae7996d090cda296074fc02842f1dd2e0f7 (diff) | |
download | Qt-588093b3e12dd5039bcc4ee545d9d9112d25394f.zip Qt-588093b3e12dd5039bcc4ee545d9d9112d25394f.tar.gz Qt-588093b3e12dd5039bcc4ee545d9d9112d25394f.tar.bz2 |
Improve performance by separating id and context properties
Diffstat (limited to 'src/declarative/qml/qmlvme.cpp')
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index ee41fe4..7c02548 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -64,6 +64,7 @@ #include <QtCore/qdebug.h> #include <QtCore/qvarlengtharray.h> #include <private/qmlbinding_p.h> +#include <private/qmlcontext_p.h> QT_BEGIN_NAMESPACE @@ -144,6 +145,7 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledData vmeErrors.clear(); QmlEnginePrivate *ep = QmlEnginePrivate::get(ctxt->engine()); + QmlContextPrivate *cp = (QmlContextPrivate *)QObjectPrivate::get(ctxt); for (int ii = start; !isError() && ii < (start + count); ++ii) { QmlInstruction &instr = comp->bytecode[ii]; @@ -155,6 +157,9 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledData bindValues = QmlEnginePrivate::SimpleList<QmlBinding>(instr.init.bindingsSize); if (instr.init.parserStatusSize) parserStatus = QmlEnginePrivate::SimpleList<QmlParserStatus>(instr.init.parserStatusSize); + + if (instr.init.idSize) + cp->setIdPropertyCount(instr.init.idSize); } break; @@ -194,7 +199,8 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledData case QmlInstruction::SetId: { QObject *target = stack.top(); - ctxt->setContextProperty(primitives.at(instr.setId.value), target); +// ctxt->setContextProperty(primitives.at(instr.setId.value), target); + cp->setIdProperty(primitives.at(instr.setId.value), instr.setId.index, target); } break; |