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

Issue 2637403008: [async-iteration] add support for for-await-of loops in Async Functions (Closed)

Created:
3 years, 11 months ago by caitp
Modified:
3 years, 10 months ago
CC:
v8-reviews_googlegroups.com, rmcilroy
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[async-iteration] add support for for-await-of loops in Async Functions When --harmony-async-iteration is enabled, it is now possible to use the for-await-of loop, which uses the Async Iteration protocol rather than the ordinary ES6 Iteration protocol. the Async-from-Sync Iterator object is not implemented in this CL, and so for-await-of loops will abort execution if the iterated object does not have a Symbol.asyncIterator() method. Async-from-Sync Iterators are implemented seperately in https://codereview.chromium.org/2645313003/ BUG=v8:5855, v8:4483 R=neis@chromium.org, littledan@chromium.org, adamk@chromium.org Review-Url: https://codereview.chromium.org/2637403008 Cr-Commit-Position: refs/heads/master@{#43224} Committed: https://chromium.googlesource.com/v8/v8/+/76ab55e3d37f31e1f343ad35c293404bfd259457

Patch Set 1 #

Total comments: 43

Patch Set 2 : some requested changes #

Patch Set 3 : edit some comments #

Total comments: 2

Patch Set 4 : add parser tests, fix parser code and fix mjsunit tests #

Patch Set 5 : fix compiler error on trybots #

Patch Set 6 : fix win32 compiler error #

Patch Set 7 : rebase #

Total comments: 4

Patch Set 8 : Add iterable TDZ tests, create iterable TDZ block, and fix style in the test #

Patch Set 9 : fix copyright line in for-await-of.js #

Patch Set 10 : [async-iteration] add support for for-await-of loops in Async Functions #

Total comments: 8

Patch Set 11 : more tests, fix nits #

Patch Set 12 : rebase #

Patch Set 13 : remove changes to ParserTarget / PreParserTarget #

Total comments: 1

Patch Set 14 : remove comment, and refactor tests a bit (and enable a test that works correctly) #

Patch Set 15 : Rebase now that try/finally is fixed #

Total comments: 1

Patch Set 16 : ...and uncomment the previously failing tests... #

Total comments: 17

Patch Set 17 : change ParseScopedStatement call for clarity, add some tests, and other bits #

Patch Set 18 : remove that comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1964 lines, -72 lines) Patch
M src/ast/ast.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +28 lines, -4 lines 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +58 lines, -15 lines 0 comments Download
M src/interpreter/constant-array-builder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -3 lines 0 comments Download
M src/interpreter/constant-array-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -6 lines 0 comments Download
M src/messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +15 lines, -7 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 chunks +64 lines, -31 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +155 lines, -1 line 0 comments Download
M src/parsing/pattern-rewriter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +6 lines, -5 lines 0 comments Download
M src/parsing/preparser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +13 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +2 lines, -0 lines 0 comments Download
M src/runtime/runtime-internal.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +14 lines, -0 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +324 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/for-await-of.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1264 lines, -0 lines 0 comments Download

Messages

Total messages: 88 (45 generated)
caitp
Hey, This CL includes for-await-of components of https://codereview.chromium.org/2622833002/ by themselves, with a bit of test ...
3 years, 11 months ago (2017-01-20 00:13:19 UTC) #1
rmcilroy
Took a quick look at the interpreter parts, a couple of suggestions but that part ...
3 years, 11 months ago (2017-01-20 10:34:01 UTC) #3
neis
Hi Caitlin, here's a first round of comments. I'm not very familiar with the code ...
3 years, 11 months ago (2017-01-20 14:38:16 UTC) #4
caitp
Thanks, will go over these comments in more detail shortly https://codereview.chromium.org/2637403008/diff/1/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2637403008/diff/1/src/parsing/parser.cc#newcode2089 ...
3 years, 11 months ago (2017-01-20 17:05:34 UTC) #5
caitp
so, it seems like `throw` in for-await-of is broken, based on the last test I ...
3 years, 11 months ago (2017-01-20 20:17:19 UTC) #6
caitp
I guess throw works just fine, and it was rather an error in the test, ...
3 years, 11 months ago (2017-01-21 16:50:33 UTC) #18
marja
https://codereview.chromium.org/2637403008/diff/40001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2637403008/diff/40001/src/parsing/parser-base.h#newcode5649 src/parsing/parser-base.h:5649: impl()->CreateForEachStatementTDZ(impl()->NullBlock(), for_info, ok); On 2017/01/21 16:50:33, caitp wrote: > ...
3 years, 11 months ago (2017-01-23 05:34:10 UTC) #25
marja
could you also add tests for the tdz? https://codereview.chromium.org/2637403008/diff/120001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2637403008/diff/120001/src/parsing/parser-base.h#newcode5641 src/parsing/parser-base.h:5641: template ...
3 years, 11 months ago (2017-01-23 05:50:02 UTC) #26
caitp
On 2017/01/23 05:34:10, marja wrote: > https://codereview.chromium.org/2637403008/diff/40001/src/parsing/parser-base.h > File src/parsing/parser-base.h (right): > > https://codereview.chromium.org/2637403008/diff/40001/src/parsing/parser-base.h#newcode5649 > ...
3 years, 11 months ago (2017-01-23 06:10:35 UTC) #27
neis
On 2017/01/20 14:38:16, neis wrote: > https://codereview.chromium.org/2637403008/diff/1/src/parsing/parser.cc#newcode5163 > src/parsing/parser.cc:5163: } > We must also do ...
3 years, 11 months ago (2017-01-23 09:13:53 UTC) #28
marja
Hmm, yeah, for-await-of seems to be much more restricted wrt what is allowed, whereas ParseForStatement ...
3 years, 11 months ago (2017-01-23 09:39:59 UTC) #29
nickie
Sorry for not taking part in this earlier. I was only involved in the last ...
3 years, 11 months ago (2017-01-23 10:10:10 UTC) #30
caitp
I've added tests and re-added the the CreateForEachStatementTDZ() call, in the correct scope. Seems to ...
3 years, 11 months ago (2017-01-23 14:18:15 UTC) #31
adamk
Georg asked me to take a look at this, but is the plan to rebase ...
3 years, 11 months ago (2017-01-23 19:25:18 UTC) #32
caitp
On 2017/01/23 19:25:18, adamk wrote: > Georg asked me to take a look at this, ...
3 years, 11 months ago (2017-01-23 19:28:43 UTC) #33
marja
On 2017/01/23 19:28:43, caitp wrote: > On 2017/01/23 19:25:18, adamk wrote: > > Georg asked ...
3 years, 11 months ago (2017-01-24 10:53:17 UTC) #40
neis
https://codereview.chromium.org/2637403008/diff/120001/test/mjsunit/harmony/for-await-of.js File test/mjsunit/harmony/for-await-of.js (right): https://codereview.chromium.org/2637403008/diff/120001/test/mjsunit/harmony/for-await-of.js#newcode330 test/mjsunit/harmony/for-await-of.js:330: // Ensure strict mode applies to block with use-strict-directive ...
3 years, 11 months ago (2017-01-24 12:49:20 UTC) #41
neis
Could you add a few tests that would have caught the missing await? Maybe by ...
3 years, 11 months ago (2017-01-24 12:53:01 UTC) #42
neis
https://codereview.chromium.org/2637403008/diff/1/src/interpreter/interpreter-intrinsics.cc File src/interpreter/interpreter-intrinsics.cc (right): https://codereview.chromium.org/2637403008/diff/1/src/interpreter/interpreter-intrinsics.cc#newcode407 src/interpreter/interpreter-intrinsics.cc:407: __ NoContextConstant()); On 2017/01/20 20:17:19, caitp wrote: > On ...
3 years, 11 months ago (2017-01-24 12:55:46 UTC) #43
caitp
On 2017/01/24 12:53:01, neis wrote: > Could you add a few tests that would have ...
3 years, 11 months ago (2017-01-24 19:34:46 UTC) #46
caitp
On 2017/01/24 19:34:46, caitp wrote: > On 2017/01/24 12:53:01, neis wrote: > > Could you ...
3 years, 11 months ago (2017-01-24 20:49:55 UTC) #47
caitp
think I've addressed all of those comments, and added a lot of new tests. So ...
3 years, 11 months ago (2017-01-24 22:51:55 UTC) #48
rmcilroy
Interpreter changes LGTM, but could you add a test snippet to test-bytecode-generator to get bytecode ...
3 years, 11 months ago (2017-01-25 09:20:44 UTC) #49
neis
On 2017/01/24 19:34:46, caitp wrote: > On 2017/01/24 12:53:01, neis wrote: > > Could you ...
3 years, 11 months ago (2017-01-25 10:38:45 UTC) #50
neis
I wanted to play around with your patch but I can't find a commit that ...
3 years, 11 months ago (2017-01-25 10:55:39 UTC) #51
caitp
On 2017/01/25 10:38:45, neis wrote: > On 2017/01/24 19:34:46, caitp wrote: > > On 2017/01/24 ...
3 years, 11 months ago (2017-01-25 12:17:59 UTC) #52
neis
https://codereview.chromium.org/2637403008/diff/240001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2637403008/diff/240001/src/parsing/parser.cc#newcode4654 src/parsing/parser.cc:4654: // if (!IS_RECEIVER(output)) %ThrowIterResultNotAnObject(output); Please undo the comment changes ...
3 years, 11 months ago (2017-01-25 16:11:08 UTC) #53
caitp
Now that the try/finally bug has been fixed, all of the new tests are passing. ...
3 years, 10 months ago (2017-02-10 19:35:24 UTC) #56
caitp
https://codereview.chromium.org/2637403008/diff/270001/src/interpreter/constant-array-builder.cc File src/interpreter/constant-array-builder.cc (right): https://codereview.chromium.org/2637403008/diff/270001/src/interpreter/constant-array-builder.cc#newcode326 src/interpreter/constant-array-builder.cc:326: #undef ENTRY_LOOKUP +leszeks@chromium.org << does this seem like a ...
3 years, 10 months ago (2017-02-10 19:38:41 UTC) #57
marja
parsing/* and ast/* LGTM (w/ nit) Please make sure you have LGTM for all files ...
3 years, 10 months ago (2017-02-14 09:30:43 UTC) #63
neis
I'll take another look today.
3 years, 10 months ago (2017-02-14 09:44:52 UTC) #64
nickie
Parsing and AST look good, just a minor comment. https://codereview.chromium.org/2637403008/diff/290001/src/parsing/parser.h File src/parsing/parser.h (right): https://codereview.chromium.org/2637403008/diff/290001/src/parsing/parser.h#newcode473 src/parsing/parser.h:473: ...
3 years, 10 months ago (2017-02-14 13:35:24 UTC) #65
caitp
https://codereview.chromium.org/2637403008/diff/290001/src/parsing/parser.h File src/parsing/parser.h (right): https://codereview.chromium.org/2637403008/diff/290001/src/parsing/parser.h#newcode473 src/parsing/parser.h:473: Statement* InitializeForOfStatement(ForEachStatement* stmt, Expression* each, On 2017/02/14 13:35:24, nickie ...
3 years, 10 months ago (2017-02-14 14:16:38 UTC) #66
neis
lgtm
3 years, 10 months ago (2017-02-14 14:28:23 UTC) #67
caitp
If my answers for those comments are satisfactory, I'd like to land this soon so ...
3 years, 10 months ago (2017-02-14 18:10:05 UTC) #68
adamk
I have a partial answer to Nikolaos's question, along with a few stylistic concerns and ...
3 years, 10 months ago (2017-02-14 18:47:54 UTC) #69
caitp
https://codereview.chromium.org/2637403008/diff/290001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2637403008/diff/290001/src/parsing/parser-base.h#newcode5761 src/parsing/parser-base.h:5761: if (!IsNextLetKeyword()) goto parse_lhs; On 2017/02/14 18:47:53, adamk wrote: ...
3 years, 10 months ago (2017-02-14 20:27:29 UTC) #70
Dan Ehrenberg
https://codereview.chromium.org/2637403008/diff/290001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2637403008/diff/290001/src/ast/ast.h#newcode2967 src/ast/ast.h:2967: IteratorType hint() const { return hint_; } On 2017/02/14 ...
3 years, 10 months ago (2017-02-14 20:56:18 UTC) #73
caitp
On 2017/01/25 09:20:44, rmcilroy wrote: > Interpreter changes LGTM, but could you add a test ...
3 years, 10 months ago (2017-02-14 21:40:58 UTC) #76
adamk
lgtm
3 years, 10 months ago (2017-02-14 21:51:05 UTC) #77
caitp
...think that's the last of the comments. My understanding is that people are happy with ...
3 years, 10 months ago (2017-02-15 19:00:19 UTC) #78
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2637403008/330001
3 years, 10 months ago (2017-02-15 19:37:29 UTC) #85
commit-bot: I haz the power
3 years, 10 months ago (2017-02-15 19:39:21 UTC) #88
Message was sent while issue was closed.
Committed patchset #18 (id:330001) as
https://chromium.googlesource.com/v8/v8/+/76ab55e3d37f31e1f343ad35c293404bfd2...

Powered by Google App Engine
This is Rietveld 408576698