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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 | 958 |
959 Handle<WeakCell> Factory::NewWeakCell(Handle<HeapObject> value) { | 959 Handle<WeakCell> Factory::NewWeakCell(Handle<HeapObject> value) { |
960 // It is safe to dereference the value because we are embedding it | 960 // It is safe to dereference the value because we are embedding it |
961 // in cell and not inspecting its fields. | 961 // in cell and not inspecting its fields. |
962 AllowDeferredHandleDereference convert_to_cell; | 962 AllowDeferredHandleDereference convert_to_cell; |
963 CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateWeakCell(*value), | 963 CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateWeakCell(*value), |
964 WeakCell); | 964 WeakCell); |
965 } | 965 } |
966 | 966 |
967 | 967 |
| 968 Handle<TransitionArray> Factory::NewTransitionArray(int capacity) { |
| 969 CALL_HEAP_FUNCTION(isolate(), |
| 970 isolate()->heap()->AllocateTransitionArray(capacity), |
| 971 TransitionArray); |
| 972 } |
| 973 |
| 974 |
968 Handle<AllocationSite> Factory::NewAllocationSite() { | 975 Handle<AllocationSite> Factory::NewAllocationSite() { |
969 Handle<Map> map = allocation_site_map(); | 976 Handle<Map> map = allocation_site_map(); |
970 Handle<AllocationSite> site = New<AllocationSite>(map, OLD_SPACE); | 977 Handle<AllocationSite> site = New<AllocationSite>(map, OLD_SPACE); |
971 site->Initialize(); | 978 site->Initialize(); |
972 | 979 |
973 // Link the site | 980 // Link the site |
974 site->set_weak_next(isolate()->heap()->allocation_sites_list()); | 981 site->set_weak_next(isolate()->heap()->allocation_sites_list()); |
975 isolate()->heap()->set_allocation_sites_list(*site); | 982 isolate()->heap()->set_allocation_sites_list(*site); |
976 return site; | 983 return site; |
977 } | 984 } |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2325 } | 2332 } |
2326 | 2333 |
2327 | 2334 |
2328 Handle<Object> Factory::ToBoolean(bool value) { | 2335 Handle<Object> Factory::ToBoolean(bool value) { |
2329 return value ? true_value() : false_value(); | 2336 return value ? true_value() : false_value(); |
2330 } | 2337 } |
2331 | 2338 |
2332 | 2339 |
2333 } // namespace internal | 2340 } // namespace internal |
2334 } // namespace v8 | 2341 } // namespace v8 |
OLD | NEW |