On 2014/04/24 08:08:05, marja wrote:
Thanks for working on this!

Some questions which popped in my mind while reading through this (but I
didn't
do much searching to find the answers):

1) Why do Identifiers now need to know their positions?

It is enough to have dummy implementations of PreParserIdentifier::position(), and PreParserIdentifier::length(). The actual positions are not really needed
by the preparser. It seems I thought they would be needed and then forgot to
remove that piece of code.

2) Why is the added FunctionState constructor needed?

In ParseArrowFunctionLiteral(), when the new Scope is created, in the case of the PreParser it will be a stack-allocated PreParserScope, while in Parser it will be a heap-allocated v8::internal::Scope, so in the line that creates the
FunctionState:

  FunctionState function_state(&function_state_, &scope_, &scope, zone());

...for the PreParser, "scope" is a PreParserScope, and the constructor then
receives "&scope" (a PreParserScope*); on the other hand for the Parser
"scope" is a v8::internal::Scope*, so the "&scope" parameter is passing
a v8::internal::Scope** to the constructor. And that is why there are two
constructors. (FTR, this is the simplest solution I could come up with,
so suggestions are accepted).



https://codereview.chromium.org/160073006/

--
--
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