OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_AST_SCOPES_H_ | 5 #ifndef V8_AST_SCOPES_H_ |
6 #define V8_AST_SCOPES_H_ | 6 #define V8_AST_SCOPES_H_ |
7 | 7 |
8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 MaybeHandle<ScopeInfo> outer_scope); | 548 MaybeHandle<ScopeInfo> outer_scope); |
549 | 549 |
550 // Construct a scope based on the scope info. | 550 // Construct a scope based on the scope info. |
551 Scope(Zone* zone, ScopeType type, Handle<ScopeInfo> scope_info); | 551 Scope(Zone* zone, ScopeType type, Handle<ScopeInfo> scope_info); |
552 | 552 |
553 // Construct a catch scope with a binding for the name. | 553 // Construct a catch scope with a binding for the name. |
554 Scope(Zone* zone, const AstRawString* catch_variable_name, | 554 Scope(Zone* zone, const AstRawString* catch_variable_name, |
555 Handle<ScopeInfo> scope_info); | 555 Handle<ScopeInfo> scope_info); |
556 | 556 |
557 void AddInnerScope(Scope* inner_scope) { | 557 void AddInnerScope(Scope* inner_scope) { |
558 DCHECK_EQ(!needs_migration_, inner_scope->zone() == zone()); | |
559 inner_scope->sibling_ = inner_scope_; | 558 inner_scope->sibling_ = inner_scope_; |
560 inner_scope_ = inner_scope; | 559 inner_scope_ = inner_scope; |
561 inner_scope->outer_scope_ = this; | 560 inner_scope->outer_scope_ = this; |
562 } | 561 } |
563 | 562 |
564 void RemoveInnerScope(Scope* inner_scope) { | 563 void RemoveInnerScope(Scope* inner_scope) { |
565 DCHECK_NOT_NULL(inner_scope); | 564 DCHECK_NOT_NULL(inner_scope); |
566 if (inner_scope == inner_scope_) { | 565 if (inner_scope == inner_scope_) { |
567 inner_scope_ = inner_scope_->sibling_; | 566 inner_scope_ = inner_scope_->sibling_; |
568 return; | 567 return; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 void AllocateModuleVariables(); | 857 void AllocateModuleVariables(); |
859 | 858 |
860 private: | 859 private: |
861 ModuleDescriptor* module_descriptor_; | 860 ModuleDescriptor* module_descriptor_; |
862 }; | 861 }; |
863 | 862 |
864 } // namespace internal | 863 } // namespace internal |
865 } // namespace v8 | 864 } // namespace v8 |
866 | 865 |
867 #endif // V8_AST_SCOPES_H_ | 866 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |