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

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)

Created:
3 years, 11 months ago by caitp
Modified:
3 years, 9 months ago
CC:
v8-reviews_googlegroups.com, v8-x87-ports_googlegroups.com, v8-ppc-ports_googlegroups.com, v8-mips-ports_googlegroups.com, rmcilroy, Michael Hablich, Hannes Payer (out of office), ulan
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

WIP [esnext] implement async iteration proposal Submitted for early review. There are still missing pieces, and likely places where it could be done better (generating smaller code, for example). TODO(caitp): Finish cleanup and split apart into separate/easier-to-review patches and land separately. BUG=

Patch Set 1 #

Total comments: 13

Patch Set 2 : some fixups #

Patch Set 3 : Make (most of) for-await-of work (no IteratorClose yet..) #

Total comments: 20

Patch Set 4 : Add Yield* support #

Patch Set 5 : Fix minor parsing bug, add some local test262 tests #

Total comments: 24

Patch Set 6 : Add a few more tests + fix some bugs #

Patch Set 7 : fix async tests #

Total comments: 21

Patch Set 8 : address a bunch of comments, and refactor a bit #

Patch Set 9 : simplify AsyncIteratorValueUnwrap #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3585 lines, -193 lines) Patch
M BUILD.gn View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M include/v8.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M src/arm64/macro-assembler-arm64.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M src/ast/ast.h View 1 2 3 11 chunks +53 lines, -10 lines 0 comments Download
M src/ast/ast-numbering.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M src/ast/ast-types.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M src/ast/prettyprinter.cc View 1 chunk +3 lines, -1 line 0 comments Download
M src/bailout-reason.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 7 chunks +206 lines, -9 lines 0 comments Download
M src/builtins/builtins.h View 1 2 3 4 5 6 7 3 chunks +48 lines, -1 line 0 comments Download
A src/builtins/builtins-async.h View 1 2 3 4 5 6 7 8 1 chunk +68 lines, -0 lines 0 comments Download
A src/builtins/builtins-async.cc View 1 2 3 4 5 6 7 1 chunk +91 lines, -0 lines 0 comments Download
A src/builtins/builtins-async-generator.cc View 1 2 3 4 5 6 7 1 chunk +503 lines, -0 lines 0 comments Download
A src/builtins/builtins-async-iterator.cc View 1 2 3 4 5 6 7 8 1 chunk +542 lines, -0 lines 0 comments Download
M src/builtins/builtins-function.cc View 1 chunk +18 lines, -0 lines 0 comments Download
M src/builtins/builtins-promise.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M src/builtins/builtins-promise.cc View 1 2 chunks +70 lines, -1 line 0 comments Download
M src/builtins/x64/builtins-x64.cc View 1 2 3 4 5 6 7 2 chunks +31 lines, -5 lines 0 comments Download
M src/code-factory.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/code-factory.cc View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/code-stub-assembler.h View 1 2 3 4 5 6 7 1 chunk +25 lines, -0 lines 0 comments Download
M src/compiler/access-builder.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/access-builder.cc View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
M src/compiler/bytecode-graph-builder.cc View 1 2 3 4 5 6 7 1 chunk +28 lines, -2 lines 0 comments Download
M src/compiler/js-intrinsic-lowering.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler/js-intrinsic-lowering.cc View 1 2 3 4 5 6 7 2 chunks +27 lines, -0 lines 0 comments Download
M src/compiler/js-operator.h View 1 2 3 4 5 6 7 2 chunks +27 lines, -2 lines 0 comments Download
M src/compiler/js-operator.cc View 1 2 3 4 5 6 7 2 chunks +34 lines, -6 lines 0 comments Download
M src/compiler/js-typed-lowering.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download
M src/compiler/types.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M src/contexts.h View 1 2 3 6 chunks +57 lines, -38 lines 0 comments Download
M src/factory.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 3 chunks +16 lines, -2 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/globals.h View 3 chunks +14 lines, -2 lines 0 comments Download
M src/heap-symbols.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M src/heap/objects-visiting.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-generator.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 4 chunks +98 lines, -24 lines 0 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/interpreter/interpreter.cc View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
M src/interpreter/interpreter-intrinsics.h View 1 2 3 4 1 chunk +19 lines, -18 lines 0 comments Download
M src/interpreter/interpreter-intrinsics.cc View 1 2 3 4 1 chunk +36 lines, -0 lines 0 comments Download
M src/messages.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 9 chunks +85 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 5 chunks +25 lines, -3 lines 0 comments Download
M src/objects-body-descriptors-inl.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 5 chunks +29 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 7 chunks +24 lines, -1 line 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 7 4 chunks +32 lines, -0 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 chunks +12 lines, -5 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 25 chunks +196 lines, -18 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 3 4 13 chunks +183 lines, -17 lines 0 comments Download
M src/parsing/pattern-rewriter.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M src/parsing/preparser.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
M src/runtime/runtime-generator.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M src/runtime/runtime-internal.cc View 1 2 3 4 2 chunks +22 lines, -0 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -2 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 2 3 4 5 6 7 1 chunk +20 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-NSPL-with-USD.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-arguments-in-formal-parameters.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-await-as-function-binding-identifier.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-binding-identifier-arguments.js View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-binding-identifier-eval.js View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-body-contains-super-call.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-body-contains-super-property.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-eval-in-formal-parameters.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-const.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-let.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-contains-await.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-contains-await-expr.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-call.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-property.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield.js View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield-expr.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-label-name-await.js View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-label-name-yield.js View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-not-simple-assignment-target.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-yield-as-function-binding-identifier.js View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/early-errors-expression-yield-star-after-newline.js View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-await-as-yield-operand.js View 1 2 3 4 5 6 1 chunk +24 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-await-promise-as-yield-operand.js View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-await-thenable-as-yield-operand.js View 1 2 3 4 5 6 1 chunk +30 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-yield-as-operand.js View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-yield-as-statement.js View 1 2 3 4 5 6 1 chunk +41 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-yield-newline.js View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/expressions/async-generators/expression-yield-star-before-newline.js View 1 2 3 4 5 6 1 chunk +20 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/statements/for-await-of/Symbol.asyncIterator-async-generator.js View 1 2 3 4 5 6 1 chunk +72 lines, -0 lines 0 comments Download
A test/test262/local-tests/test/language/statements/for-await-of/Symbol.iterator-async-generator.js View 1 2 3 4 5 6 1 chunk +66 lines, -0 lines 0 comments Download
M test/test262/test262.status View 1 2 3 4 5 6 chunks +110 lines, -6 lines 0 comments Download
M test/test262/testcfg.py View 1 2 3 4 3 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 24 (4 generated)
caitp
Sneak peak for early review/feedback. Some self review attached. https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-async.cc File src/builtins/builtins-async.cc (right): https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-async.cc#newcode15 src/builtins/builtins-async.cc:15: ...
3 years, 11 months ago (2017-01-10 04:13:42 UTC) #1
caitp
https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-promise.cc File src/builtins/builtins-promise.cc (right): https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-promise.cc#newcode55 src/builtins/builtins-promise.cc:55: Node* context) { This seemed more useful earlier today, ...
3 years, 11 months ago (2017-01-10 04:19:34 UTC) #3
caitp
+a few people who might have comments/criticisms on some parts of this.
3 years, 11 months ago (2017-01-10 17:40:19 UTC) #5
gsathya
https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-promise.cc File src/builtins/builtins-promise.cc (right): https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-promise.cc#newcode55 src/builtins/builtins-promise.cc:55: Node* context) { On 2017/01/10 04:19:33, caitp wrote: > ...
3 years, 11 months ago (2017-01-10 17:47:24 UTC) #6
caitp
https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-promise.cc File src/builtins/builtins-promise.cc (right): https://codereview.chromium.org/2622833002/diff/1/src/builtins/builtins-promise.cc#newcode55 src/builtins/builtins-promise.cc:55: Node* context) { On 2017/01/10 17:47:24, gsathya wrote: > ...
3 years, 11 months ago (2017-01-10 17:48:54 UTC) #7
caitp
for-await-of is entirely broken atm, working on this.
3 years, 11 months ago (2017-01-10 19:23:17 UTC) #8
caitp
On 2017/01/10 19:23:17, caitp wrote: > for-await-of is entirely broken atm, working on this. To ...
3 years, 11 months ago (2017-01-11 16:13:14 UTC) #9
caitp
Yield* support is in the latest patchset, which _I believe_ is the last part of ...
3 years, 11 months ago (2017-01-11 17:21:45 UTC) #10
jgruber
Some minor comments below from a first look. https://codereview.chromium.org/2622833002/diff/40001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2622833002/diff/40001/src/bootstrapper.cc#newcode1412 src/bootstrapper.cc:1412: isolate->builtins()->builtin(Builtins::kAsyncIteratorValueUnwrap), ...
3 years, 11 months ago (2017-01-13 13:34:41 UTC) #13
jgruber
Some minor comments below from a first look. https://codereview.chromium.org/2622833002/diff/40001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2622833002/diff/40001/src/bootstrapper.cc#newcode1412 src/bootstrapper.cc:1412: isolate->builtins()->builtin(Builtins::kAsyncIteratorValueUnwrap), ...
3 years, 11 months ago (2017-01-13 13:34:43 UTC) #14
caitp
Thanks https://codereview.chromium.org/2622833002/diff/40001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2622833002/diff/40001/src/bootstrapper.cc#newcode1412 src/bootstrapper.cc:1412: isolate->builtins()->builtin(Builtins::kAsyncIteratorValueUnwrap), On 2017/01/13 13:34:34, jgruber wrote: > Nit: ...
3 years, 11 months ago (2017-01-13 14:36:04 UTC) #15
jgruber
https://codereview.chromium.org/2622833002/diff/40001/src/builtins/builtins-async-generator.cc File src/builtins/builtins-async-generator.cc (right): https://codereview.chromium.org/2622833002/diff/40001/src/builtins/builtins-async-generator.cc#newcode372 src/builtins/builtins-async-generator.cc:372: GotoUnless(SmiAboveOrEqual(continuation, SmiConstant(0)), &done); On 2017/01/13 14:36:04, caitp wrote: > ...
3 years, 11 months ago (2017-01-13 15:46:40 UTC) #16
Dan Ehrenberg
Some initial comments; still taking a closer look at the meatier parts. https://codereview.chromium.org/2622833002/diff/1/src/interpreter/interpreter-intrinsics.cc File src/interpreter/interpreter-intrinsics.cc ...
3 years, 11 months ago (2017-01-13 19:41:09 UTC) #17
caitp
https://codereview.chromium.org/2622833002/diff/80001/src/builtins/builtins-async.cc File src/builtins/builtins-async.cc (right): https://codereview.chromium.org/2622833002/diff/80001/src/builtins/builtins-async.cc#newcode23 src/builtins/builtins-async.cc:23: InternalResolvePromise(context, wrapped_value, value); On 2017/01/13 19:41:08, Dan Ehrenberg wrote: ...
3 years, 11 months ago (2017-01-13 20:11:53 UTC) #18
Dan Ehrenberg
The main thing here so far that's implemented differently from what I expected is the ...
3 years, 11 months ago (2017-01-13 22:09:02 UTC) #19
caitp
No strong opinion on the closure approach vs bound functions, but i __believe__ there's a ...
3 years, 11 months ago (2017-01-13 22:33:31 UTC) #20
Dan Ehrenberg
I still have to review the TF builtins in more detail, but from what I've ...
3 years, 11 months ago (2017-01-14 00:48:39 UTC) #21
Dan Ehrenberg
Oh sorry for my confusion; using contexts this way is following Benedikt's suggestion, applied in ...
3 years, 11 months ago (2017-01-14 00:54:03 UTC) #22
caitp
I've done some refactoring to try to duplicate code less. Builtins::ResumeGenerator() is now the meat ...
3 years, 11 months ago (2017-01-17 19:23:11 UTC) #23
neis
3 years, 11 months ago (2017-01-18 12:26:22 UTC) #24
I'm afraid this CL is too huge for me to understand all the interactions and
give meaningful feedback.  If you could prepare a CL that implements for-await
only, I'd be happy to review that.  On top of that we can then look at async
generators.  Thanks!

Powered by Google App Engine
This is Rietveld 408576698