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

Issue 839323003: Implementation of async-await transformation on js ast. (Closed)

Created:
5 years, 11 months ago by sigurdm
Modified:
5 years, 10 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Implementation of async-await transformation on js ast. BUG= R=floitsch@google.com, johnniwinther@google.com Committed: https://code.google.com/p/dart/source/detail?r=43591

Patch Set 1 #

Patch Set 2 : #

Total comments: 18

Patch Set 3 : Address comments, implement more stuff, more tests #

Patch Set 4 : pre- and post-increment #

Patch Set 5 : Most things should work, except async*. #

Patch Set 6 : rebase #

Patch Set 7 : Added a few tests #

Total comments: 8

Patch Set 8 : Implement new ssa-nodes in ssa-tracer. #

Total comments: 254

Patch Set 9 : Address Johnni's comments #

Patch Set 10 : Small fixes to pass unittest #

Patch Set 11 : Improvements to asyncstar support #

Patch Set 12 : Address comments. Introduce async*. #

Patch Set 13 : Removed change to sdk/lib/async/stream_impl #

Patch Set 14 : Add missing functions to the MockCompiler's library #

Total comments: 6

Patch Set 15 : Undid changes to parentheses in tests now that Issue 22183 is solved. #

Patch Set 16 : Go back to generating return of wrapped errors when possible. #

Total comments: 84

Patch Set 17 : Address Stephan's comments #

Patch Set 18 : Removed the extra LocalsHandler #

Total comments: 49

Patch Set 19 : Address comments. Fix setting of the handler in finallies... #

Total comments: 118

Patch Set 20 : Introduced prefix to import of js, ran dartformat on rewrite_async.dart #

Patch Set 21 : Address comments - add TODO for buggy error behaviour. #

Total comments: 16

Patch Set 22 : Fixed test. Addressed comments #

Patch Set 23 : Rebase + fix issue with this-rebinding in sync*. #

Total comments: 10

Patch Set 24 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4321 lines, -172 lines) Patch
M pkg/compiler/lib/src/apiimpl.dart View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/closure.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +15 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/compiler.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +14 lines, -10 lines 0 comments Download
M pkg/compiler/lib/src/dart2js.dart View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +6 lines, -11 lines 0 comments Download
M pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +17 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/js/builder.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +12 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js/nodes.dart View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +40 lines, -6 lines 0 comments Download
M pkg/compiler/lib/src/js/printer.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +13 lines, -0 lines 0 comments Download
A pkg/compiler/lib/src/js/rewrite_async.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2153 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js/template.dart View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +84 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/patch_resolver.dart View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/resolution/members.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +5 lines, -8 lines 0 comments Download
M pkg/compiler/lib/src/resolution/registry.dart View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 10 chunks +215 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/ssa/codegen.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +33 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/ssa/nodes.dart View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +24 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/ssa.dart View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/ssa_tracer.dart View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/warnings.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/js_helper.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +263 lines, -4 lines 0 comments Download
M tests/compiler/dart2js/analyze_helper.dart View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
A tests/compiler/dart2js/async_await_js_transform_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +946 lines, -0 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download
M tests/compiler/dart2js/mock_libraries.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -0 lines 0 comments Download
A tests/language/asyncstar_yield_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +70 lines, -0 lines 0 comments Download
A tests/language/asyncstar_yieldstar_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +97 lines, -0 lines 0 comments Download
M tests/language/await_exceptions_test.dart View 1 2 3 4 3 chunks +19 lines, -1 line 0 comments Download
A tests/language/await_for_cancel_test.dart View 1 2 3 4 5 6 1 chunk +88 lines, -0 lines 0 comments Download
M tests/language/await_for_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +67 lines, -6 lines 0 comments Download
A + tests/language/await_not_started_immediately_test.dart View 1 2 3 4 5 6 1 chunk +13 lines, -11 lines 0 comments Download
M tests/language/language.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +13 lines, -81 lines 0 comments Download
M tests/language/sync_generator2_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -1 line 0 comments Download
A tests/language/syncstar_yield_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +54 lines, -0 lines 0 comments Download
A tests/language/syncstar_yieldstar_test.dart View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (8 generated)
floitsch
DBC. (didn't really did a thorough review, but globally looks good.) https://codereview.chromium.org/839323003/diff/20001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): ...
5 years, 11 months ago (2015-01-20 16:06:15 UTC) #2
sigurdm
pre- and post-increment
5 years, 11 months ago (2015-01-21 13:45:48 UTC) #3
sigurdm
Johnni: could you look at the registration/enqueueing part. Stephan: could you look at the type ...
5 years, 10 months ago (2015-02-02 10:20:15 UTC) #5
Johnni Winther
Resolution/enqueuing changes LGTM. https://codereview.chromium.org/839323003/diff/120001/pkg/compiler/lib/src/js_backend/backend.dart File pkg/compiler/lib/src/js_backend/backend.dart (right): https://codereview.chromium.org/839323003/diff/120001/pkg/compiler/lib/src/js_backend/backend.dart#newcode66 pkg/compiler/lib/src/js_backend/backend.dart:66: static final Uri DART_ASYNC = new ...
5 years, 10 months ago (2015-02-02 10:45:10 UTC) #6
floitsch
LGTM with comments. Next time please don't create such a massive CL. I haven't completely ...
5 years, 10 months ago (2015-02-02 22:00:12 UTC) #7
sigurdm
Thanks for the review - and sorry for the huge CL. I added (seemingly working) ...
5 years, 10 months ago (2015-02-03 16:59:33 UTC) #8
sigurdm
https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/ssa/codegen.dart File pkg/compiler/lib/src/ssa/codegen.dart (right): https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/ssa/codegen.dart#newcode2073 pkg/compiler/lib/src/ssa/codegen.dart:2073: pushStatement(new js.ExpressionStatement(value)); On 2015/02/03 16:59:32, sigurdm wrote: > On ...
5 years, 10 months ago (2015-02-04 09:40:42 UTC) #10
herhut
I only looked at the SSA and type inference part. We need a better story ...
5 years, 10 months ago (2015-02-04 09:42:49 UTC) #11
sigurdm
https://codereview.chromium.org/839323003/diff/280001/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart File pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart (right): https://codereview.chromium.org/839323003/diff/280001/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart#newcode590 pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart:590: } else On 2015/02/04 09:42:49, herhut wrote: > Put ...
5 years, 10 months ago (2015-02-04 10:11:44 UTC) #12
sigurdm
https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/ssa/builder.dart File pkg/compiler/lib/src/ssa/builder.dart (right): https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/ssa/builder.dart#newcode5959 pkg/compiler/lib/src/ssa/builder.dart:5959: // in a non-dominated block. On 2015/02/03 16:59:32, sigurdm ...
5 years, 10 months ago (2015-02-04 11:43:40 UTC) #13
floitsch
Haven't completely finished yet. Here are my comments so far. https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode1194 ...
5 years, 10 months ago (2015-02-04 12:31:30 UTC) #14
floitsch
Went through all files now. Still need to have a second closer look at the ...
5 years, 10 months ago (2015-02-04 15:31:52 UTC) #15
floitsch
LGTM once all comments are addressed. https://codereview.chromium.org/839323003/diff/360001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/360001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode13 pkg/compiler/lib/src/js/rewrite_async.dart:13: import "js.dart"; Since ...
5 years, 10 months ago (2015-02-04 17:06:10 UTC) #16
sigurdm
https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/140001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode1194 pkg/compiler/lib/src/js/rewrite_async.dart:1194: addStatement(js.statement("$nextName = [#];", On 2015/02/04 12:31:27, floitsch wrote: > ...
5 years, 10 months ago (2015-02-05 14:06:08 UTC) #17
floitsch
Still lots of comments, but as usual many are just nits (and/or comment changes). I ...
5 years, 10 months ago (2015-02-05 20:17:23 UTC) #19
sigurdm
https://codereview.chromium.org/839323003/diff/380001/pkg/compiler/lib/src/closure.dart File pkg/compiler/lib/src/closure.dart (right): https://codereview.chromium.org/839323003/diff/380001/pkg/compiler/lib/src/closure.dart#newcode354 pkg/compiler/lib/src/closure.dart:354: /// Also parameters to a `sync*` generator must be ...
5 years, 10 months ago (2015-02-06 14:26:35 UTC) #21
floitsch
almost no comments left. LGTM. https://codereview.chromium.org/839323003/diff/380001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/380001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode132 pkg/compiler/lib/src/js/rewrite_async.dart:132: /// It is a ...
5 years, 10 months ago (2015-02-06 14:58:44 UTC) #22
sigurdm
https://codereview.chromium.org/839323003/diff/380001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/380001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode132 pkg/compiler/lib/src/js/rewrite_async.dart:132: /// It is a parameter to the [helperName] function. ...
5 years, 10 months ago (2015-02-06 15:21:21 UTC) #24
sigurdm
5 years, 10 months ago (2015-02-06 15:21:27 UTC) #25
sigurdm
Made a change to how "this" is cached for sync* functions. PTAL
5 years, 10 months ago (2015-02-09 11:50:14 UTC) #26
sigurdm
Made a change to how "this" is cached for sync* functions. PTAL
5 years, 10 months ago (2015-02-09 11:50:16 UTC) #27
sigurdm
Made a change to how "this" is cached for sync* functions. PTAL
5 years, 10 months ago (2015-02-09 11:50:24 UTC) #28
floitsch
Still LGTM. https://codereview.chromium.org/839323003/diff/460001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/460001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode179 pkg/compiler/lib/src/js/rewrite_async.dart:179: /// Contructor used to initializes the [completerName] ...
5 years, 10 months ago (2015-02-09 11:53:58 UTC) #29
sigurdm
Committed patchset #24 (id:480001) manually as 43591 (presubmit successful).
5 years, 10 months ago (2015-02-09 12:03:33 UTC) #31
sigurdm
Forgot to post my last review responses https://codereview.chromium.org/839323003/diff/460001/pkg/compiler/lib/src/js/rewrite_async.dart File pkg/compiler/lib/src/js/rewrite_async.dart (right): https://codereview.chromium.org/839323003/diff/460001/pkg/compiler/lib/src/js/rewrite_async.dart#newcode179 pkg/compiler/lib/src/js/rewrite_async.dart:179: /// Contructor ...
5 years, 10 months ago (2015-02-11 07:54:53 UTC) #32
Lasse Reichstein Nielsen
Old unsent comments. https://codereview.chromium.org/839323003/diff/360001/sdk/lib/_internal/compiler/js_lib/js_helper.dart File sdk/lib/_internal/compiler/js_lib/js_helper.dart (right): https://codereview.chromium.org/839323003/diff/360001/sdk/lib/_internal/compiler/js_lib/js_helper.dart#newcode30 sdk/lib/_internal/compiler/js_lib/js_helper.dart:30: DeferredLoadException, Indent to align with Future? ...
5 years, 10 months ago (2015-02-13 11:13:20 UTC) #34
sigurdm
5 years, 10 months ago (2015-02-13 11:40:17 UTC) #35
Message was sent while issue was closed.
https://codereview.chromium.org/839323003/diff/360001/sdk/lib/_internal/compi...
File sdk/lib/_internal/compiler/js_lib/js_helper.dart (right):

https://codereview.chromium.org/839323003/diff/360001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/js_lib/js_helper.dart:30: DeferredLoadException,
On 2015/02/13 11:13:20, Lasse Reichstein Nielsen wrote:
> Indent to align with Future?
> Or at least by four.

Will do in future CL

https://codereview.chromium.org/839323003/diff/360001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/js_lib/js_helper.dart:3497: Future future = object is
Future ? object : new Future.value(object);
On 2015/02/13 11:13:20, Lasse Reichstein Nielsen wrote:
> Maybe just:
> 
>   if (object is Future) {
>     object.then(...);
>   } else {
>     _wrapJsFunction(helperCallback, completer)(object);
>   }
>   return completer.future;
> 
That would not suspend execution?
The spec is specific 16.29:
"Otherwise, if e evaluates to an object o that is not
an instance of Future, then let f be the result of calling Future.value() with o
as
its argument; otherwise let f be the result of evaluating e."

Powered by Google App Engine
This is Rietveld 408576698