Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Issue 1138153003: Use ExpressionClassifier to identify valid arrow function formals (Closed)

Created:
5 years, 7 months ago by wingo
Modified:
5 years, 7 months ago
CC:
v8-dev, rossberg, arv (Not doing code reviews)
Base URL:
https://chromium.googlesource.com/v8/v8@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Use ExpressionClassifier to identify valid arrow function formals R=dslomov@chromium.org LOG=N BUG= Committed: https://crrev.com/e73594c7fb3e6b5834b7ddfe78727fb994bab25f Cr-Commit-Position: refs/heads/master@{#28391}

Patch Set 1 #

Patch Set 2 : Replace IsValidArrowParam bits with ExpressionClassifier; fix some classifier bugs; tests passing m… #

Patch Set 3 : Classify destructuring bindings as invalid unless destructuring is enabled #

Total comments: 1

Patch Set 4 : Merge FormalParameterErrorLocations into ExpressionClassifier #

Patch Set 5 : Fix ASAN stack-check regression by bumping stack limit in test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -238 lines) Patch
M src/parser.h View 1 2 3 1 chunk +6 lines, -4 lines 0 comments Download
M src/parser.cc View 1 2 3 11 chunks +23 lines, -34 lines 2 comments Download
M src/preparser.h View 1 2 3 26 chunks +290 lines, -193 lines 0 comments Download
M src/preparser.cc View 1 2 3 3 chunks +8 lines, -6 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M test/mjsunit/regress/regress-1132.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 26 (4 generated)
wingo
Early WIP to use the expression classifier to identify valid arrow functions. Next revision will ...
5 years, 7 months ago (2015-05-12 12:12:50 UTC) #1
Dmitry Lomov (no reviews)
Yes, this makes sense to me
5 years, 7 months ago (2015-05-12 12:58:53 UTC) #2
wingo
Updated patch is pretty much complete modulo a couple of tests. Three things aren't working: ...
5 years, 7 months ago (2015-05-12 13:51:25 UTC) #3
caitp (gmail)
On 2015/05/12 13:51:25, wingo wrote: > Updated patch is pretty much complete modulo a couple ...
5 years, 7 months ago (2015-05-12 14:01:50 UTC) #4
wingo
On 2015/05/12 13:51:25, wingo wrote: > Updated patch is pretty much complete modulo a couple ...
5 years, 7 months ago (2015-05-12 14:02:43 UTC) #5
wingo
On 2015/05/12 14:01:50, caitp wrote: > On 2015/05/12 13:51:25, wingo wrote: > > Updated patch ...
5 years, 7 months ago (2015-05-12 14:03:43 UTC) #6
wingo
On 2015/05/12 14:03:43, wingo wrote: > On 2015/05/12 14:01:50, caitp wrote: > > On 2015/05/12 ...
5 years, 7 months ago (2015-05-12 14:13:02 UTC) #7
Dmitry Lomov (no reviews)
On 2015/05/12 14:13:02, wingo wrote: > On 2015/05/12 14:03:43, wingo wrote: > > On 2015/05/12 ...
5 years, 7 months ago (2015-05-12 14:19:55 UTC) #8
wingo
On 2015/05/12 14:19:55, Dmitry Lomov (chromium) wrote: > On 2015/05/12 14:13:02, wingo wrote: > > ...
5 years, 7 months ago (2015-05-12 14:28:38 UTC) #9
Dmitry Lomov (no reviews)
On 2015/05/12 14:28:38, wingo wrote: > On 2015/05/12 14:19:55, Dmitry Lomov (chromium) wrote: > > ...
5 years, 7 months ago (2015-05-12 14:38:59 UTC) #10
Dmitry Lomov (no reviews)
https://codereview.chromium.org/1138153003/diff/40001/src/preparser.h File src/preparser.h (right): https://codereview.chromium.org/1138153003/diff/40001/src/preparser.h#newcode677 src/preparser.h:677: void RecordArrowFormalParametersError(const Scanner::Location& loc, Instead of having all these ...
5 years, 7 months ago (2015-05-12 15:12:20 UTC) #11
wingo
Updated patch merges FormalParameterErrorLocations into the ExpressionClassifier as discussed offline. I tried to make a ...
5 years, 7 months ago (2015-05-13 09:27:47 UTC) #12
Dmitry Lomov (no reviews)
lgtm
5 years, 7 months ago (2015-05-13 09:43:17 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1138153003/60001
5 years, 7 months ago (2015-05-13 09:56:45 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_asan_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_asan_rel/builds/4131)
5 years, 7 months ago (2015-05-13 10:25:08 UTC) #17
wingo
On 2015/05/13 10:25:08, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 7 months ago (2015-05-13 10:39:44 UTC) #18
Dmitry Lomov (no reviews)
lgtm with bumped stack limit
5 years, 7 months ago (2015-05-13 11:21:02 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1138153003/80001
5 years, 7 months ago (2015-05-13 11:23:36 UTC) #21
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 7 months ago (2015-05-13 11:45:09 UTC) #22
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/e73594c7fb3e6b5834b7ddfe78727fb994bab25f Cr-Commit-Position: refs/heads/master@{#28391}
5 years, 7 months ago (2015-05-13 11:45:27 UTC) #23
arv (Not doing code reviews)
LGTM https://codereview.chromium.org/1138153003/diff/80001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1138153003/diff/80001/src/parser.cc#newcode4029 src/parser.cc:4029: const bool allow_duplicate_parameters = Does this handle patterns? ...
5 years, 7 months ago (2015-05-13 14:13:05 UTC) #25
wingo
5 years, 7 months ago (2015-05-15 12:30:31 UTC) #26
Message was sent while issue was closed.
https://codereview.chromium.org/1138153003/diff/80001/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/1138153003/diff/80001/src/parser.cc#newcode4029
src/parser.cc:4029: const bool allow_duplicate_parameters =
On 2015/05/13 14:13:05, arv wrote:
> Does this handle patterns?
> 
> // sloppy
> function f(x  // ok
> function f(x, x  // ok
> function f(x, x, {  // no longer ok
> function f(x, x =  // no longer ok

I guess it should but it doesn't.  In a similar way, duplicate bindings in
patterns are not yet detected, at least not in the preparser.  That will be
tricky to do given that a previous attempt to use the DuplicateFinder for both
the parser and the preparser regressed performance.  Perhaps changing the
DuplicateFinder to allocate in the zone instead of via malloc would improve
things, though.  In any case it's a problem we will need to solve for arrow
functions too:

  (x, x) => 10 // error, but currently not caught by the preparser

Powered by Google App Engine
This is Rietveld 408576698