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

Unified Diff: src/ast/modules.h

Issue 2465283004: [modules] Maintain array of cells for imports and local exports. (Closed)
Patch Set: Various changes. 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') | src/objects.h » ('J')
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..a62b6af29afd75e160081c4bb1f52aae8228dace 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
+ // cell_index_kind(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 cell_index_kind(int cell_index);
adamk 2016/11/03 18:30:45 The underscore naming for a static method looks a
neis 2016/11/04 10:14:39 Done.
+
// 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') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698