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

Issue 1772793002: Implement iterator finalization in array destructuring. (Closed)

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

Description

Implement iterator finalization in array destructuring. We must close the iterator whenever the destructuring didn't exhaust it, unless an iterator operation (eg. next) threw. We do this by wrapping the iterator use in a try-catch-finally similar to the desugaring of for-of. This is behind --harmony-iterator-close. R=adamk@chromium.org BUG=v8:3566 LOG=Y Committed: https://crrev.com/3062af70eb8e7dc49501981237c658ff5a861780 Cr-Commit-Position: refs/heads/master@{#34654}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Address comments. #

Total comments: 1

Patch Set 3 : Address two comments #

Patch Set 4 : git cl format #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1114 lines, -217 lines) Patch
M src/parsing/parser.h View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 9 chunks +175 lines, -133 lines 0 comments Download
M src/parsing/pattern-rewriter.cc View 1 2 3 4 3 chunks +108 lines, -42 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOf.golden View 1 2 3 4 24 chunks +40 lines, -40 lines 0 comments Download
M test/mjsunit/harmony/iterator-close.js View 1 12 chunks +781 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (6 generated)
neis
4 years, 9 months ago (2016-03-07 17:39:46 UTC) #1
neis
Hi Adam, there are a few cosmetic changes that I want to do tomorrow. Besides ...
4 years, 9 months ago (2016-03-07 17:42:00 UTC) #2
adamk
First round of comments (as noted in several places, this patch is pretty big so ...
4 years, 9 months ago (2016-03-07 20:28:05 UTC) #3
adamk
A few more comments. Also, re: function parameters, I think this patch should be sufficient ...
4 years, 9 months ago (2016-03-08 01:57:07 UTC) #4
neis
Thanks for the comments. I uploaded a new patch set. Two points to note: - ...
4 years, 9 months ago (2016-03-08 13:40:10 UTC) #5
adamk
Please add more to the CL description explaining the approach taken here. With that and ...
4 years, 9 months ago (2016-03-08 18:41:13 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1772793002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1772793002/80001
4 years, 9 months ago (2016-03-10 08:32:30 UTC) #11
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 9 months ago (2016-03-10 09:33:39 UTC) #13
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/3062af70eb8e7dc49501981237c658ff5a861780 Cr-Commit-Position: refs/heads/master@{#34654}
4 years, 9 months ago (2016-03-10 09:34:47 UTC) #15
neis
On 2016/03/08 18:41:13, adamk wrote: > Please add more to the CL description explaining the ...
4 years, 9 months ago (2016-03-10 11:44:43 UTC) #16
adamk
4 years, 9 months ago (2016-03-10 18:49:04 UTC) #17
Message was sent while issue was closed.
On 2016/03/10 11:44:43, neis wrote:
> On 2016/03/08 18:41:13, adamk wrote:
> > Please add more to the CL description explaining the approach taken here.
With
> > that and the two other notes below, this patch lgtm.
> 
> Done.
>  
> > I am curious whether it would be cleaner to replace most of the iterator
> > interaction in PatternRewriter with a ForOf loop, similar to what Nikolaos
did
> > for array spreads. Did you give that a try and run into problems, or just
> decide
> > to take a different path?
> 
> You mean along the lines of what you wrote in your old CL?  When I saw that, I
> was already in the middle of what I submitted now.  And I thought there was a
> problem with rest-patterns in that approach, but now I'm thinking maybe there
> isn't.  My feeling is that if it works, then your approach is cleaner but
> requires more changes.

Okay. If I get some spare time and you don't mind I may go back and re-implement
this with for-of just to avoid the duplicated iterator logic.

Powered by Google App Engine
This is Rietveld 408576698