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

Issue 1295883002: Sloppy-mode let parsing (Closed)

Created:
5 years, 4 months ago by Dan Ehrenberg
Modified:
5 years, 3 months ago
Reviewers:
adamk, rossberg
CC:
v8-dev, vogelheim
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Sloppy-mode let parsing This patch makes 'let' a contextual keyword in both strict and sloppy mode. It behaves as a keyword when used at the beginning of a StatementListItem or lexical declaration at the beginning of a for statement, if it is followed by an identifier, [ or {. Implementing this change requires an extra token look-ahead by the parser which is only invoked in certain cases (so as to avoid parsing RegExps as ECMAScript tokens). This might result in a slowdown of the scanner, but performance testing of this patch hasn't yet found much of a regression. BUG=v8:3305 LOG=Y R=adamk

Patch Set 1 #

Patch Set 2 : Minor cleanup #

Patch Set 3 : Clean up formatting #

Patch Set 4 : More sloppy let tests #

Total comments: 8

Patch Set 5 : Name changes #

Patch Set 6 : Replace array with direct ivars #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -13 lines) Patch
M src/parser.cc View 1 2 3 4 5 3 chunks +2 lines, -5 lines 0 comments Download
M src/preparser.h View 1 2 3 4 5 3 chunks +28 lines, -0 lines 0 comments Download
M src/preparser.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/scanner.h View 1 2 3 4 5 5 chunks +18 lines, -6 lines 0 comments Download
M src/scanner.cc View 1 2 3 4 2 chunks +19 lines, -0 lines 0 comments Download
M src/token.h View 1 chunk +1 line, -0 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 1 chunk +29 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/block-let-contextual-sloppy.js View 1 2 3 1 chunk +64 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (15 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295883002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295883002/1
5 years, 4 months ago (2015-08-14 20:10:30 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/4936)
5 years, 4 months ago (2015-08-14 20:13:31 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295883002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295883002/1
5 years, 4 months ago (2015-08-14 20:22:00 UTC) #8
Dan Ehrenberg
This is currently more of an RFC because of the indeterminate performance impact. It should ...
5 years, 4 months ago (2015-08-14 20:32:58 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295883002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295883002/40001
5 years, 4 months ago (2015-08-14 20:50:09 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-14 21:19:00 UTC) #14
Dan Ehrenberg
Actually, the performance runs didn't show a big regression: On v8_linux64_haswell_perf_try, CodeLoad was up 0.1, ...
5 years, 4 months ago (2015-08-14 21:27:17 UTC) #15
Dan Ehrenberg
5 years, 4 months ago (2015-08-14 21:27:54 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295883002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295883002/60001
5 years, 4 months ago (2015-08-14 21:42:40 UTC) #19
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-14 22:24:13 UTC) #21
adamk
Looking good, especially like that the ugliness is mostly contained in the Scanner. Mostly naming ...
5 years, 4 months ago (2015-08-15 00:28:31 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295883002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295883002/80001
5 years, 4 months ago (2015-08-17 17:37:45 UTC) #24
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-17 18:04:42 UTC) #26
Dan Ehrenberg
I ran Octane locally three times with and without this patch. I measured a 2.3% ...
5 years, 4 months ago (2015-08-17 18:05:02 UTC) #27
adamk
https://codereview.chromium.org/1295883002/diff/60001/src/scanner.h File src/scanner.h (right): https://codereview.chromium.org/1295883002/diff/60001/src/scanner.h#newcode547 src/scanner.h:547: (current_.literal_chars == &literal_buffers_[0]) On 2015/08/15 00:28:31, adamk wrote: > ...
5 years, 4 months ago (2015-08-17 18:24:39 UTC) #28
adamk
cc vogelheim@, who might have some insight into evaluating performance regressions related to CodeLoad.
5 years, 4 months ago (2015-08-17 18:25:26 UTC) #29
Dan Ehrenberg
https://codereview.chromium.org/1295883002/diff/60001/src/scanner.h File src/scanner.h (right): https://codereview.chromium.org/1295883002/diff/60001/src/scanner.h#newcode547 src/scanner.h:547: (current_.literal_chars == &literal_buffers_[0]) On 2015/08/17 at 18:24:39, adamk wrote: ...
5 years, 4 months ago (2015-08-17 18:35:19 UTC) #30
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1295883002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1295883002/100001
5 years, 4 months ago (2015-08-17 18:35:42 UTC) #32
commit-bot: I haz the power
5 years, 4 months ago (2015-08-17 19:22:28 UTC) #34
Dry run: This issue passed the CQ dry run.

Powered by Google App Engine
This is Rietveld 408576698