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

Unified Diff: src/ast/modules.cc

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: Disable module tests for deopt fuzzer. 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 | « src/ast/modules.h ('k') | src/ast/scopeinfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/modules.cc
diff --git a/src/ast/modules.cc b/src/ast/modules.cc
index f0cb18bc627be13d3fd251231f98dbf6b136431c..6d8f35f39048057944beb600d472ec64e296053f 100644
--- a/src/ast/modules.cc
+++ b/src/ast/modules.cc
@@ -87,27 +87,28 @@ const AstRawString* FromStringOrUndefined(Isolate* isolate,
} // namespace
-Handle<FixedArray> ModuleDescriptor::Entry::Serialize(Isolate* isolate) const {
- Handle<FixedArray> result = isolate->factory()->NewFixedArray(4);
- result->set(0, *ToStringOrUndefined(isolate, export_name));
- result->set(1, *ToStringOrUndefined(isolate, local_name));
- result->set(2, *ToStringOrUndefined(isolate, import_name));
- result->set(3, *ToStringOrUndefined(isolate, module_request));
- return result;
+Handle<ModuleInfoEntry> ModuleDescriptor::Entry::Serialize(
+ Isolate* isolate) const {
+ return ModuleInfoEntry::New(isolate,
+ ToStringOrUndefined(isolate, export_name),
+ ToStringOrUndefined(isolate, local_name),
+ ToStringOrUndefined(isolate, import_name),
+ ToStringOrUndefined(isolate, module_request));
}
ModuleDescriptor::Entry* ModuleDescriptor::Entry::Deserialize(
- Isolate* isolate, AstValueFactory* avfactory, Handle<FixedArray> data) {
- Entry* entry = new (avfactory->zone()) Entry(Scanner::Location::invalid());
- entry->export_name =
- FromStringOrUndefined(isolate, avfactory, handle(data->get(0), isolate));
- entry->local_name =
- FromStringOrUndefined(isolate, avfactory, handle(data->get(1), isolate));
- entry->import_name =
- FromStringOrUndefined(isolate, avfactory, handle(data->get(2), isolate));
- entry->module_request =
- FromStringOrUndefined(isolate, avfactory, handle(data->get(3), isolate));
- return entry;
+ Isolate* isolate, AstValueFactory* avfactory,
+ Handle<ModuleInfoEntry> entry) {
+ Entry* result = new (avfactory->zone()) Entry(Scanner::Location::invalid());
+ result->export_name = FromStringOrUndefined(
+ isolate, avfactory, handle(entry->export_name(), isolate));
+ result->local_name = FromStringOrUndefined(
+ isolate, avfactory, handle(entry->local_name(), isolate));
+ result->import_name = FromStringOrUndefined(
+ isolate, avfactory, handle(entry->import_name(), isolate));
+ result->module_request = FromStringOrUndefined(
+ isolate, avfactory, handle(entry->module_request(), isolate));
+ return result;
}
void ModuleDescriptor::MakeIndirectExportsExplicit(Zone* zone) {
« no previous file with comments | « src/ast/modules.h ('k') | src/ast/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698