Chromium Code Reviews| 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). |