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