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

Unified Diff: src/ast/scopes.h

Issue 2166023002: Rescope arrow-function parameter lists by moving the delta to the parameter scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove unresolved() again Created 4 years, 5 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 | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698