| 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 | |
| 975 Handle<AllocationSite> Factory::NewAllocationSite() { | 968 Handle<AllocationSite> Factory::NewAllocationSite() { |
| 976 Handle<Map> map = allocation_site_map(); | 969 Handle<Map> map = allocation_site_map(); |
| 977 Handle<AllocationSite> site = New<AllocationSite>(map, OLD_SPACE); | 970 Handle<AllocationSite> site = New<AllocationSite>(map, OLD_SPACE); |
| 978 site->Initialize(); | 971 site->Initialize(); |
| 979 | 972 |
| 980 // Link the site | 973 // Link the site |
| 981 site->set_weak_next(isolate()->heap()->allocation_sites_list()); | 974 site->set_weak_next(isolate()->heap()->allocation_sites_list()); |
| 982 isolate()->heap()->set_allocation_sites_list(*site); | 975 isolate()->heap()->set_allocation_sites_list(*site); |
| 983 return site; | 976 return site; |
| 984 } | 977 } |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 } | 2325 } |
| 2333 | 2326 |
| 2334 | 2327 |
| 2335 Handle<Object> Factory::ToBoolean(bool value) { | 2328 Handle<Object> Factory::ToBoolean(bool value) { |
| 2336 return value ? true_value() : false_value(); | 2329 return value ? true_value() : false_value(); |
| 2337 } | 2330 } |
| 2338 | 2331 |
| 2339 | 2332 |
| 2340 } // namespace internal | 2333 } // namespace internal |
| 2341 } // namespace v8 | 2334 } // namespace v8 |
| OLD | NEW |