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

Unified Diff: src/parser.cc

Issue 13408005: Force context allocation for variables in generator scopes. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 8 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/ia32/full-codegen-ia32.cc ('k') | src/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)*[','] ')'
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698