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

Unified Diff: src/parsing/parser.cc

Issue 2902423002: Revert of Make non-Module generators only context allocate parameters. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « src/debug/debug-scopes.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
« no previous file with comments | « src/debug/debug-scopes.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698