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

Side by Side Diff: src/ast/scopes.cc

Issue 2368613002: [modules] Simplify treatment of empty imports. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopeinfo.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 ModuleDescriptor::Entry::Deserialize(isolate, avfactory, 178 ModuleDescriptor::Entry::Deserialize(isolate, avfactory,
179 serialized_entry), 179 serialized_entry),
180 avfactory->zone()); 180 avfactory->zone());
181 } 181 }
182 182
183 // Deserialize regular exports. 183 // Deserialize regular exports.
184 Handle<FixedArray> regular_exports(module_info->regular_exports(), isolate); 184 Handle<FixedArray> regular_exports(module_info->regular_exports(), isolate);
185 module_descriptor_->DeserializeRegularExports(isolate, avfactory, 185 module_descriptor_->DeserializeRegularExports(isolate, avfactory,
186 regular_exports); 186 regular_exports);
187 187
188 // Deserialize special imports. 188 // Deserialize namespace imports.
189 Handle<FixedArray> special_imports(module_info->special_imports(), isolate); 189 Handle<FixedArray> namespace_imports(module_info->namespace_imports(),
190 for (int i = 0, n = special_imports->length(); i < n; ++i) { 190 isolate);
191 for (int i = 0, n = namespace_imports->length(); i < n; ++i) {
191 Handle<ModuleInfoEntry> serialized_entry( 192 Handle<ModuleInfoEntry> serialized_entry(
192 ModuleInfoEntry::cast(special_imports->get(i)), isolate); 193 ModuleInfoEntry::cast(namespace_imports->get(i)), isolate);
193 module_descriptor_->AddSpecialImport( 194 module_descriptor_->AddNamespaceImport(
194 ModuleDescriptor::Entry::Deserialize(isolate, avfactory, 195 ModuleDescriptor::Entry::Deserialize(isolate, avfactory,
195 serialized_entry), 196 serialized_entry),
196 avfactory->zone()); 197 avfactory->zone());
197 } 198 }
198 199
199 // Deserialize regular imports. 200 // Deserialize regular imports.
200 Handle<FixedArray> regular_imports(module_info->regular_imports(), isolate); 201 Handle<FixedArray> regular_imports(module_info->regular_imports(), isolate);
201 for (int i = 0, n = regular_imports->length(); i < n; ++i) { 202 for (int i = 0, n = regular_imports->length(); i < n; ++i) {
202 Handle<ModuleInfoEntry> serialized_entry( 203 Handle<ModuleInfoEntry> serialized_entry(
203 ModuleInfoEntry::cast(regular_imports->get(i)), isolate); 204 ModuleInfoEntry::cast(regular_imports->get(i)), isolate);
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 Variable* function = 1832 Variable* function =
1832 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; 1833 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr;
1833 bool is_function_var_in_context = 1834 bool is_function_var_in_context =
1834 function != nullptr && function->IsContextSlot(); 1835 function != nullptr && function->IsContextSlot();
1835 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - 1836 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS -
1836 (is_function_var_in_context ? 1 : 0); 1837 (is_function_var_in_context ? 1 : 0);
1837 } 1838 }
1838 1839
1839 } // namespace internal 1840 } // namespace internal
1840 } // namespace v8 1841 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopeinfo.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698