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

Unified Diff: src/ast/scopeinfo.cc

Issue 2473993002: [modules] Make handling of module info's regular exports more robust. (Closed)
Patch Set: cast size_t 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 | « src/ast/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopeinfo.cc
diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
index 316f01e05d86510a5654cde48cef6542dc5eac8f..1e3c1866a7ffa060877e21eeb159e45ce0524ff8 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -938,6 +938,27 @@ Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, Zone* zone,
return result;
}
+int ModuleInfo::RegularExportCount() const {
+ DCHECK_EQ(regular_exports()->length() % kRegularExportLength, 0);
+ return regular_exports()->length() / kRegularExportLength;
+}
+
+String* ModuleInfo::RegularExportLocalName(int i) const {
+ return String::cast(regular_exports()->get(i * kRegularExportLength +
+ kRegularExportLocalNameOffset));
+}
+
+int ModuleInfo::RegularExportCellIndex(int i) const {
+ return Smi::cast(regular_exports()->get(i * kRegularExportLength +
+ kRegularExportCellIndexOffset))
+ ->value();
+}
+
+FixedArray* ModuleInfo::RegularExportExportNames(int i) const {
+ return FixedArray::cast(regular_exports()->get(
+ i * kRegularExportLength + kRegularExportExportNamesOffset));
+}
+
Handle<ModuleInfoEntry> ModuleInfo::LookupRegularImport(
Handle<ModuleInfo> info, Handle<String> local_name) {
Isolate* isolate = info->GetIsolate();
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698