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

Side by Side Diff: src/factory.cc

Issue 2473993002: [modules] Make handling of module info's regular exports more robust. (Closed)
Patch Set: cast size_t Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698