OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 isolate(), | 1810 isolate(), |
1811 isolate()->heap()->AllocateJSObjectFromMap(*map), | 1811 isolate()->heap()->AllocateJSObjectFromMap(*map), |
1812 JSGeneratorObject); | 1812 JSGeneratorObject); |
1813 } | 1813 } |
1814 | 1814 |
1815 Handle<Module> Factory::NewModule(Handle<SharedFunctionInfo> code) { | 1815 Handle<Module> Factory::NewModule(Handle<SharedFunctionInfo> code) { |
1816 Handle<ModuleInfo> module_info(code->scope_info()->ModuleDescriptorInfo(), | 1816 Handle<ModuleInfo> module_info(code->scope_info()->ModuleDescriptorInfo(), |
1817 isolate()); | 1817 isolate()); |
1818 Handle<ObjectHashTable> exports = | 1818 Handle<ObjectHashTable> exports = |
1819 ObjectHashTable::New(isolate(), module_info->RegularExportCount()); | 1819 ObjectHashTable::New(isolate(), module_info->RegularExportCount()); |
| 1820 Handle<FixedArray> regular_exports = |
| 1821 NewFixedArray(module_info->RegularExportCount()); |
| 1822 Handle<FixedArray> regular_imports = |
| 1823 NewFixedArray(module_info->regular_imports()->length()); |
1820 int requested_modules_length = module_info->module_requests()->length(); | 1824 int requested_modules_length = module_info->module_requests()->length(); |
1821 Handle<FixedArray> requested_modules = | 1825 Handle<FixedArray> requested_modules = |
1822 requested_modules_length > 0 ? NewFixedArray(requested_modules_length) | 1826 requested_modules_length > 0 ? NewFixedArray(requested_modules_length) |
1823 : empty_fixed_array(); | 1827 : empty_fixed_array(); |
1824 | 1828 |
1825 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); | 1829 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); |
1826 module->set_code(*code); | 1830 module->set_code(*code); |
1827 module->set_exports(*exports); | 1831 module->set_exports(*exports); |
| 1832 module->set_regular_exports(*regular_exports); |
| 1833 module->set_regular_imports(*regular_imports); |
1828 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); | 1834 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); |
1829 module->set_module_namespace(isolate()->heap()->undefined_value()); | 1835 module->set_module_namespace(isolate()->heap()->undefined_value()); |
1830 module->set_requested_modules(*requested_modules); | 1836 module->set_requested_modules(*requested_modules); |
1831 DCHECK(!module->instantiated()); | 1837 DCHECK(!module->instantiated()); |
1832 DCHECK(!module->evaluated()); | 1838 DCHECK(!module->evaluated()); |
1833 return module; | 1839 return module; |
1834 } | 1840 } |
1835 | 1841 |
1836 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, | 1842 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, |
1837 PretenureFlag pretenure) { | 1843 PretenureFlag pretenure) { |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2701 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); | 2707 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); |
2702 iterator->set_initial_next(*next); | 2708 iterator->set_initial_next(*next); |
2703 iterator->set_array(*array); | 2709 iterator->set_array(*array); |
2704 iterator->set_index(0); | 2710 iterator->set_index(0); |
2705 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); | 2711 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); |
2706 return iterator; | 2712 return iterator; |
2707 } | 2713 } |
2708 | 2714 |
2709 } // namespace internal | 2715 } // namespace internal |
2710 } // namespace v8 | 2716 } // namespace v8 |
OLD | NEW |