Make 'with' mark only variables occurring in the body as used.
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 20 Jan 2011 12:32:43 +0000 (12:32 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 20 Jan 2011 12:32:43 +0000 (12:32 +0000)
commit7f43cf0539f48aad005040c8390c0293e6586795
tree91033e5d22413e16a3c869e6101f506cd52f896e
parent198bcbaa13353ed16150de47082bbba88e60f2ee
Make 'with' mark only variables occurring in the body as used.

Before, we conservatively marked every variable in a scope as used if the
scope contained 'with'.  Instead, just mark the variables occurring in the
body of the with.  This avoids marking 'arguments' as used whenever 'with'
occurs, which incurs an extra performance penalty (a use of arguments is
seen as an instruction to redirect all parameter accesses to the arguments
object).

Review URL: http://codereview.chromium.org/6357007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/scopes.cc
test/mjsunit/debug-evaluate-locals.js