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

Issue 1900343002: More accurately record an end position for default parameters in arrows (Closed)

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

Description

More accurately record an end position for default parameters in arrows Our previous over-conservative answer caused us to emit hole checks in full-codegen when eagerly parsing but not when lazily parsing. With this patch, we use the positions of the BinaryOperations making up the parameter list (which are the positions of the commas) to determine the appropriate "end position" for each parameter's initializer. This means that we get accurate-enough positions for the initializers in the eager parsing step to get the same answers for hole-check-elimination that we will later during ParseLazy. In the included test case, for example: (function() { ((s = 17, y = s) => s)(); } )(); ^2 ^1 The old code would generate a hole check when trying to load |s| for assignment to |y| (because it treated the closing parentheses pointed to by "^1" as the "initialization position" of |s|). The new code uses the comma pointed to by "^2" as the initialization position of |s|. Since that occurs textually before the load of |s|, full-codegen knows it can avoid the hole check. BUG=v8:4908 LOG=n Committed: https://crrev.com/e96cbdcdd611fe55d558439ce3854ebe1adfdb1a Cr-Commit-Position: refs/heads/master@{#35678}

Patch Set 1 #

Total comments: 4

Patch Set 2 : nikolaos comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -23 lines) Patch
M src/parsing/parser.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/parsing/parser.cc View 1 4 chunks +12 lines, -16 lines 0 comments Download
A + test/mjsunit/regress/regress-4908.js View 1 chunk +2 lines, -5 lines 0 comments Download

Messages

Total messages: 17 (5 generated)
adamk
4 years, 8 months ago (2016-04-20 00:35:32 UTC) #2
nickie
I will not pretend that I understand why this fixes the problem in v8:4908, but ...
4 years, 8 months ago (2016-04-20 11:01:41 UTC) #3
adamk
I've tried to add more to the CL description explaining what's going on in this ...
4 years, 8 months ago (2016-04-20 18:51:45 UTC) #5
Dan Ehrenberg
I don't see any problems in this code, but I wonder if we can get ...
4 years, 8 months ago (2016-04-20 19:55:55 UTC) #6
Dan Ehrenberg
On 2016/04/20 at 19:55:55, Dan Ehrenberg wrote: > I don't see any problems in this ...
4 years, 8 months ago (2016-04-20 19:56:25 UTC) #7
adamk
On 2016/04/20 19:56:25, Dan Ehrenberg wrote: > On 2016/04/20 at 19:55:55, Dan Ehrenberg wrote: > ...
4 years, 8 months ago (2016-04-20 19:59:24 UTC) #8
Dan Ehrenberg
On 2016/04/20 at 19:59:24, adamk wrote: > On 2016/04/20 19:56:25, Dan Ehrenberg wrote: > > ...
4 years, 8 months ago (2016-04-20 20:07:17 UTC) #9
adamk
On 2016/04/20 20:07:17, Dan Ehrenberg wrote: > On 2016/04/20 at 19:59:24, adamk wrote: > > ...
4 years, 8 months ago (2016-04-20 20:09:52 UTC) #10
Dan Ehrenberg
lgtm
4 years, 8 months ago (2016-04-20 20:44:32 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900343002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900343002/20001
4 years, 8 months ago (2016-04-20 20:46:37 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 8 months ago (2016-04-20 20:48:40 UTC) #15
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:13:51 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e96cbdcdd611fe55d558439ce3854ebe1adfdb1a
Cr-Commit-Position: refs/heads/master@{#35678}

Powered by Google App Engine
This is Rietveld 408576698