| 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 3466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3477 PretenureFlag pretenure, | 3477 PretenureFlag pretenure, |
| 3478 AllocationSite* allocation_site) { | 3478 AllocationSite* allocation_site) { |
| 3479 DCHECK(constructor->has_initial_map()); | 3479 DCHECK(constructor->has_initial_map()); |
| 3480 | 3480 |
| 3481 // Allocate the object based on the constructors initial map. | 3481 // Allocate the object based on the constructors initial map. |
| 3482 AllocationResult allocation = AllocateJSObjectFromMap( | 3482 AllocationResult allocation = AllocateJSObjectFromMap( |
| 3483 constructor->initial_map(), pretenure, allocation_site); | 3483 constructor->initial_map(), pretenure, allocation_site); |
| 3484 #ifdef DEBUG | 3484 #ifdef DEBUG |
| 3485 // Make sure result is NOT a global object if valid. | 3485 // Make sure result is NOT a global object if valid. |
| 3486 HeapObject* obj = nullptr; | 3486 HeapObject* obj = nullptr; |
| 3487 DCHECK(!allocation.To(&obj) || !obj->IsGlobalObject()); | 3487 DCHECK(!allocation.To(&obj) || !obj->IsJSGlobalObject()); |
| 3488 #endif | 3488 #endif |
| 3489 return allocation; | 3489 return allocation; |
| 3490 } | 3490 } |
| 3491 | 3491 |
| 3492 | 3492 |
| 3493 AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) { | 3493 AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) { |
| 3494 // Make the clone. | 3494 // Make the clone. |
| 3495 Map* map = source->map(); | 3495 Map* map = source->map(); |
| 3496 | 3496 |
| 3497 // We can only clone normal objects or arrays. Copying anything else | 3497 // We can only clone normal objects or arrays. Copying anything else |
| (...skipping 2673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6171 } | 6171 } |
| 6172 | 6172 |
| 6173 | 6173 |
| 6174 // static | 6174 // static |
| 6175 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6175 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6176 return StaticVisitorBase::GetVisitorId(map); | 6176 return StaticVisitorBase::GetVisitorId(map); |
| 6177 } | 6177 } |
| 6178 | 6178 |
| 6179 } // namespace internal | 6179 } // namespace internal |
| 6180 } // namespace v8 | 6180 } // namespace v8 |
| OLD | NEW |