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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 2774233003: Cleanups needed for async step-out (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 1163
1164 LocalVariable* rcv_var = 1164 LocalVariable* rcv_var =
1165 node->scope()->LookupVariable(Symbols::AsyncCompleter(), false); 1165 node->scope()->LookupVariable(Symbols::AsyncCompleter(), false);
1166 ASSERT(rcv_var != NULL && rcv_var->is_captured()); 1166 ASSERT(rcv_var != NULL && rcv_var->is_captured());
1167 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1167 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1168 new (Z) ZoneGrowableArray<PushArgumentInstr*>(2); 1168 new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
1169 Value* rcv_value = Bind(BuildLoadLocal(*rcv_var, node->token_pos())); 1169 Value* rcv_value = Bind(BuildLoadLocal(*rcv_var, node->token_pos()));
1170 arguments->Add(PushArgument(rcv_value)); 1170 arguments->Add(PushArgument(rcv_value));
1171 Value* returned_value = Bind(BuildLoadExprTemp(node->token_pos())); 1171 Value* returned_value = Bind(BuildLoadExprTemp(node->token_pos()));
1172 arguments->Add(PushArgument(returned_value)); 1172 arguments->Add(PushArgument(returned_value));
1173 InstanceCallInstr* call = new (Z) InstanceCallInstr( 1173 // Call a helper function to complete the completer. The debugger
1174 node->token_pos(), Symbols::CompleterComplete(), Token::kILLEGAL, 1174 // uses the helper function to know when to step-out.
1175 arguments, Object::null_array(), 1, owner()->ic_data_array()); 1175 const Function& complete_on_async_return = Function::ZoneHandle(
1176 Z, isolate()->object_store()->complete_on_async_return());
1177 ASSERT(!complete_on_async_return.IsNull());
1178 StaticCallInstr* call = new (Z) StaticCallInstr(
1179 node->token_pos().ToSynthetic(), complete_on_async_return,
1180 Object::null_array(), arguments, owner()->ic_data_array());
1176 Do(call); 1181 Do(call);
1177 1182
1178 // Rebind the return value for the actual return call to be null. 1183 // Rebind the return value for the actual return call to be null.
1179 return_value = BuildNullValue(node->token_pos()); 1184 return_value = BuildNullValue(node->token_pos());
1180 } 1185 }
1181 1186
1182 intptr_t current_context_level = owner()->context_level(); 1187 intptr_t current_context_level = owner()->context_level();
1183 ASSERT(current_context_level >= 0); 1188 ASSERT(current_context_level >= 0);
1184 if (HasContextScope()) { 1189 if (HasContextScope()) {
1185 UnchainContexts(current_context_level); 1190 UnchainContexts(current_context_level);
(...skipping 3164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4350 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); 4355 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks);
4351 ASSERT(found); 4356 ASSERT(found);
4352 } 4357 }
4353 4358
4354 4359
4355 void FlowGraphBuilder::Bailout(const char* reason) const { 4360 void FlowGraphBuilder::Bailout(const char* reason) const {
4356 parsed_function_.Bailout("FlowGraphBuilder", reason); 4361 parsed_function_.Bailout("FlowGraphBuilder", reason);
4357 } 4362 }
4358 4363
4359 } // namespace dart 4364 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698