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

Unified Diff: src/modules.cc

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 | « src/modules.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/modules.cc
diff --git a/src/modules.cc b/src/modules.cc
index 863443e627fbb670694d3a3c67415ad4a1ac8393..3d6aa2c789693419d937d19c97239f7953ca35c7 100644
--- a/src/modules.cc
+++ b/src/modules.cc
@@ -35,6 +35,15 @@ void ModuleDescriptor::AddLocalExport(const AstRawString* export_name,
}
+void ModuleDescriptor::AddModuleRequest(const AstRawString* module_specifier,
+ Zone* zone) {
+ // TODO(adamk): Avoid this O(N) operation on each insert by storing
+ // a HashMap, or by de-duping after parsing.
+ if (requested_modules_.Contains(module_specifier)) return;
+ requested_modules_.Add(module_specifier, zone);
+}
+
+
const AstRawString* ModuleDescriptor::LookupLocalExport(
const AstRawString* export_name, Zone* zone) {
if (exports_ == nullptr) return nullptr;
« no previous file with comments | « src/modules.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698