Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index e468cb970c09bc75a32f21938c9a7cb839124b4c..2d5d0f429e9ddb9779514abdb592d9b8282cd967 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -4392,6 +4392,9 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> function_name, |
// Parse function body. |
{ FunctionState function_state(this, scope, is_generator, isolate()); |
top_scope_->SetScopeName(function_name); |
+ // For generators, allocating variables in contexts is currently a win |
+ // because it minimizes the work needed to suspend and resume an activation. |
+ if (is_generator) top_scope_->ForceContextAllocation(); |
// FormalParameterList :: |
// '(' (Identifier)*[','] ')' |