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

Unified Diff: src/ast/scopes.cc

Issue 2312683002: Include only stuff you need, part 7: Fix scopes.h -> ast.h. (Closed)
Patch Set: Created 4 years, 3 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/scopes.h ('k') | src/compilation-info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index beb572114451214ef6ee12a4ddbb54347e78c314..ed38ab98f86fd2800d17f93009098553fc4f6ccc 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -7,6 +7,7 @@
#include <set>
#include "src/accessors.h"
+#include "src/ast/ast.h"
#include "src/bootstrapper.h"
#include "src/messages.h"
#include "src/parsing/parse-info.h"
@@ -840,6 +841,29 @@ Variable* Scope::DeclareVariable(
return var;
}
+VariableProxy* Scope::NewUnresolved(AstNodeFactory* factory,
+ const AstRawString* name,
+ int start_position, int end_position,
+ Variable::Kind kind) {
+ // Note that we must not share the unresolved variables with
+ // the same name because they may be removed selectively via
+ // RemoveUnresolved().
+ DCHECK(!already_resolved_);
+ DCHECK_EQ(factory->zone(), zone());
+ VariableProxy* proxy =
+ factory->NewVariableProxy(name, kind, start_position, end_position);
+ proxy->set_next_unresolved(unresolved_);
+ unresolved_ = proxy;
+ return proxy;
+}
+
+void Scope::AddUnresolved(VariableProxy* proxy) {
+ DCHECK(!already_resolved_);
+ DCHECK(!proxy->is_resolved());
+ proxy->set_next_unresolved(unresolved_);
+ unresolved_ = proxy;
+}
+
Variable* DeclarationScope::DeclareDynamicGlobal(const AstRawString* name,
Variable::Kind kind) {
DCHECK(is_script_scope());
« no previous file with comments | « src/ast/scopes.h ('k') | src/compilation-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698