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/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1715 Handle<JSDataView> Factory::NewJSDataView() { | 1715 Handle<JSDataView> Factory::NewJSDataView() { |
1716 Handle<JSFunction> data_view_fun( | 1716 Handle<JSFunction> data_view_fun( |
1717 isolate()->native_context()->data_view_fun()); | 1717 isolate()->native_context()->data_view_fun()); |
1718 CALL_HEAP_FUNCTION( | 1718 CALL_HEAP_FUNCTION( |
1719 isolate(), | 1719 isolate(), |
1720 isolate()->heap()->AllocateJSObject(*data_view_fun), | 1720 isolate()->heap()->AllocateJSObject(*data_view_fun), |
1721 JSDataView); | 1721 JSDataView); |
1722 } | 1722 } |
1723 | 1723 |
1724 | 1724 |
1725 Handle<JSMapIterator> Factory::NewJSMapIterator() { | |
arv (Not doing code reviews)
2014/10/31 10:20:18
Maybe this should take the table, index and kind s
aandrey
2014/10/31 10:43:22
It's not easy given how the CALL_HEAP_FUNCTION mac
| |
1726 Handle<Map> map(isolate()->native_context()->map_iterator_map()); | |
1727 CALL_HEAP_FUNCTION(isolate(), | |
1728 isolate()->heap()->AllocateJSObjectFromMap(*map), | |
1729 JSMapIterator); | |
1730 } | |
1731 | |
1732 | |
1733 Handle<JSSetIterator> Factory::NewJSSetIterator() { | |
1734 Handle<Map> map(isolate()->native_context()->set_iterator_map()); | |
1735 CALL_HEAP_FUNCTION(isolate(), | |
1736 isolate()->heap()->AllocateJSObjectFromMap(*map), | |
1737 JSSetIterator); | |
1738 } | |
1739 | |
1740 | |
1725 namespace { | 1741 namespace { |
1726 | 1742 |
1727 ElementsKind GetExternalArrayElementsKind(ExternalArrayType type) { | 1743 ElementsKind GetExternalArrayElementsKind(ExternalArrayType type) { |
1728 switch (type) { | 1744 switch (type) { |
1729 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1745 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
1730 case kExternal##Type##Array: \ | 1746 case kExternal##Type##Array: \ |
1731 return EXTERNAL_##TYPE##_ELEMENTS; | 1747 return EXTERNAL_##TYPE##_ELEMENTS; |
1732 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 1748 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
1733 } | 1749 } |
1734 UNREACHABLE(); | 1750 UNREACHABLE(); |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2482 return Handle<Object>::null(); | 2498 return Handle<Object>::null(); |
2483 } | 2499 } |
2484 | 2500 |
2485 | 2501 |
2486 Handle<Object> Factory::ToBoolean(bool value) { | 2502 Handle<Object> Factory::ToBoolean(bool value) { |
2487 return value ? true_value() : false_value(); | 2503 return value ? true_value() : false_value(); |
2488 } | 2504 } |
2489 | 2505 |
2490 | 2506 |
2491 } } // namespace v8::internal | 2507 } } // namespace v8::internal |
OLD | NEW |