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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 634603002: Await always waits (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 40777)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1093,8 +1093,17 @@
UnchainContexts(current_context_level);
}
-
- AddReturnExit(node->token_pos(), return_value);
+ if (function.is_async_closure() &&
+ (node->return_type() == ReturnNode::kContinuation)) {
+ // This return instruction may be followed by instructions
+ // that get called when the async closure is resumed, so
+ // do not add an exit and close the fragment.
+ ReturnInstr* return_instr =
+ new(I) ReturnInstr(node->token_pos(), return_value);
+ AddInstruction(return_instr);
+ } else {
+ AddReturnExit(node->token_pos(), return_value);
+ }
Florian Schneider 2014/10/06 17:32:54 I'd imagine this looking like this: AddReturnExit
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698