Chromium Code Reviews| Index: src/ast/scopes.h |
| diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
| index 27b4e416842f62f5f87786e4778838b86ac657cb..22583b9b51916c7a3172f21a9b54d61943215536 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); |
| @@ -486,6 +485,9 @@ 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; |
| + // True if this scope may contain objects from a temp zone that needs to be |
| + // fixed up. |
| + bool needs_migration_ : 1; |
|
adamk
2016/09/27 20:33:17
Can we remove these ": 1"s from these debug-only f
|
| #endif |
| // Source positions. |
| @@ -566,6 +568,7 @@ class Scope: public ZoneObject { |
| Handle<ScopeInfo> scope_info); |
| void AddInnerScope(Scope* inner_scope) { |
| + DCHECK(!needs_migration_ || inner_scope->zone() != zone()); |
|
marja
2016/09/27 18:54:41
Hmm? Why not DCHECK(needs_migration_ || inner_scop
|
| 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); |