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 3497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3508 FixedArray* properties = empty_fixed_array(); | 3508 FixedArray* properties = empty_fixed_array(); |
3509 | 3509 |
3510 // Allocate the JSObject. | 3510 // Allocate the JSObject. |
3511 AllocationSpace space = SelectSpace(pretenure); | 3511 AllocationSpace space = SelectSpace(pretenure); |
3512 JSObject* js_obj = nullptr; | 3512 JSObject* js_obj = nullptr; |
3513 AllocationResult allocation = Allocate(map, space, allocation_site); | 3513 AllocationResult allocation = Allocate(map, space, allocation_site); |
3514 if (!allocation.To(&js_obj)) return allocation; | 3514 if (!allocation.To(&js_obj)) return allocation; |
3515 | 3515 |
3516 // Initialize the JSObject. | 3516 // Initialize the JSObject. |
3517 InitializeJSObjectFromMap(js_obj, properties, map); | 3517 InitializeJSObjectFromMap(js_obj, properties, map); |
3518 DCHECK(js_obj->HasFastElements() || js_obj->HasFixedTypedArrayElements()); | 3518 DCHECK(js_obj->HasFastElements() || js_obj->HasFixedTypedArrayElements() || |
| 3519 js_obj->HasFastStringWrapperElements()); |
3519 return js_obj; | 3520 return js_obj; |
3520 } | 3521 } |
3521 | 3522 |
3522 | 3523 |
3523 AllocationResult Heap::AllocateJSObject(JSFunction* constructor, | 3524 AllocationResult Heap::AllocateJSObject(JSFunction* constructor, |
3524 PretenureFlag pretenure, | 3525 PretenureFlag pretenure, |
3525 AllocationSite* allocation_site) { | 3526 AllocationSite* allocation_site) { |
3526 DCHECK(constructor->has_initial_map()); | 3527 DCHECK(constructor->has_initial_map()); |
3527 | 3528 |
3528 // Allocate the object based on the constructors initial map. | 3529 // Allocate the object based on the constructors initial map. |
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6244 } | 6245 } |
6245 | 6246 |
6246 | 6247 |
6247 // static | 6248 // static |
6248 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6249 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6249 return StaticVisitorBase::GetVisitorId(map); | 6250 return StaticVisitorBase::GetVisitorId(map); |
6250 } | 6251 } |
6251 | 6252 |
6252 } // namespace internal | 6253 } // namespace internal |
6253 } // namespace v8 | 6254 } // namespace v8 |
OLD | NEW |