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

Unified Diff: src/scopes.h

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, 9 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
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 3ca2dcf0ce259c6fafc57bb05a3e4bbf2160671e..cd53820b8df0684e83368d5f9dd7ca86f5048333 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -269,6 +269,17 @@ class Scope: public ZoneObject {
end_position_ = statement_pos;
}
+ // In some cases we want to force context allocation for a whole scope. For
+ // example in generators, allocating variables in contexts minimizes the work
Michael Starzinger 2013/04/05 11:38:42 Can we move the second sentence of this comment to
wingo 2013/04/05 12:25:06 Done.
+ // to suspend and resume.
+ void ForceContextAllocation() {
+ ASSERT(!already_resolved());
+ force_context_allocation_ = true;
+ }
+ bool has_forced_context_allocation() const {
+ return force_context_allocation_;
+ }
+
// ---------------------------------------------------------------------------
// Predicates.
@@ -494,6 +505,7 @@ class Scope: public ZoneObject {
bool outer_scope_calls_non_strict_eval_;
bool inner_scope_calls_eval_;
bool force_eager_compilation_;
+ bool force_context_allocation_;
// True if it doesn't need scope resolution (e.g., if the scope was
// constructed based on a serialized scope info or a catch context).

Powered by Google App Engine
This is Rietveld 408576698