| 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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 | 1730 |
| 1731 | 1731 |
| 1732 Handle<JSSetIterator> Factory::NewJSSetIterator() { | 1732 Handle<JSSetIterator> Factory::NewJSSetIterator() { |
| 1733 Handle<Map> map(isolate()->native_context()->set_iterator_map()); | 1733 Handle<Map> map(isolate()->native_context()->set_iterator_map()); |
| 1734 CALL_HEAP_FUNCTION(isolate(), | 1734 CALL_HEAP_FUNCTION(isolate(), |
| 1735 isolate()->heap()->AllocateJSObjectFromMap(*map), | 1735 isolate()->heap()->AllocateJSObjectFromMap(*map), |
| 1736 JSSetIterator); | 1736 JSSetIterator); |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 | 1739 |
| 1740 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value, | |
| 1741 Handle<Object> done) { | |
| 1742 Handle<JSIteratorResult> result = Handle<JSIteratorResult>::cast( | |
| 1743 NewJSObjectFromMap(isolate()->iterator_result_map())); | |
| 1744 result->set_value(*value); | |
| 1745 result->set_done(*done); | |
| 1746 return result; | |
| 1747 } | |
| 1748 | |
| 1749 | |
| 1750 namespace { | 1740 namespace { |
| 1751 | 1741 |
| 1752 ElementsKind GetExternalArrayElementsKind(ExternalArrayType type) { | 1742 ElementsKind GetExternalArrayElementsKind(ExternalArrayType type) { |
| 1753 switch (type) { | 1743 switch (type) { |
| 1754 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1744 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 1755 case kExternal##Type##Array: \ | 1745 case kExternal##Type##Array: \ |
| 1756 return TYPE##_ELEMENTS; | 1746 return TYPE##_ELEMENTS; |
| 1757 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 1747 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 1758 } | 1748 } |
| 1759 UNREACHABLE(); | 1749 UNREACHABLE(); |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2396 } | 2386 } |
| 2397 | 2387 |
| 2398 | 2388 |
| 2399 Handle<Object> Factory::ToBoolean(bool value) { | 2389 Handle<Object> Factory::ToBoolean(bool value) { |
| 2400 return value ? true_value() : false_value(); | 2390 return value ? true_value() : false_value(); |
| 2401 } | 2391 } |
| 2402 | 2392 |
| 2403 | 2393 |
| 2404 } // namespace internal | 2394 } // namespace internal |
| 2405 } // namespace v8 | 2395 } // namespace v8 |
| OLD | NEW |