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

Issue 166943002: (Pre)Parser: Simplify NewExpression handling. (Closed)

Created:
6 years, 10 months ago by marja
Modified:
6 years, 10 months ago
Reviewers:
ulan
CC:
v8-dev
Visibility:
Public.

Description

(Pre)Parser: Simplify NewExpression handling. Notes: - We use simple recursion to keep track of how many "new" operators we have seen and where. - This makes the self-baked stack class PositionStack in parser.cc unnecessary. - Now the logic is also unified between Parser and PreParser. - It might have been a copy-paste artifact (ParseLeftHandSideExpression -> ParseMemberWithNewPrefixesExpression) that the logic was so complicated before. R=ulan@chromium.org BUG=v8:3126 LOG=N Committed: https://code.google.com/p/v8/source/detail?r=19386

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -133 lines) Patch
M src/parser.h View 1 chunk +1 line, -4 lines 0 comments Download
M src/parser.cc View 4 chunks +28 lines, -92 lines 1 comment Download
M src/preparser.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/preparser.cc View 3 chunks +15 lines, -35 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 chunk +57 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
marja
ulan, ptal
6 years, 10 months ago (2014-02-14 15:08:33 UTC) #1
ulan
Good stuff, LGTM!
6 years, 10 months ago (2014-02-14 15:20:03 UTC) #2
marja
Committed patchset #1 manually as r19386 (presubmit successful).
6 years, 10 months ago (2014-02-14 15:33:22 UTC) #3
marja
6 years, 10 months ago (2014-02-17 15:11:42 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/166943002/diff/1/src/parser.cc
File src/parser.cc (left):

https://codereview.chromium.org/166943002/diff/1/src/parser.cc#oldcode3477
src/parser.cc:3477: result = factory()->NewCallNew(result, args, pos);
The problem is:

In the original code, we can have "new foo()" and this loop will continue
parsing the . and [ parts, so, "new foo().bar" gets parsed properly.

In the new code, we no longer loop the . and [ parts once we have found () and
constructed the NewExpression.

Powered by Google App Engine
This is Rietveld 408576698