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 3623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3634 // Make the clone. | 3634 // Make the clone. |
3635 Map* map = source->map(); | 3635 Map* map = source->map(); |
3636 | 3636 |
3637 // We can only clone regexps, normal objects, api objects, errors or arrays. | 3637 // We can only clone regexps, normal objects, api objects, errors or arrays. |
3638 // Copying anything else will break invariants. | 3638 // Copying anything else will break invariants. |
3639 CHECK(map->instance_type() == JS_REGEXP_TYPE || | 3639 CHECK(map->instance_type() == JS_REGEXP_TYPE || |
3640 map->instance_type() == JS_OBJECT_TYPE || | 3640 map->instance_type() == JS_OBJECT_TYPE || |
3641 map->instance_type() == JS_ERROR_TYPE || | 3641 map->instance_type() == JS_ERROR_TYPE || |
3642 map->instance_type() == JS_ARRAY_TYPE || | 3642 map->instance_type() == JS_ARRAY_TYPE || |
3643 map->instance_type() == JS_API_OBJECT_TYPE || | 3643 map->instance_type() == JS_API_OBJECT_TYPE || |
| 3644 map->instance_type() == WASM_INSTANCE_TYPE || |
| 3645 map->instance_type() == WASM_MEMORY_TYPE || |
| 3646 map->instance_type() == WASM_MODULE_TYPE || |
| 3647 map->instance_type() == WASM_TABLE_TYPE || |
3644 map->instance_type() == JS_SPECIAL_API_OBJECT_TYPE); | 3648 map->instance_type() == JS_SPECIAL_API_OBJECT_TYPE); |
3645 | 3649 |
3646 int object_size = map->instance_size(); | 3650 int object_size = map->instance_size(); |
3647 HeapObject* clone = nullptr; | 3651 HeapObject* clone = nullptr; |
3648 | 3652 |
3649 DCHECK(site == NULL || AllocationSite::CanTrack(map->instance_type())); | 3653 DCHECK(site == NULL || AllocationSite::CanTrack(map->instance_type())); |
3650 | 3654 |
3651 int adjusted_object_size = | 3655 int adjusted_object_size = |
3652 site != NULL ? object_size + AllocationMemento::kSize : object_size; | 3656 site != NULL ? object_size + AllocationMemento::kSize : object_size; |
3653 AllocationResult allocation = AllocateRaw(adjusted_object_size, NEW_SPACE); | 3657 AllocationResult allocation = AllocateRaw(adjusted_object_size, NEW_SPACE); |
(...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6706 return dst == src && type == CODE_TYPE; | 6710 return dst == src && type == CODE_TYPE; |
6707 case MAP_SPACE: | 6711 case MAP_SPACE: |
6708 case LO_SPACE: | 6712 case LO_SPACE: |
6709 return false; | 6713 return false; |
6710 } | 6714 } |
6711 UNREACHABLE(); | 6715 UNREACHABLE(); |
6712 } | 6716 } |
6713 | 6717 |
6714 } // namespace internal | 6718 } // namespace internal |
6715 } // namespace v8 | 6719 } // namespace v8 |
OLD | NEW |