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

Unified Diff: src/ast/scopes.h

Issue 2368313002: Don't use different function scopes when parsing with temp zones (Closed)
Patch Set: Make sure arguments_ is properly analyzed as well, since it's used as a signal for optimization 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 | « 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 27b4e416842f62f5f87786e4778838b86ac657cb..ae21595d8a20c5dd2f16a717406b804a9a85fa86 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -74,6 +74,7 @@ class Scope: public ZoneObject {
void SetScopeName(const AstRawString* scope_name) {
scope_name_ = scope_name;
}
+ void set_needs_migration() { needs_migration_ = true; }
#endif
// TODO(verwaest): Is this needed on Scope?
@@ -415,9 +416,7 @@ class Scope: public ZoneObject {
void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; }
bool is_debug_evaluate_scope() const { return is_debug_evaluate_scope_; }
- void set_is_lazily_parsed(bool is_lazily_parsed) {
- is_lazily_parsed_ = is_lazily_parsed;
- }
+ bool is_lazily_parsed() const { return is_lazily_parsed_; }
protected:
explicit Scope(Zone* zone);
@@ -485,7 +484,10 @@ class Scope: public ZoneObject {
// True if it doesn't need scope resolution (e.g., if the scope was
// constructed based on a serialized scope info or a catch context).
- bool already_resolved_ : 1;
+ bool already_resolved_;
+ // True if this scope may contain objects from a temp zone that needs to be
+ // fixed up.
+ bool needs_migration_;
#endif
// Source positions.
@@ -566,6 +568,7 @@ class Scope: public ZoneObject {
Handle<ScopeInfo> scope_info);
void AddInnerScope(Scope* inner_scope) {
+ DCHECK_EQ(!needs_migration_, inner_scope->zone() == zone());
inner_scope->sibling_ = inner_scope_;
inner_scope_ = inner_scope;
inner_scope->outer_scope_ = this;
@@ -779,8 +782,7 @@ class DeclarationScope : public Scope {
// records variables which cannot be resolved inside the Scope (we don't yet
// know what they will resolve to since the outer Scopes are incomplete) and
// migrates them into migrate_to.
- void AnalyzePartially(DeclarationScope* migrate_to,
- AstNodeFactory* ast_node_factory);
+ void AnalyzePartially(AstNodeFactory* ast_node_factory);
Handle<StringSet> CollectNonLocals(ParseInfo* info,
Handle<StringSet> non_locals);
« 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