aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-28 13:26:35 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-28 13:20:40 +0000
commit88dc4ea1237fe6990b612c2e64142c665e5818f6 (patch)
treec10b7413c0311f4c55127d8df98c07cd09912338 /src/qml/compiler/qv4codegen_p.h
parent1750cdfeecb50963dc3cb505cbe5abd2eecc0e55 (diff)
Cleanup closure handling in codegen
We don't really need closure's to part of the Reference type. Instead simply load them into the accumulator when needed, and use a reference to the Accumulator instead. Change-Id: I4ca8c60083c9f2fa0da1db6c3c53718e3a32fc6f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen_p.h')
-rw-r--r--src/qml/compiler/qv4codegen_p.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index 04968edabc..5f6385fd62 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -166,7 +166,6 @@ public:
Name,
Member,
Subscript,
- Closure,
QmlScopeObject,
QmlContextObject,
LastLValue = QmlContextObject,
@@ -252,11 +251,6 @@ public:
r.isReadonly = true;
return r;
}
- static Reference fromClosure(Codegen *cg, int functionId) {
- Reference r(cg, Closure);
- r.closureId = functionId;
- return r;
- }
static Reference fromQmlScopeObject(const Reference &base, qint16 coreIndex, qint16 notifyIndex, bool captureRequired) {
Reference r(base.codegen, QmlScopeObject);
r.qmlBase = base.storeOnStack().stackSlot();
@@ -322,7 +316,6 @@ public:
Moth::StackSlot elementBase;
RValue elementSubscript;
};
- int closureId;
struct { // QML scope/context object case
Moth::StackSlot qmlBase;
qint16 qmlCoreIndex;
@@ -495,6 +488,8 @@ protected:
Reference referenceForName(const QString &name, bool lhs);
+ void loadClosure(int index);
+
// Hook provided to implement QML lookup semantics
virtual Reference fallbackNameLookup(const QString &name);
virtual void beginFunctionBodyHook() {}