Chromium Code Reviews| Index: src/ast/modules.h |
| diff --git a/src/ast/modules.h b/src/ast/modules.h |
| index dcb5132bd59fa5a1d6eb9ab372429389de6aaef4..ff1ae5a8026b2b6cdc9bb02dd863edb2c85d3fec 100644 |
| --- a/src/ast/modules.h |
| +++ b/src/ast/modules.h |
| @@ -82,6 +82,7 @@ class ModuleDescriptor : public ZoneObject { |
| // module specifiers and into the Module's array of requested modules. A |
| // negative value means no module request. |
| int module_request; |
| + int cell_index; |
|
adamk
2016/10/31 18:25:04
Maybe add a comment here too, especially since 0 i
neis
2016/11/03 10:43:48
Done.
|
| // TODO(neis): Remove local_name component? |
| explicit Entry(Scanner::Location loc) |
| @@ -89,7 +90,8 @@ class ModuleDescriptor : public ZoneObject { |
| export_name(nullptr), |
| local_name(nullptr), |
| import_name(nullptr), |
| - module_request(-1) {} |
| + module_request(-1), |
| + cell_index(0) {} |
| // (De-)serialization support. |
| // Note that the location value is not preserved as it's only needed by the |
| @@ -110,7 +112,7 @@ class ModuleDescriptor : public ZoneObject { |
| } |
| // All the remaining imports, indexed by local name. |
| - const ZoneMap<const AstRawString*, const Entry*>& regular_imports() const { |
| + const ZoneMap<const AstRawString*, Entry*>& regular_imports() const { |
| return regular_imports_; |
| } |
| @@ -139,7 +141,7 @@ class ModuleDescriptor : public ZoneObject { |
| special_exports_.Add(entry, zone); |
| } |
| - void AddRegularImport(const Entry* entry) { |
| + void AddRegularImport(Entry* entry) { |
| DCHECK_NOT_NULL(entry->import_name); |
| DCHECK_NOT_NULL(entry->local_name); |
| DCHECK_NULL(entry->export_name); |
| @@ -168,7 +170,7 @@ class ModuleDescriptor : public ZoneObject { |
| ZoneList<const Entry*> special_exports_; |
| ZoneList<const Entry*> namespace_imports_; |
| ZoneMultimap<const AstRawString*, Entry*> regular_exports_; |
| - ZoneMap<const AstRawString*, const Entry*> regular_imports_; |
| + ZoneMap<const AstRawString*, Entry*> regular_imports_; |
| // If there are multiple export entries with the same export name, return the |
| // last of them (in source order). Otherwise return nullptr. |
| @@ -192,6 +194,8 @@ class ModuleDescriptor : public ZoneObject { |
| // (The import entry is never deleted.) |
| void MakeIndirectExportsExplicit(Zone* zone); |
| + void AssignCellIndices(); |
|
adamk
2016/10/31 18:25:04
Please give this a comment: how are cell indices a
neis
2016/11/03 10:43:48
Done.
|
| + |
| int AddModuleRequest(const AstRawString* specifier) { |
| DCHECK_NOT_NULL(specifier); |
| auto it = module_requests_ |