Index: runtime/vm/flow_graph_builder.cc |
=================================================================== |
--- runtime/vm/flow_graph_builder.cc (revision 41096) |
+++ runtime/vm/flow_graph_builder.cc (working copy) |
@@ -1455,7 +1455,9 @@ |
} |
-void EffectGraphVisitor::BuildAwaitJump(LocalScope* lookup_scope, |
+void EffectGraphVisitor::BuildAwaitJump(LocalVariable* old_context, |
+ LocalVariable* continuation_result, |
+ LocalVariable* continuation_error, |
const intptr_t old_ctx_level, |
JoinEntryInstr* target) { |
// Building a jump consists of the following actions: |
@@ -1463,15 +1465,9 @@ |
// * Restore the old context. |
// * Overwrite the old context's continuation result with the temporary. |
// * Append a Goto to the target's join. |
- LocalVariable* old_ctx = lookup_scope->LookupVariable( |
- Symbols::AwaitContextVar(), false); |
- LocalVariable* continuation_result = lookup_scope->LookupVariable( |
- Symbols::AsyncOperationParam(), false); |
- LocalVariable* continuation_error = lookup_scope->LookupVariable( |
- Symbols::AsyncOperationErrorParam(), false); |
ASSERT((continuation_result != NULL) && continuation_result->is_captured()); |
ASSERT((continuation_error != NULL) && continuation_error->is_captured()); |
- ASSERT((old_ctx != NULL) && old_ctx->is_captured()); |
+ ASSERT((old_context != NULL) && old_context->is_captured()); |
// Before restoring the continuation context we need to temporary save the |
// result and error parameter. |
LocalVariable* temp_result_var = EnterTempLocalScope( |
@@ -1479,7 +1475,7 @@ |
LocalVariable* temp_error_var = EnterTempLocalScope( |
Bind(BuildLoadLocal(*continuation_error))); |
// Restore the saved continuation context. |
- BuildRestoreContext(*old_ctx); |
+ BuildRestoreContext(*old_context); |
// Pass over the continuation result. |
@@ -3882,6 +3878,12 @@ |
Scanner::kNoSourcePos, jump_var); |
ComparisonNode* check_jump_cnt; |
const intptr_t num_await_states = owner()->await_joins()->length(); |
+ LocalVariable* old_context = top_scope->LookupVariable( |
+ Symbols::AwaitContextVar(), false); |
+ LocalVariable* continuation_result = top_scope->LookupVariable( |
+ Symbols::AsyncOperationParam(), false); |
+ LocalVariable* continuation_error = top_scope->LookupVariable( |
+ Symbols::AsyncOperationErrorParam(), false); |
for (intptr_t i = 0; i < num_await_states; i++) { |
check_jump_cnt = new(I) ComparisonNode( |
Scanner::kNoSourcePos, |
@@ -3894,7 +3896,9 @@ |
EffectGraphVisitor for_true(owner()); |
EffectGraphVisitor for_false(owner()); |
- for_true.BuildAwaitJump(top_scope, |
+ for_true.BuildAwaitJump(old_context, |
+ continuation_result, |
+ continuation_error, |
(*owner()->await_levels())[i], |
(*owner()->await_joins())[i]); |
Join(for_test, for_true, for_false); |