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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 } | 860 } |
861 | 861 |
862 PrintF("}\n"); | 862 PrintF("}\n"); |
863 } | 863 } |
864 #endif // DEBUG | 864 #endif // DEBUG |
865 | 865 |
866 Handle<ModuleInfoEntry> ModuleInfoEntry::New(Isolate* isolate, | 866 Handle<ModuleInfoEntry> ModuleInfoEntry::New(Isolate* isolate, |
867 Handle<Object> export_name, | 867 Handle<Object> export_name, |
868 Handle<Object> local_name, | 868 Handle<Object> local_name, |
869 Handle<Object> import_name, | 869 Handle<Object> import_name, |
870 Handle<Object> module_request) { | 870 Handle<Object> module_request, |
| 871 int beg_pos, int end_pos) { |
871 Handle<ModuleInfoEntry> result = isolate->factory()->NewModuleInfoEntry(); | 872 Handle<ModuleInfoEntry> result = isolate->factory()->NewModuleInfoEntry(); |
872 result->set(kExportNameIndex, *export_name); | 873 result->set(kExportNameIndex, *export_name); |
873 result->set(kLocalNameIndex, *local_name); | 874 result->set(kLocalNameIndex, *local_name); |
874 result->set(kImportNameIndex, *import_name); | 875 result->set(kImportNameIndex, *import_name); |
875 result->set(kModuleRequestIndex, *module_request); | 876 result->set(kModuleRequestIndex, *module_request); |
| 877 result->set(kBegPosIndex, Smi::FromInt(beg_pos)); |
| 878 result->set(kEndPosIndex, Smi::FromInt(end_pos)); |
876 return result; | 879 return result; |
877 } | 880 } |
878 | 881 |
879 Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, Zone* zone, | 882 Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, Zone* zone, |
880 ModuleDescriptor* descr) { | 883 ModuleDescriptor* descr) { |
881 // Serialize module requests. | 884 // Serialize module requests. |
882 Handle<FixedArray> module_requests = isolate->factory()->NewFixedArray( | 885 Handle<FixedArray> module_requests = isolate->factory()->NewFixedArray( |
883 static_cast<int>(descr->module_requests().size())); | 886 static_cast<int>(descr->module_requests().size())); |
884 for (const auto& elem : descr->module_requests()) { | 887 for (const auto& elem : descr->module_requests()) { |
885 module_requests->set(elem.second, *elem.first->string()); | 888 module_requests->set(elem.second, *elem.first->string()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 if (String::cast(entry->local_name())->Equals(*local_name)) { | 945 if (String::cast(entry->local_name())->Equals(*local_name)) { |
943 return entry; | 946 return entry; |
944 } | 947 } |
945 } | 948 } |
946 UNREACHABLE(); | 949 UNREACHABLE(); |
947 return Handle<ModuleInfoEntry>(); | 950 return Handle<ModuleInfoEntry>(); |
948 } | 951 } |
949 | 952 |
950 } // namespace internal | 953 } // namespace internal |
951 } // namespace v8 | 954 } // namespace v8 |
OLD | NEW |