| 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 #include "src/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 function_kind_(function_kind), | 145 function_kind_(function_kind), |
| 146 params_(4, zone), | 146 params_(4, zone), |
| 147 sloppy_block_function_map_(zone) { | 147 sloppy_block_function_map_(zone) { |
| 148 DCHECK_NE(scope_type, SCRIPT_SCOPE); | 148 DCHECK_NE(scope_type, SCRIPT_SCOPE); |
| 149 SetDefaults(); | 149 SetDefaults(); |
| 150 asm_function_ = outer_scope_->IsAsmModule(); | 150 asm_function_ = outer_scope_->IsAsmModule(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 ModuleScope::ModuleScope(DeclarationScope* script_scope, | 153 ModuleScope::ModuleScope(DeclarationScope* script_scope, |
| 154 AstValueFactory* ast_value_factory) | 154 AstValueFactory* ast_value_factory) |
| 155 : DeclarationScope(ast_value_factory->zone(), script_scope, MODULE_SCOPE, | 155 : DeclarationScope(ast_value_factory->zone(), script_scope, MODULE_SCOPE) { |
| 156 kModule) { | |
| 157 Zone* zone = ast_value_factory->zone(); | 156 Zone* zone = ast_value_factory->zone(); |
| 158 module_descriptor_ = new (zone) ModuleDescriptor(zone); | 157 module_descriptor_ = new (zone) ModuleDescriptor(zone); |
| 159 set_language_mode(STRICT); | 158 set_language_mode(STRICT); |
| 160 DeclareThis(ast_value_factory); | 159 DeclareThis(ast_value_factory); |
| 161 } | 160 } |
| 162 | 161 |
| 163 ModuleScope::ModuleScope(Isolate* isolate, Handle<ScopeInfo> scope_info, | 162 ModuleScope::ModuleScope(Isolate* isolate, Handle<ScopeInfo> scope_info, |
| 164 AstValueFactory* avfactory) | 163 AstValueFactory* avfactory) |
| 165 : DeclarationScope(avfactory->zone(), MODULE_SCOPE, scope_info) { | 164 : DeclarationScope(avfactory->zone(), MODULE_SCOPE, scope_info) { |
| 166 Zone* zone = avfactory->zone(); | 165 Zone* zone = avfactory->zone(); |
| (...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 Variable* function = | 1894 Variable* function = |
| 1896 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; | 1895 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; |
| 1897 bool is_function_var_in_context = | 1896 bool is_function_var_in_context = |
| 1898 function != nullptr && function->IsContextSlot(); | 1897 function != nullptr && function->IsContextSlot(); |
| 1899 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1898 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1900 (is_function_var_in_context ? 1 : 0); | 1899 (is_function_var_in_context ? 1 : 0); |
| 1901 } | 1900 } |
| 1902 | 1901 |
| 1903 } // namespace internal | 1902 } // namespace internal |
| 1904 } // namespace v8 | 1903 } // namespace v8 |
| OLD | NEW |