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

Unified Diff: src/modules.h

Issue 1078903002: Collect list of requested modules in ModuleDescriptor while parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/modules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/modules.h
diff --git a/src/modules.h b/src/modules.h
index 7dd7e26716bbbdab086ba1ecb064f3773d5afe2c..33afd6128d39efeddae014f49f31bee47ea4c7f3 100644
--- a/src/modules.h
+++ b/src/modules.h
@@ -20,7 +20,7 @@ class ModuleDescriptor : public ZoneObject {
// Factory methods.
static ModuleDescriptor* New(Zone* zone) {
- return new (zone) ModuleDescriptor();
+ return new (zone) ModuleDescriptor(zone);
}
// ---------------------------------------------------------------------------
@@ -31,6 +31,10 @@ class ModuleDescriptor : public ZoneObject {
void AddLocalExport(const AstRawString* export_name,
const AstRawString* local_name, Zone* zone, bool* ok);
+ // Add module_specifier to the list of requested modules,
+ // if not already present.
+ void AddModuleRequest(const AstRawString* module_specifier, Zone* zone);
+
// Do not allow any further refinements, directly or through unification.
void Freeze() { frozen_ = true; }
@@ -61,6 +65,10 @@ class ModuleDescriptor : public ZoneObject {
const AstRawString* LookupLocalExport(const AstRawString* export_name,
Zone* zone);
+ const ZoneList<const AstRawString*>& requested_modules() const {
+ return requested_modules_;
+ }
+
// ---------------------------------------------------------------------------
// Iterators.
@@ -95,11 +103,16 @@ class ModuleDescriptor : public ZoneObject {
// ---------------------------------------------------------------------------
// Implementation.
private:
+ explicit ModuleDescriptor(Zone* zone)
+ : frozen_(false),
+ exports_(NULL),
+ requested_modules_(1, zone),
+ index_(-1) {}
+
bool frozen_;
ZoneHashMap* exports_; // Module exports and their types (allocated lazily)
+ ZoneList<const AstRawString*> requested_modules_;
int index_;
-
- ModuleDescriptor() : frozen_(false), exports_(NULL), index_(-1) {}
};
} } // namespace v8::internal
« no previous file with comments | « no previous file | src/modules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698