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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 CALL_HEAP_FUNCTION( | 1809 CALL_HEAP_FUNCTION( |
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->regular_exports()->length()); | 1819 ObjectHashTable::New(isolate(), module_info->RegularExportCount()); |
1820 int requested_modules_length = module_info->module_requests()->length(); | 1820 int requested_modules_length = module_info->module_requests()->length(); |
1821 Handle<FixedArray> requested_modules = | 1821 Handle<FixedArray> requested_modules = |
1822 requested_modules_length > 0 ? NewFixedArray(requested_modules_length) | 1822 requested_modules_length > 0 ? NewFixedArray(requested_modules_length) |
1823 : empty_fixed_array(); | 1823 : empty_fixed_array(); |
1824 | 1824 |
1825 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); | 1825 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); |
1826 module->set_code(*code); | 1826 module->set_code(*code); |
1827 module->set_exports(*exports); | 1827 module->set_exports(*exports); |
1828 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); | 1828 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); |
1829 module->set_module_namespace(isolate()->heap()->undefined_value()); | 1829 module->set_module_namespace(isolate()->heap()->undefined_value()); |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2702 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); | 2702 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); |
2703 iterator->set_initial_next(*next); | 2703 iterator->set_initial_next(*next); |
2704 iterator->set_array(*array); | 2704 iterator->set_array(*array); |
2705 iterator->set_index(0); | 2705 iterator->set_index(0); |
2706 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); | 2706 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); |
2707 return iterator; | 2707 return iterator; |
2708 } | 2708 } |
2709 | 2709 |
2710 } // namespace internal | 2710 } // namespace internal |
2711 } // namespace v8 | 2711 } // namespace v8 |
OLD | NEW |