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/hashmap.h" | 8 #include "src/base/hashmap.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 // Convenience variable; function scopes only. | 848 // Convenience variable; function scopes only. |
849 Variable* arguments_; | 849 Variable* arguments_; |
850 // Convenience variable; Subclass constructor only | 850 // Convenience variable; Subclass constructor only |
851 Variable* this_function_; | 851 Variable* this_function_; |
852 }; | 852 }; |
853 | 853 |
854 class ModuleScope final : public DeclarationScope { | 854 class ModuleScope final : public DeclarationScope { |
855 public: | 855 public: |
856 ModuleScope(DeclarationScope* script_scope, | 856 ModuleScope(DeclarationScope* script_scope, |
857 AstValueFactory* ast_value_factory); | 857 AstValueFactory* ast_value_factory); |
| 858 |
| 859 // Deserialization. |
| 860 // The generated ModuleDescriptor does not preserve all information. In |
| 861 // particular, its module_requests map will be empty because we no longer need |
| 862 // the map after parsing. |
858 ModuleScope(Isolate* isolate, Handle<ScopeInfo> scope_info, | 863 ModuleScope(Isolate* isolate, Handle<ScopeInfo> scope_info, |
859 AstValueFactory* ast_value_factory); | 864 AstValueFactory* ast_value_factory); |
860 | 865 |
861 ModuleDescriptor* module() const { | 866 ModuleDescriptor* module() const { |
862 DCHECK_NOT_NULL(module_descriptor_); | 867 DCHECK_NOT_NULL(module_descriptor_); |
863 return module_descriptor_; | 868 return module_descriptor_; |
864 } | 869 } |
865 | 870 |
866 // Set MODULE as VariableLocation for all variables that will live in some | 871 // Set MODULE as VariableLocation for all variables that will live in some |
867 // module's export table. | 872 // module's export table. |
868 void AllocateModuleVariables(); | 873 void AllocateModuleVariables(); |
869 | 874 |
870 private: | 875 private: |
871 ModuleDescriptor* module_descriptor_; | 876 ModuleDescriptor* module_descriptor_; |
872 }; | 877 }; |
873 | 878 |
874 } // namespace internal | 879 } // namespace internal |
875 } // namespace v8 | 880 } // namespace v8 |
876 | 881 |
877 #endif // V8_AST_SCOPES_H_ | 882 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |