aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_p.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-11-02 18:48:18 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 22:04:42 +0100
commita41764cafbc85c271edde8d09eae46798ccdcb8d (patch)
treecb027ea57c6f764bdc277bf899caa3f8a866647b /src/qml/compiler/qv4isel_p.cpp
parent62c906059516bb829f05073096fd3e12f5103fba (diff)
IR Cleanup, resolve ID objects through array subscripts
...instead of a special MEMBER type. This allows removing the type member from V4IR::Member altogether (and thus unshadow from V4IR::Expr::type). By not requiring the base of a id lookup member expression to be a NAME, we can also speed up repeated id lookups by fetching the id object array wrapper only once per function. Change-Id: I3e9b8f498d32ace4a0cc2254f49e02ecc124f79c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_p.cpp')
-rw-r--r--src/qml/compiler/qv4isel_p.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/qml/compiler/qv4isel_p.cpp b/src/qml/compiler/qv4isel_p.cpp
index b3407867b4..a14a11c43e 100644
--- a/src/qml/compiler/qv4isel_p.cpp
+++ b/src/qml/compiler/qv4isel_p.cpp
@@ -103,6 +103,8 @@ void IRDecoder::visitMove(V4IR::Move *s)
if (V4IR::Name *n = s->source->asName()) {
if (n->id && *n->id == QStringLiteral("this")) // TODO: `this' should be a builtin.
loadThisObject(t);
+ else if (n->builtin == V4IR::Name::builtin_qml_id_array)
+ loadQmlIdArray(t);
else if (n->builtin == V4IR::Name::builtin_qml_context_object)
loadQmlContextObject(t);
else if (n->builtin == V4IR::Name::builtin_qml_scope_object)
@@ -142,15 +144,7 @@ void IRDecoder::visitMove(V4IR::Move *s)
return;
}
} else if (V4IR::Member *m = s->source->asMember()) {
- if (m->type == V4IR::Member::MemberOfQmlContext) {
- V4IR::Name *base = m->base->asName();
- Q_ASSERT(base);
-
- if (base->builtin == V4IR::Name::builtin_qml_id_scope) {
- loadQmlIdObject(m->memberIndex, t);
- return;
- }
- } else if (m->property) {
+ if (m->property) {
bool captureRequired = true;
if (_function) {
captureRequired = !_function->contextObjectDependencies.contains(m->property)