Reviewers: adamk (ooo until sept 8), rossberg, wingo,

Message:
PTAL --- The CL description doesn't cover everything happening here:

- Desugaring of rest parameters is rewritten to be closer to Babel's
implementation, which performs significantly faster (This is not currently
spec-correct, but it breaks in Babel, so it shouldn't bother most users --- and
it wasn't really correct before anyways).

- Adds a notion of "ContainsExpressions", used in the spec to determine if TDZ
semantics and special scoping are needed at all for formal parameters.

The addition of ContainsExpressions allows us to get away with using "var"
declarations and avoid the unnecessary hole-checking, which surprisingly
provides a significant performance boost (because of the scoping logic used for
hole-checking)

Description:
[es6] conditionally ignore TDZ semantics for formals

If HasParameterExpressions is false, a new lexical environment is not
meant to be created for formals without expressions, because they
cannot possibly leak information.

Implementing this change allows formal binding patterns and rest
parameters to be desugared using `VAR` bindings which do not require
hole-checking, and is significantly more performant for common cases.

BUG=v8:2160, v8:811
LOG=N
R=adamk, rossberg, wingo

Please review this at https://codereview.chromium.org/1308123007/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+135, -33 lines):
  M src/expression-classifier.h
  M src/parser.cc
  M src/pattern-rewriter.cc
  M src/preparser.h
  M src/preparser.cc
  M src/scopes.h
  M src/scopes.cc
  M test/mjsunit/harmony/destructuring.js


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to