Index: src/ast/scopes.h |
diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
index 0299210d8f773e365feb204361b09974c0a545d7..e014af7bba426d98462279f4cd6e3d8e0b7be19e 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. |