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 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 } else { | 1728 } else { |
1729 DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); | 1729 DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
1730 elms = NewFixedArrayWithHoles(capacity); | 1730 elms = NewFixedArrayWithHoles(capacity); |
1731 } | 1731 } |
1732 } | 1732 } |
1733 | 1733 |
1734 array->set_elements(*elms); | 1734 array->set_elements(*elms); |
1735 array->set_length(Smi::FromInt(length)); | 1735 array->set_length(Smi::FromInt(length)); |
1736 } | 1736 } |
1737 | 1737 |
| 1738 Handle<JSModuleNamespace> Factory::NewJSModuleNamespace() { |
| 1739 Handle<Map> map = isolate()->js_module_namespace_map(); |
| 1740 return Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map)); |
| 1741 } |
1738 | 1742 |
1739 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( | 1743 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
1740 Handle<JSFunction> function) { | 1744 Handle<JSFunction> function) { |
1741 DCHECK(IsResumableFunction(function->shared()->kind())); | 1745 DCHECK(IsResumableFunction(function->shared()->kind())); |
1742 JSFunction::EnsureHasInitialMap(function); | 1746 JSFunction::EnsureHasInitialMap(function); |
1743 Handle<Map> map(function->initial_map()); | 1747 Handle<Map> map(function->initial_map()); |
1744 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); | 1748 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); |
1745 CALL_HEAP_FUNCTION( | 1749 CALL_HEAP_FUNCTION( |
1746 isolate(), | 1750 isolate(), |
1747 isolate()->heap()->AllocateJSObjectFromMap(*map), | 1751 isolate()->heap()->AllocateJSObjectFromMap(*map), |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 Handle<AccessorInfo> prototype = | 2607 Handle<AccessorInfo> prototype = |
2604 Accessors::FunctionPrototypeInfo(isolate(), attribs); | 2608 Accessors::FunctionPrototypeInfo(isolate(), attribs); |
2605 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 2609 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
2606 prototype, attribs); | 2610 prototype, attribs); |
2607 map->AppendDescriptor(&d); | 2611 map->AppendDescriptor(&d); |
2608 } | 2612 } |
2609 } | 2613 } |
2610 | 2614 |
2611 } // namespace internal | 2615 } // namespace internal |
2612 } // namespace v8 | 2616 } // namespace v8 |
OLD | NEW |