| 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 <unordered_map> | 7 #include <unordered_map> |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 3671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3682 // Make the clone. | 3682 // Make the clone. |
| 3683 Map* map = source->map(); | 3683 Map* map = source->map(); |
| 3684 | 3684 |
| 3685 // We can only clone regexps, normal objects, api objects, errors or arrays. | 3685 // We can only clone regexps, normal objects, api objects, errors or arrays. |
| 3686 // Copying anything else will break invariants. | 3686 // Copying anything else will break invariants. |
| 3687 CHECK(map->instance_type() == JS_REGEXP_TYPE || | 3687 CHECK(map->instance_type() == JS_REGEXP_TYPE || |
| 3688 map->instance_type() == JS_OBJECT_TYPE || | 3688 map->instance_type() == JS_OBJECT_TYPE || |
| 3689 map->instance_type() == JS_ERROR_TYPE || | 3689 map->instance_type() == JS_ERROR_TYPE || |
| 3690 map->instance_type() == JS_ARRAY_TYPE || | 3690 map->instance_type() == JS_ARRAY_TYPE || |
| 3691 map->instance_type() == JS_API_OBJECT_TYPE || | 3691 map->instance_type() == JS_API_OBJECT_TYPE || |
| 3692 map->instance_type() == WASM_INSTANCE_TYPE || |
| 3693 map->instance_type() == WASM_MEMORY_TYPE || |
| 3694 map->instance_type() == WASM_MODULE_TYPE || |
| 3695 map->instance_type() == WASM_TABLE_TYPE || |
| 3692 map->instance_type() == JS_SPECIAL_API_OBJECT_TYPE); | 3696 map->instance_type() == JS_SPECIAL_API_OBJECT_TYPE); |
| 3693 | 3697 |
| 3694 int object_size = map->instance_size(); | 3698 int object_size = map->instance_size(); |
| 3695 HeapObject* clone = nullptr; | 3699 HeapObject* clone = nullptr; |
| 3696 | 3700 |
| 3697 DCHECK(site == NULL || AllocationSite::CanTrack(map->instance_type())); | 3701 DCHECK(site == NULL || AllocationSite::CanTrack(map->instance_type())); |
| 3698 | 3702 |
| 3699 int adjusted_object_size = | 3703 int adjusted_object_size = |
| 3700 site != NULL ? object_size + AllocationMemento::kSize : object_size; | 3704 site != NULL ? object_size + AllocationMemento::kSize : object_size; |
| 3701 AllocationResult allocation = AllocateRaw(adjusted_object_size, NEW_SPACE); | 3705 AllocationResult allocation = AllocateRaw(adjusted_object_size, NEW_SPACE); |
| (...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6754 return dst == src && type == CODE_TYPE; | 6758 return dst == src && type == CODE_TYPE; |
| 6755 case MAP_SPACE: | 6759 case MAP_SPACE: |
| 6756 case LO_SPACE: | 6760 case LO_SPACE: |
| 6757 return false; | 6761 return false; |
| 6758 } | 6762 } |
| 6759 UNREACHABLE(); | 6763 UNREACHABLE(); |
| 6760 } | 6764 } |
| 6761 | 6765 |
| 6762 } // namespace internal | 6766 } // namespace internal |
| 6763 } // namespace v8 | 6767 } // namespace v8 |
| OLD | NEW |