diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-07-03 16:23:35 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-07-04 10:25:28 +0000 |
commit | f3561037c9892c9c467f618ce3000567a4924363 (patch) | |
tree | d45caf27920ec511bb3c47c3e7e3a105e791b355 /src/qml/compiler/qv4compilercontext_p.h | |
parent | d5ab38b606fa63e6da1425b6fa607f55b3877007 (diff) |
Limit the amount of escaping variables
Calculate more exactly which variables can
be referenced from an inner context, and convert
all the non escaping ones to temporaries on the
stack.
Change-Id: I0e33e85b0f6f426ef2812b8ecccee1870492b7b5
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilercontext_p.h')
-rw-r--r-- | src/qml/compiler/qv4compilercontext_p.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4compilercontext_p.h b/src/qml/compiler/qv4compilercontext_p.h index 87202089c5..f3481f0251 100644 --- a/src/qml/compiler/qv4compilercontext_p.h +++ b/src/qml/compiler/qv4compilercontext_p.h @@ -104,6 +104,8 @@ struct Context { int line = 0; int column = 0; + int functionIndex = -1; + enum MemberType { UndefinedMember, VariableDefinition, @@ -227,13 +229,13 @@ struct Context { return -1; } - int findMember(const QString &name) const + Member findMember(const QString &name) const { MemberMap::const_iterator it = members.find(name); if (it == members.end()) - return -1; - Q_ASSERT((*it).index != -1 || !parent); - return (*it).index; + return Member(); + Q_ASSERT(it->index != -1 || !parent); + return (*it); } bool memberInfo(const QString &name, const Member **m) const |