aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlinstruction_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-05-30 10:16:13 +0100
committerQt by Nokia <qt-info@nokia.com>2012-08-29 06:38:54 +0200
commit04774bb14c81688f86a2b31b8624bde8ebf59062 (patch)
tree9d04d18712988caca2a3f193feb94cfaa35b47bb /src/qml/qml/qqmlinstruction_p.h
parentd65fb68de12b6d811f7b94ba3209847f73ca94cc (diff)
Evaluate bindings more intelligently during construction
Instead of just evaluating bindings in a fixed order, and possibly having to evaluate a single binding multiple times, prior to reading a property, we check if there are any bindings "pending" on it and evaluate them then. A pending binding is one that has been assigned to the property, but not yet evaluated. To minimize side effects we only do this for "safe" bindings. A safe binding is one that has no side effects, which we currently define as not calling functions or otherwise assigning values during its evaluation. This isn't an entirely foolproof way to ensure that the evaluation has no side effects, but it should be good enough. Change-Id: I98aa76a95719e5d182e8941738d64f8d409f404a Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlinstruction_p.h')
-rw-r--r--src/qml/qml/qqmlinstruction_p.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlinstruction_p.h b/src/qml/qml/qqmlinstruction_p.h
index 49bbd0e54c..2ada26061c 100644
--- a/src/qml/qml/qqmlinstruction_p.h
+++ b/src/qml/qml/qqmlinstruction_p.h
@@ -199,8 +199,8 @@ union QQmlInstruction
int data;
ushort column;
ushort line;
- bool isRoot;
- bool parentToSuper;
+ bool isRoot:1;
+ bool parentToSuper:1;
};
struct instr_createSimple {
QML_INSTR_HEADER
@@ -244,8 +244,8 @@ union QQmlInstruction
int fallbackValue;
short context;
short owner;
- bool isRoot;
- bool isAlias;
+ bool isRoot:1;
+ bool isAlias:1;
ushort line;
ushort column;
};
@@ -255,9 +255,10 @@ union QQmlInstruction
int value;
short context;
short owner;
- bool isRoot;
- bool isAlias;
- bool isFallback;
+ bool isRoot:1;
+ bool isAlias:1;
+ bool isFallback:1;
+ bool isSafe:1;
ushort line;
ushort column;
};
@@ -334,8 +335,8 @@ union QQmlInstruction
ushort line;
ushort column;
double numberValue;
- bool isStringLiteral;
- bool isNumberLiteral;
+ bool isStringLiteral:1;
+ bool isNumberLiteral:1;
};
struct instr_storeScript {
QML_INSTR_HEADER