| 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 Handle<JSDataView> Factory::NewJSDataView() { | 1730 Handle<JSDataView> Factory::NewJSDataView() { |
| 1731 Handle<JSFunction> data_view_fun( | 1731 Handle<JSFunction> data_view_fun( |
| 1732 isolate()->native_context()->data_view_fun()); | 1732 isolate()->native_context()->data_view_fun()); |
| 1733 CALL_HEAP_FUNCTION( | 1733 CALL_HEAP_FUNCTION( |
| 1734 isolate(), | 1734 isolate(), |
| 1735 isolate()->heap()->AllocateJSObject(*data_view_fun), | 1735 isolate()->heap()->AllocateJSObject(*data_view_fun), |
| 1736 JSDataView); | 1736 JSDataView); |
| 1737 } | 1737 } |
| 1738 | 1738 |
| 1739 | 1739 |
| 1740 Handle<JSMap> Factory::NewJSMap() { |
| 1741 Handle<Map> map(isolate()->native_context()->js_map_map()); |
| 1742 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map)); |
| 1743 Runtime::JSMapInitialize(isolate(), js_map); |
| 1744 return js_map; |
| 1745 } |
| 1746 |
| 1747 |
| 1748 Handle<JSSet> Factory::NewJSSet() { |
| 1749 Handle<Map> map(isolate()->native_context()->js_set_map()); |
| 1750 Handle<JSSet> js_set = Handle<JSSet>::cast(NewJSObjectFromMap(map)); |
| 1751 Runtime::JSSetInitialize(isolate(), js_set); |
| 1752 return js_set; |
| 1753 } |
| 1754 |
| 1755 |
| 1740 Handle<JSMapIterator> Factory::NewJSMapIterator() { | 1756 Handle<JSMapIterator> Factory::NewJSMapIterator() { |
| 1741 Handle<Map> map(isolate()->native_context()->map_iterator_map()); | 1757 Handle<Map> map(isolate()->native_context()->map_iterator_map()); |
| 1742 CALL_HEAP_FUNCTION(isolate(), | 1758 CALL_HEAP_FUNCTION(isolate(), |
| 1743 isolate()->heap()->AllocateJSObjectFromMap(*map), | 1759 isolate()->heap()->AllocateJSObjectFromMap(*map), |
| 1744 JSMapIterator); | 1760 JSMapIterator); |
| 1745 } | 1761 } |
| 1746 | 1762 |
| 1747 | 1763 |
| 1748 Handle<JSSetIterator> Factory::NewJSSetIterator() { | 1764 Handle<JSSetIterator> Factory::NewJSSetIterator() { |
| 1749 Handle<Map> map(isolate()->native_context()->set_iterator_map()); | 1765 Handle<Map> map(isolate()->native_context()->set_iterator_map()); |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2426 return Handle<Object>::null(); | 2442 return Handle<Object>::null(); |
| 2427 } | 2443 } |
| 2428 | 2444 |
| 2429 | 2445 |
| 2430 Handle<Object> Factory::ToBoolean(bool value) { | 2446 Handle<Object> Factory::ToBoolean(bool value) { |
| 2431 return value ? true_value() : false_value(); | 2447 return value ? true_value() : false_value(); |
| 2432 } | 2448 } |
| 2433 | 2449 |
| 2434 | 2450 |
| 2435 } } // namespace v8::internal | 2451 } } // namespace v8::internal |
| OLD | NEW |