summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlexpression_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-08-05 04:15:10 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-08-05 04:23:22 (GMT)
commit3c85728f2cb69817d4b72d3aab16b7a7fe6bdbf0 (patch)
tree01e245219495204a92b395797dafa1686347a27b /src/declarative/qml/qmlexpression_p.h
parent2995f6eee6f718487c5f982c23cc6a4318fc58bb (diff)
downloadQt-3c85728f2cb69817d4b72d3aab16b7a7fe6bdbf0.zip
Qt-3c85728f2cb69817d4b72d3aab16b7a7fe6bdbf0.tar.gz
Qt-3c85728f2cb69817d4b72d3aab16b7a7fe6bdbf0.tar.bz2
Rewrite bindings inside the compiler
To improve execution performance, binding expressions are rewritten as function closures inside QmlExpression. To improve startup performance, where possible, the expressions are rewritten inside the compiler instead of inside QmlExpression at runtime. This also has the sideeffect of removing the StoreBinding instruction, as all bindings are now "compiled". The QmlBinding::expression() method for rewritten bindings will now return the rewritten expression instead of the original (which is lost), but this API is internal anyway.
Diffstat (limited to 'src/declarative/qml/qmlexpression_p.h')
-rw-r--r--src/declarative/qml/qmlexpression_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h
index cb89ce0..5ecc24d 100644
--- a/src/declarative/qml/qmlexpression_p.h
+++ b/src/declarative/qml/qmlexpression_p.h
@@ -70,12 +70,18 @@ public:
QmlExpressionPrivate();
~QmlExpressionPrivate();
+ enum CompiledDataType {
+ BasicScriptEngineData = 1,
+ PreTransformedQtScriptData = 2
+ };
+
void init(QmlContext *, const QString &, QObject *);
void init(QmlContext *, void *, QmlRefCount *, QObject *);
QmlContext *ctxt;
QString expression;
- bool expressionFunctionValid;
+ bool expressionFunctionValid:1;
+ bool expressionRewritten:1;
QScriptValue expressionFunction;
QmlBasicScript sse;