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

Unified Diff: src/ast/scopeinfo.cc

Issue 2357003002: [modules] Also (de-)serialize imports. (Closed)
Patch Set: Created 4 years, 3 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/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 d1fc6c2d4347615d5ef34712b3fb91489148a5b7..63bc6cca68b4a3d30f03820136e681b627e6060d 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -870,6 +870,16 @@ Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
}
}
+ // Serialize special imports.
+ Handle<FixedArray> special_imports =
+ isolate->factory()->NewFixedArray(descr->special_imports().length());
+ {
+ int i = 0;
+ for (auto entry : descr->special_imports()) {
+ special_imports->set(i++, *entry->Serialize(isolate));
+ }
+ }
+
// Serialize regular exports.
Handle<FixedArray> regular_exports = isolate->factory()->NewFixedArray(
static_cast<int>(descr->regular_exports().size()));
@@ -880,10 +890,22 @@ Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
}
}
+ // Serialize regular imports.
+ Handle<FixedArray> regular_imports = isolate->factory()->NewFixedArray(
+ static_cast<int>(descr->regular_imports().size()));
+ {
+ int i = 0;
+ for (const auto& elem : descr->regular_imports()) {
+ regular_imports->set(i++, *elem.second->Serialize(isolate));
+ }
+ }
+
Handle<ModuleInfo> result = isolate->factory()->NewModuleInfo();
result->set(kModuleRequestsIndex, *module_requests);
result->set(kSpecialExportsIndex, *special_exports);
result->set(kRegularExportsIndex, *regular_exports);
+ result->set(kSpecialImportsIndex, *special_imports);
+ result->set(kRegularImportsIndex, *regular_imports);
return result;
}
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698