| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 95b827e6d5ac1adb177ca29e5ebc7d303df75bc7..90c578fb8dc9deb2b8cff77ca16142d6255d3f4a 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -706,7 +706,6 @@
|
| var->AllocateTo(VariableLocation::PARAMETER, 0);
|
|
|
| PrepareGeneratorVariables();
|
| - scope->ForceContextAllocation();
|
| Expression* initial_yield =
|
| BuildInitialYield(kNoSourcePosition, kGeneratorFunction);
|
| body->Add(
|
| @@ -2532,9 +2531,11 @@
|
| }
|
|
|
| void Parser::PrepareGeneratorVariables() {
|
| - // 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();
|
| + // 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();
|
|
|
| // Calling a generator returns a generator object. That object is stored
|
| // in a temporary variable, a definition that is used by "yield"
|
|
|