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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 2774233003: Cleanups needed for async step-out (Closed)
Patch Set: Created 3 years, 9 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
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 56d2e52c3a12ba9cacd5444daf476221e14b1408..46aeb72b2d2a968a766aca48655943621ce10861 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1170,9 +1170,14 @@ void EffectGraphVisitor::VisitReturnNode(ReturnNode* node) {
arguments->Add(PushArgument(rcv_value));
Value* returned_value = Bind(BuildLoadExprTemp(node->token_pos()));
arguments->Add(PushArgument(returned_value));
- InstanceCallInstr* call = new (Z) InstanceCallInstr(
- node->token_pos(), Symbols::CompleterComplete(), Token::kILLEGAL,
- arguments, Object::null_array(), 1, owner()->ic_data_array());
+ // Call a helper function to complete the completer. The debugger
+ // uses the helper function to know when to step-out.
+ const Function& complete_on_async_return = Function::ZoneHandle(
+ Z, isolate()->object_store()->complete_on_async_return());
+ ASSERT(!complete_on_async_return.IsNull());
+ StaticCallInstr* call = new (Z) StaticCallInstr(
+ node->token_pos().ToSynthetic(), complete_on_async_return,
+ Object::null_array(), arguments, owner()->ic_data_array());
Do(call);
// Rebind the return value for the actual return call to be null.

Powered by Google App Engine
This is Rietveld 408576698