Index: src/ast/scopes.h |
diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
index 6fe6fe4f4e3cd98411b2a1811dc9a2a17f2469bc..be59f929c214adfa1c126f8c9fe65a00991f3a3e 100644 |
--- a/src/ast/scopes.h |
+++ b/src/ast/scopes.h |
@@ -92,6 +92,23 @@ class Scope: public ZoneObject { |
Scope(Zone* zone, Scope* outer_scope, ScopeType scope_type, |
FunctionKind function_kind = kNormalFunction); |
+ class Snapshot final BASE_EMBEDDED { |
+ public: |
+ explicit Snapshot(Scope* scope) |
+ : outer_scope_(scope), |
+ top_inner_scope_(scope->inner_scope_), |
+ top_unresolved_(scope->unresolved_), |
+ top_temp_(scope->ClosureScope()->temps_.length()) {} |
+ |
+ void Reparent(Scope* new_parent) const; |
+ |
+ private: |
+ Scope* outer_scope_; |
+ Scope* top_inner_scope_; |
+ VariableProxy* top_unresolved_; |
+ int top_temp_; |
+ }; |
+ |
// Compute top scope and allocate variables. For lazy compilation the top |
// scope only contains the single lazily compiled function, so this |
// doesn't re-allocate variables repeatedly. |