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

Unified Diff: src/ast/scopes.h

Issue 2159573002: Turn the unresolved-references list into a linked list using the VariableProxies themselves (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment 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 | « src/ast/ast.cc ('k') | 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 0e4da9a301c13854fafc71e70eb0ad5b2ad9905e..cde826a116192e54fcf1d1af8b2cbb011700b758 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -183,14 +183,16 @@ class Scope: public ZoneObject {
DCHECK(!already_resolved());
VariableProxy* proxy =
factory->NewVariableProxy(name, kind, start_position, end_position);
- unresolved_.Add(proxy, zone_);
+ proxy->set_next_unresolved(unresolved_);
+ unresolved_ = proxy;
return proxy;
}
void AddUnresolved(VariableProxy* proxy) {
DCHECK(!already_resolved());
DCHECK(!proxy->is_resolved());
- unresolved_.Add(proxy, zone_);
+ proxy->set_next_unresolved(unresolved_);
+ unresolved_ = proxy;
}
// Remove a unresolved variable. During parsing, an unresolved variable
@@ -629,8 +631,9 @@ class Scope: public ZoneObject {
ZoneList<Variable*> params_;
// Variables that must be looked up dynamically.
DynamicScopePart* dynamics_;
- // Unresolved variables referred to from this scope.
- ZoneList<VariableProxy*> unresolved_;
+ // Unresolved variables referred to from this scope. The proxies themselves
+ // form a linked list of all unresolved proxies.
+ VariableProxy* unresolved_;
// Declarations.
ZoneList<Declaration*> decls_;
// Convenience variable.
« no previous file with comments | « src/ast/ast.cc ('k') | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698