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

Unified Diff: src/ast/scopes.h

Issue 2171703004: 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 unnecessary DCHECK 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') | no next file with comments »
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 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.
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698