OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "src/ast/context-slot-cache.h" | 7 #include "src/ast/context-slot-cache.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/ast/variables.h" | 9 #include "src/ast/variables.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 // Serialize special exports. | 863 // Serialize special exports. |
864 Handle<FixedArray> special_exports = | 864 Handle<FixedArray> special_exports = |
865 isolate->factory()->NewFixedArray(descr->special_exports().length()); | 865 isolate->factory()->NewFixedArray(descr->special_exports().length()); |
866 { | 866 { |
867 int i = 0; | 867 int i = 0; |
868 for (auto entry : descr->special_exports()) { | 868 for (auto entry : descr->special_exports()) { |
869 special_exports->set(i++, *entry->Serialize(isolate)); | 869 special_exports->set(i++, *entry->Serialize(isolate)); |
870 } | 870 } |
871 } | 871 } |
872 | 872 |
| 873 // Serialize special imports. |
| 874 Handle<FixedArray> special_imports = |
| 875 isolate->factory()->NewFixedArray(descr->special_imports().length()); |
| 876 { |
| 877 int i = 0; |
| 878 for (auto entry : descr->special_imports()) { |
| 879 special_imports->set(i++, *entry->Serialize(isolate)); |
| 880 } |
| 881 } |
| 882 |
873 // Serialize regular exports. | 883 // Serialize regular exports. |
874 Handle<FixedArray> regular_exports = isolate->factory()->NewFixedArray( | 884 Handle<FixedArray> regular_exports = isolate->factory()->NewFixedArray( |
875 static_cast<int>(descr->regular_exports().size())); | 885 static_cast<int>(descr->regular_exports().size())); |
876 { | 886 { |
877 int i = 0; | 887 int i = 0; |
878 for (const auto& elem : descr->regular_exports()) { | 888 for (const auto& elem : descr->regular_exports()) { |
879 regular_exports->set(i++, *elem.second->Serialize(isolate)); | 889 regular_exports->set(i++, *elem.second->Serialize(isolate)); |
880 } | 890 } |
881 } | 891 } |
882 | 892 |
| 893 // Serialize regular imports. |
| 894 Handle<FixedArray> regular_imports = isolate->factory()->NewFixedArray( |
| 895 static_cast<int>(descr->regular_imports().size())); |
| 896 { |
| 897 int i = 0; |
| 898 for (const auto& elem : descr->regular_imports()) { |
| 899 regular_imports->set(i++, *elem.second->Serialize(isolate)); |
| 900 } |
| 901 } |
| 902 |
883 Handle<ModuleInfo> result = isolate->factory()->NewModuleInfo(); | 903 Handle<ModuleInfo> result = isolate->factory()->NewModuleInfo(); |
884 result->set(kModuleRequestsIndex, *module_requests); | 904 result->set(kModuleRequestsIndex, *module_requests); |
885 result->set(kSpecialExportsIndex, *special_exports); | 905 result->set(kSpecialExportsIndex, *special_exports); |
886 result->set(kRegularExportsIndex, *regular_exports); | 906 result->set(kRegularExportsIndex, *regular_exports); |
| 907 result->set(kSpecialImportsIndex, *special_imports); |
| 908 result->set(kRegularImportsIndex, *regular_imports); |
887 return result; | 909 return result; |
888 } | 910 } |
889 | 911 |
890 } // namespace internal | 912 } // namespace internal |
891 } // namespace v8 | 913 } // namespace v8 |
OLD | NEW |