| 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/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 3499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3510 FixedArray* properties = empty_fixed_array(); | 3510 FixedArray* properties = empty_fixed_array(); |
| 3511 | 3511 |
| 3512 // Allocate the JSObject. | 3512 // Allocate the JSObject. |
| 3513 AllocationSpace space = SelectSpace(pretenure); | 3513 AllocationSpace space = SelectSpace(pretenure); |
| 3514 JSObject* js_obj = nullptr; | 3514 JSObject* js_obj = nullptr; |
| 3515 AllocationResult allocation = Allocate(map, space, allocation_site); | 3515 AllocationResult allocation = Allocate(map, space, allocation_site); |
| 3516 if (!allocation.To(&js_obj)) return allocation; | 3516 if (!allocation.To(&js_obj)) return allocation; |
| 3517 | 3517 |
| 3518 // Initialize the JSObject. | 3518 // Initialize the JSObject. |
| 3519 InitializeJSObjectFromMap(js_obj, properties, map); | 3519 InitializeJSObjectFromMap(js_obj, properties, map); |
| 3520 DCHECK(js_obj->HasFastElements() || js_obj->HasFixedTypedArrayElements()); | 3520 DCHECK(js_obj->HasFastElements() || js_obj->HasFixedTypedArrayElements() || |
| 3521 js_obj->HasFastStringWrapperElements()); |
| 3521 return js_obj; | 3522 return js_obj; |
| 3522 } | 3523 } |
| 3523 | 3524 |
| 3524 | 3525 |
| 3525 AllocationResult Heap::AllocateJSObject(JSFunction* constructor, | 3526 AllocationResult Heap::AllocateJSObject(JSFunction* constructor, |
| 3526 PretenureFlag pretenure, | 3527 PretenureFlag pretenure, |
| 3527 AllocationSite* allocation_site) { | 3528 AllocationSite* allocation_site) { |
| 3528 DCHECK(constructor->has_initial_map()); | 3529 DCHECK(constructor->has_initial_map()); |
| 3529 | 3530 |
| 3530 // Allocate the object based on the constructors initial map. | 3531 // Allocate the object based on the constructors initial map. |
| (...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6221 } | 6222 } |
| 6222 | 6223 |
| 6223 | 6224 |
| 6224 // static | 6225 // static |
| 6225 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6226 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6226 return StaticVisitorBase::GetVisitorId(map); | 6227 return StaticVisitorBase::GetVisitorId(map); |
| 6227 } | 6228 } |
| 6228 | 6229 |
| 6229 } // namespace internal | 6230 } // namespace internal |
| 6230 } // namespace v8 | 6231 } // namespace v8 |
| OLD | NEW |