So the latest change involves recording in ExpressionClassifier whether a
CoverInitializedName occurs, which makes the ExpressionClassifier at least 8
bytes bigger, and likely slows down parsing a tiny bit.

The reason for this, compared to the strategy in ObjectLiteralChecker, is so
that the parser can handle expressions like `({ bar: this.y, z: { foo } } =
someObject)` --- previously it was only treated as a pattern if followed by
Token::ASSIGN, which would break nested Object* patterns. So, it's now possible
to use the classifier to store the CoverInitializedName state from nested
properties.

It might be an expensive approach for the corner case, but I don't have a better
idea right now.

---

There are also some slightly messy things tracking whether or not you are
potentially parsing arrow function formal parameters (which is used to defer
reporting of expression errors if Token::ARROW shows up), and tracking if
parsing a property or element or not, so that it's possible to distinguish
whether parsing the top-level literal / pattern or not. This enables deferring reporting the CoverInitializedName error for expressions until it's known for
sure that an expression is being parsed or not.

These flags are small bits of parser state, but the RAII-style trackers for them
add a bit of code (and, these things could be refactored to share as much as
possible via macros or templates, so that the diff is a bit tinier, not sure if
it's preferred or if it would be better to just manually track these, or if
people think tracking these is pointless)

---

Finally, figuring out the error story seems pretty important, I'm not sure it's
possible to merge both pattern errors, but it would be nice to make the
classifier smaller.

If anyone has some ideas on how to clean this up, so that less stack space is
used, that would be awesome.


https://codereview.chromium.org/1309813007/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to