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/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 array->set_elements(*elms); | 1646 array->set_elements(*elms); |
1647 array->set_length(Smi::FromInt(length)); | 1647 array->set_length(Smi::FromInt(length)); |
1648 } | 1648 } |
1649 | 1649 |
1650 | 1650 |
1651 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( | 1651 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
1652 Handle<JSFunction> function) { | 1652 Handle<JSFunction> function) { |
1653 DCHECK(function->shared()->is_generator()); | 1653 DCHECK(function->shared()->is_generator()); |
1654 JSFunction::EnsureHasInitialMap(function); | 1654 JSFunction::EnsureHasInitialMap(function); |
1655 Handle<Map> map(function->initial_map()); | 1655 Handle<Map> map(function->initial_map()); |
1656 DCHECK(map->instance_type() == JS_GENERATOR_OBJECT_TYPE); | 1656 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); |
1657 CALL_HEAP_FUNCTION( | 1657 CALL_HEAP_FUNCTION( |
1658 isolate(), | 1658 isolate(), |
1659 isolate()->heap()->AllocateJSObjectFromMap(*map), | 1659 isolate()->heap()->AllocateJSObjectFromMap(*map), |
1660 JSGeneratorObject); | 1660 JSGeneratorObject); |
1661 } | 1661 } |
1662 | 1662 |
1663 | 1663 |
1664 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, | 1664 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, |
1665 PretenureFlag pretenure) { | 1665 PretenureFlag pretenure) { |
1666 Handle<JSFunction> array_buffer_fun( | 1666 Handle<JSFunction> array_buffer_fun( |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2326 } | 2326 } |
2327 | 2327 |
2328 | 2328 |
2329 Handle<Object> Factory::ToBoolean(bool value) { | 2329 Handle<Object> Factory::ToBoolean(bool value) { |
2330 return value ? true_value() : false_value(); | 2330 return value ? true_value() : false_value(); |
2331 } | 2331 } |
2332 | 2332 |
2333 | 2333 |
2334 } // namespace internal | 2334 } // namespace internal |
2335 } // namespace v8 | 2335 } // namespace v8 |
OLD | NEW |