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

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

Issue 2465283004: [modules] Maintain array of cells for imports and local exports. (Closed)
Patch Set: Rename parameter also in header file. Created 4 years, 1 month 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/modules.h ('k') | src/debug/debug-scopes.cc » ('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/modules.h" 5 #include "src/ast/modules.h"
6 #include "src/ast/ast-value-factory.h" 6 #include "src/ast/ast-value-factory.h"
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 entry->location = import->second->location; 205 entry->location = import->second->location;
206 entry->local_name = nullptr; 206 entry->local_name = nullptr;
207 AddSpecialExport(entry, zone); 207 AddSpecialExport(entry, zone);
208 it = regular_exports_.erase(it); 208 it = regular_exports_.erase(it);
209 } else { 209 } else {
210 it++; 210 it++;
211 } 211 }
212 } 212 }
213 } 213 }
214 214
215 ModuleDescriptor::CellIndexKind ModuleDescriptor::GetCellIndexKind(
216 int cell_index) {
217 if (cell_index > 0) return kExport;
218 if (cell_index < 0) return kImport;
219 return kInvalid;
220 }
221
215 void ModuleDescriptor::AssignCellIndices() { 222 void ModuleDescriptor::AssignCellIndices() {
216 int export_index = 1; 223 int export_index = 1;
217 for (auto it = regular_exports_.begin(); it != regular_exports_.end();) { 224 for (auto it = regular_exports_.begin(); it != regular_exports_.end();) {
218 auto current_key = it->first; 225 auto current_key = it->first;
219 // This local name may be exported under multiple export names. Assign the 226 // This local name may be exported under multiple export names. Assign the
220 // same index to each such entry. 227 // same index to each such entry.
221 do { 228 do {
222 Entry* entry = it->second; 229 Entry* entry = it->second;
223 DCHECK_NOT_NULL(entry->local_name); 230 DCHECK_NOT_NULL(entry->local_name);
224 DCHECK_NULL(entry->import_name); 231 DCHECK_NULL(entry->import_name);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 314 }
308 } 315 }
309 316
310 MakeIndirectExportsExplicit(zone); 317 MakeIndirectExportsExplicit(zone);
311 AssignCellIndices(); 318 AssignCellIndices();
312 return true; 319 return true;
313 } 320 }
314 321
315 } // namespace internal 322 } // namespace internal
316 } // namespace v8 323 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/modules.h ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698