reference locals in outer functions by index
authorLars Knoll <lars.knoll@digia.com>
Fri, 15 Feb 2013 12:36:49 +0000 (13:36 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Fri, 15 Feb 2013 23:58:04 +0000 (00:58 +0100)
commit699633d464fc98e847f0c40b935e8f76c4942eba
tree2ccd128ef940c3b3adabb8cd774c7caf725e6292
parente962832eb6efcdc14fde65bb724034ac14daf9cd
reference locals in outer functions by index

This makes V4 reference all variables in scopes
that are not the global scope by index. The JIT and
the interpreter walk up the scope chain to get the
correct reference.

Variables are only resolved by name for the global
scope, if the scope contains an eval statement (as
eval can define new variables) and inside with and
catch scopes.

Change-Id: Ib9f9d1a03d50124130aefd169eeb071533ba3520
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/v4/moth/qv4instr_moth_p.h
src/v4/moth/qv4isel_moth.cpp
src/v4/moth/qv4isel_moth_p.h
src/v4/moth/qv4vme_moth.cpp
src/v4/qv4codegen.cpp
src/v4/qv4ir.cpp
src/v4/qv4ir_p.h
src/v4/qv4isel_masm.cpp
src/v4/qv4isel_masm_p.h