Resolve references to "this" the same way as normal variables
authorwingo <wingo@igalia.com>
Tue, 5 May 2015 16:38:12 +0000 (09:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 5 May 2015 16:38:22 +0000 (16:38 +0000)
commit18619d355192e2699203d12d9ebb9caea107b693
tree186776dfbe9095505f4d89521a62c711fb2f9791
parentf6ca5399521e3c0e12be41b61a1193a630452755
Resolve references to "this" the same way as normal variables

Make the parser handle references to "this" as unresolved variables, so the
same logic as for the rest of function parameters is used for the receiver.
Minor additions to the code generation handle copying the receiver to the
context, along with the rest of the function parameters.

Based on work by Adrian Perez de Castro <aperez@igalia.com>.

BUG=
LOG=N

Review URL: https://codereview.chromium.org/1097283003

Cr-Commit-Position: refs/heads/master@{#28236}
21 files changed:
src/arm/full-codegen-arm.cc
src/arm/lithium-codegen-arm.cc
src/arm64/full-codegen-arm64.cc
src/arm64/lithium-codegen-arm64.cc
src/compiler/ast-graph-builder.cc
src/compiler/ast-graph-builder.h
src/contexts.cc
src/heap/heap.h
src/ia32/full-codegen-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/parser.cc
src/runtime/runtime-debug.cc
src/runtime/runtime-scopes.cc
src/scopeinfo.cc
src/scopes.cc
src/scopes.h
src/variables.cc
src/x64/full-codegen-x64.cc
src/x64/lithium-codegen-x64.cc
test/mjsunit/debug-scopes.js
test/mjsunit/harmony/arrow-functions-this.js [new file with mode: 0644]