OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 3439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3450 | 3450 |
3451 AllocationResult Heap::AllocateJSObjectFromMap( | 3451 AllocationResult Heap::AllocateJSObjectFromMap( |
3452 Map* map, PretenureFlag pretenure, AllocationSite* allocation_site) { | 3452 Map* map, PretenureFlag pretenure, AllocationSite* allocation_site) { |
3453 // JSFunctions should be allocated using AllocateFunction to be | 3453 // JSFunctions should be allocated using AllocateFunction to be |
3454 // properly initialized. | 3454 // properly initialized. |
3455 DCHECK(map->instance_type() != JS_FUNCTION_TYPE); | 3455 DCHECK(map->instance_type() != JS_FUNCTION_TYPE); |
3456 | 3456 |
3457 // Both types of global objects should be allocated using | 3457 // Both types of global objects should be allocated using |
3458 // AllocateGlobalObject to be properly initialized. | 3458 // AllocateGlobalObject to be properly initialized. |
3459 DCHECK(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); | 3459 DCHECK(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); |
3460 DCHECK(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); | |
3461 | 3460 |
3462 // Allocate the backing storage for the properties. | 3461 // Allocate the backing storage for the properties. |
3463 FixedArray* properties = empty_fixed_array(); | 3462 FixedArray* properties = empty_fixed_array(); |
3464 | 3463 |
3465 // Allocate the JSObject. | 3464 // Allocate the JSObject. |
3466 AllocationSpace space = SelectSpace(pretenure); | 3465 AllocationSpace space = SelectSpace(pretenure); |
3467 JSObject* js_obj = nullptr; | 3466 JSObject* js_obj = nullptr; |
3468 AllocationResult allocation = Allocate(map, space, allocation_site); | 3467 AllocationResult allocation = Allocate(map, space, allocation_site); |
3469 if (!allocation.To(&js_obj)) return allocation; | 3468 if (!allocation.To(&js_obj)) return allocation; |
3470 | 3469 |
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6124 } | 6123 } |
6125 | 6124 |
6126 | 6125 |
6127 // static | 6126 // static |
6128 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6127 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6129 return StaticVisitorBase::GetVisitorId(map); | 6128 return StaticVisitorBase::GetVisitorId(map); |
6130 } | 6129 } |
6131 | 6130 |
6132 } // namespace internal | 6131 } // namespace internal |
6133 } // namespace v8 | 6132 } // namespace v8 |
OLD | NEW |