I haven't run benchmarks, but I feel like the peeking approach is probably
going
to slow things down a lot. That doesn't mean that multiple lookahead
wouldn't be
useful, but it might need some fine-tuning.
The use of ::memmove() when skipping might be expensive (but, this is
replacing
an extra Scan() which already happened, so maybe it's not that bad).
I would prefer to not need multiple lookahead tokens, but maybe it's more
worthwhile to just do as Erik suggested and add error checking for Spread
expressions everywhere a primary expression is expected
https://codereview.chromium.org/987083003/diff/20001/src/full-codegen.cc
File src/full-codegen.cc (right):
https://codereview.chromium.org/987083003/diff/20001/src/full-codegen.cc#newcode292
src/full-codegen.cc:292: UNREACHABLE();
On 2015/03/10 13:44:02, arv wrote:
This does not seem right. Shouldn't this be:
Visit(expr->expression());
... or maybe I am thinking to far ahead when we have array and call
spread.
eventually yeah, but for now it's not really needed since these nodes
are removed from the graph
https://codereview.chromium.org/987083003/diff/20001/src/preparser.h
File src/preparser.h (right):
https://codereview.chromium.org/987083003/diff/20001/src/preparser.h#newcode1894
src/preparser.h:1894: // ... Identifier ')' '=>'
On 2015/03/10 13:44:02, arv wrote:
Why ')' '=>'?
So, you're right that we can just check for the `)`, but this means
there are potentially a lot more places where we have to look for
problems. I liked doing it this way because it meant there was only one
place where a syntax error could occur
https://codereview.chromium.org/987083003/diff/20001/src/preparser.h#newcode1968
src/preparser.h:1968: int x = 5;
On 2015/03/10 13:44:02, arv wrote:
On 2015/03/10 09:11:19, marja wrote:
> ?
Looks like debug code... remove?
Hah, yeah --- I'll get rid of that =)
https://codereview.chromium.org/987083003/diff/20001/src/preparser.h#newcode2019
src/preparser.h:2019: &is_strict_reserved_name, CHECK_OK);
On 2015/03/10 13:44:03, arv wrote:
I don't see where is_strict_reserved_name is being checked?
ArrowFormalParameters are always strict.
to match the function signature... pretty much just trying to match
what's happening in CheckAndDeclareArrowFunctionParameters or whatever
it's called.
https://codereview.chromium.org/987083003/diff/20001/src/scanner.cc
File src/scanner.cc (right):
https://codereview.chromium.org/987083003/diff/20001/src/scanner.cc#newcode717
src/scanner.cc:717: // Not supported when there is multiple lookahead
tokens
On 2015/03/10 09:11:19, marja wrote:
... what prevents this from happening?
it just seemed complicated to make it work with multiple lookaheads
https://codereview.chromium.org/987083003/
--
--
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.