| 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 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 } | 1653 } |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 array->set_elements(*elms); | 1656 array->set_elements(*elms); |
| 1657 array->set_length(Smi::FromInt(length)); | 1657 array->set_length(Smi::FromInt(length)); |
| 1658 } | 1658 } |
| 1659 | 1659 |
| 1660 | 1660 |
| 1661 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( | 1661 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
| 1662 Handle<JSFunction> function) { | 1662 Handle<JSFunction> function) { |
| 1663 DCHECK(function->shared()->is_generator()); | 1663 DCHECK(function->shared()->is_generator() || function->shared()->is_async()); |
| 1664 JSFunction::EnsureHasInitialMap(function); | 1664 JSFunction::EnsureHasInitialMap(function); |
| 1665 Handle<Map> map(function->initial_map()); | 1665 Handle<Map> map(function->initial_map()); |
| 1666 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); | 1666 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); |
| 1667 CALL_HEAP_FUNCTION( | 1667 CALL_HEAP_FUNCTION( |
| 1668 isolate(), | 1668 isolate(), |
| 1669 isolate()->heap()->AllocateJSObjectFromMap(*map), | 1669 isolate()->heap()->AllocateJSObjectFromMap(*map), |
| 1670 JSGeneratorObject); | 1670 JSGeneratorObject); |
| 1671 } | 1671 } |
| 1672 | 1672 |
| 1673 | 1673 |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 } | 2371 } |
| 2372 | 2372 |
| 2373 | 2373 |
| 2374 Handle<Object> Factory::ToBoolean(bool value) { | 2374 Handle<Object> Factory::ToBoolean(bool value) { |
| 2375 return value ? true_value() : false_value(); | 2375 return value ? true_value() : false_value(); |
| 2376 } | 2376 } |
| 2377 | 2377 |
| 2378 | 2378 |
| 2379 } // namespace internal | 2379 } // namespace internal |
| 2380 } // namespace v8 | 2380 } // namespace v8 |
| OLD | NEW |