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

Issue 634603002: Await always waits (Closed)

Created:
6 years, 2 months ago by hausner
Modified:
6 years, 2 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Await always waits The expression ‘await e’ always suspends the enclosing function. If e does not evaluate to a an object o of type Future, a new Future is created using Future.value(o). A small change in the backend allows a return instruction to be followed by other instructions. In async functions, a return can suspend the function and the continuation point is in the same code block after the return. Other small changes: - More user-friendly error message if async/await is not enabled. - Programs no longer need to import dart:async when using async/await. R=fschneider@google.com Committed: https://code.google.com/p/dart/source/detail?r=41105

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 8

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -167 lines) Patch
M runtime/vm/ast.h View 1 2 3 4 5 2 chunks +19 lines, -28 lines 0 comments Download
M runtime/vm/ast_printer.cc View 1 2 3 4 5 1 chunk +15 lines, -4 lines 0 comments Download
M runtime/vm/ast_transformer.h View 1 2 3 4 5 2 chunks +0 lines, -2 lines 0 comments Download
M runtime/vm/ast_transformer.cc View 1 2 3 4 5 5 chunks +62 lines, -44 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 1 chunk +1 line, -3 lines 0 comments Download
M runtime/vm/flow_graph_builder.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 2 3 4 5 4 chunks +36 lines, -43 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/object_store.h View 1 2 3 4 5 3 chunks +14 lines, -0 lines 0 comments Download
M runtime/vm/object_store.cc View 1 2 3 4 5 2 chunks +18 lines, -0 lines 0 comments Download
M runtime/vm/parser.h View 1 2 3 4 5 2 chunks +1 line, -2 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 5 14 chunks +21 lines, -39 lines 0 comments Download
M runtime/vm/symbols.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A tests/language/await_nonfuture_test.dart View 1 chunk +21 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
Florian Schneider
Here is my suggestion: https://codereview.chromium.org/634603002/diff/1/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/634603002/diff/1/runtime/vm/flow_graph_builder.cc#newcode1106 runtime/vm/flow_graph_builder.cc:1106: } I'd imagine this looking ...
6 years, 2 months ago (2014-10-06 17:32:55 UTC) #2
Florian Schneider
I think it should work with undoing the changes to GraphEntry and moving the creation ...
6 years, 2 months ago (2014-10-09 11:29:31 UTC) #3
hausner
New version. PTAL - Undoing the changes to GraphEntryInstr. - Disable optimization of async closure ...
6 years, 2 months ago (2014-10-13 23:41:26 UTC) #4
Florian Schneider
lgtm https://codereview.chromium.org/634603002/diff/90001/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/634603002/diff/90001/runtime/vm/ast_transformer.cc#newcode179 runtime/vm/ast_transformer.cc:179: GetVariableInScope(preamble_->scope(), Symbols::AwaitJumpVar()); It looks a little strange that ...
6 years, 2 months ago (2014-10-14 11:47:30 UTC) #5
Florian Schneider
PS https://codereview.chromium.org/634603002/diff/90001/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/634603002/diff/90001/runtime/vm/ast_transformer.cc#newcode179 runtime/vm/ast_transformer.cc:179: GetVariableInScope(preamble_->scope(), Symbols::AwaitJumpVar()); On 2014/10/14 11:47:30, Florian Schneider wrote: ...
6 years, 2 months ago (2014-10-14 15:04:37 UTC) #6
hausner
Thank you for finding the load elimination bug. https://codereview.chromium.org/634603002/diff/90001/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/634603002/diff/90001/runtime/vm/ast_transformer.cc#newcode179 runtime/vm/ast_transformer.cc:179: GetVariableInScope(preamble_->scope(), ...
6 years, 2 months ago (2014-10-14 19:56:39 UTC) #7
hausner
6 years, 2 months ago (2014-10-14 19:58:22 UTC) #8
Message was sent while issue was closed.
Committed patchset #6 (id:110001) manually as r41105 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698