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

Unified Diff: runtime/vm/parser.cc

Issue 655773003: Initialize the async jump variable with a smi to avoid polymorphic comparison. (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
« runtime/vm/ast_transformer.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 41096)
+++ runtime/vm/parser.cc (working copy)
@@ -5877,6 +5877,7 @@
CloseBlock();
closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
+ closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
closure_body->scope()->CaptureVariable(Symbols::AsyncCompleter());
// Create and return a new future that executes a closure with the current
@@ -5916,6 +5917,14 @@
completer_constructor_node);
current_block_->statements->Add(store_completer);
+ // :await_jump_var = -1;
+ LocalVariable* jump_var = current_block_->scope->LookupVariable(
+ Symbols::AwaitJumpVar(), false);
+ LiteralNode* init_value =
+ new(I) LiteralNode(Scanner::kNoSourcePos, Smi::ZoneHandle(Smi::New(-1)));
+ current_block_->statements->Add(
+ new (I) StoreLocalNode(Scanner::kNoSourcePos, jump_var, init_value));
+
// Add to AST:
// :async_op = <closure>; (containing the original body)
LocalVariable* async_op_var = current_block_->scope->LookupVariable(
« runtime/vm/ast_transformer.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698