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

Unified Diff: src/ast/modules.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/modules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/modules.h
diff --git a/src/ast/modules.h b/src/ast/modules.h
index a303c699178871e5273103ece4d8e54be27d0571..94550fb5c99b439a89855b565555e773ab228246 100644
--- a/src/ast/modules.h
+++ b/src/ast/modules.h
@@ -86,10 +86,12 @@ class ModuleDescriptor : public ZoneObject {
int module_request;
// Import/export entries that are associated with a MODULE-allocated
- // variable use the cell_index value to encode the location of their cell.
- // Negative values are used for imports and positive values for exports.
- // For entries that are not associated with a MODULE-allocated variable,
- // cell_index is 0.
+ // variable (i.e. regular_imports and regular_exports after Validate) use
+ // the cell_index value to encode the location of their cell. During
+ // variable allocation, this will be be copied into the variable's index
+ // field.
+ // Entries that are not associated with a MODULE-allocated variable have
+ // GetCellIndexKind(cell_index) == kInvalid.
int cell_index;
// TODO(neis): Remove local_name component?
@@ -109,6 +111,9 @@ class ModuleDescriptor : public ZoneObject {
Handle<ModuleInfoEntry> entry);
};
+ enum CellIndexKind { kInvalid, kExport, kImport };
+ static CellIndexKind GetCellIndexKind(int cell_index);
+
// Module requests.
const ZoneMap<const AstRawString*, int>& module_requests() const {
return module_requests_;
« no previous file with comments | « no previous file | src/ast/modules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698