Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 90c578fb8dc9deb2b8cff77ca16142d6255d3f4a..95b827e6d5ac1adb177ca29e5ebc7d303df75bc7 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -706,6 +706,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) { |
var->AllocateTo(VariableLocation::PARAMETER, 0); |
PrepareGeneratorVariables(); |
+ scope->ForceContextAllocation(); |
Expression* initial_yield = |
BuildInitialYield(kNoSourcePosition, kGeneratorFunction); |
body->Add( |
@@ -2531,11 +2532,9 @@ void Parser::DeclareArrowFunctionFormalParameters( |
} |
void Parser::PrepareGeneratorVariables() { |
- // For generators, allocating variables in contexts is currently a win because |
- // it minimizes the work needed to suspend and resume an activation. The |
- // code produced for generators relies on this forced context allocation (it |
- // does not restore the frame's parameters upon resume). |
- function_state_->scope()->ForceContextAllocation(); |
+ // The code produced for generators relies on forced context allocation of |
+ // parameters (it does not restore the frame's parameters upon resume). |
+ function_state_->scope()->ForceContextAllocationForParameters(); |
// Calling a generator returns a generator object. That object is stored |
// in a temporary variable, a definition that is used by "yield" |