| 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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 }; | 443 }; |
| 444 | 444 |
| 445 | 445 |
| 446 enum ArrayStorageAllocationMode { | 446 enum ArrayStorageAllocationMode { |
| 447 DONT_INITIALIZE_ARRAY_ELEMENTS, | 447 DONT_INITIALIZE_ARRAY_ELEMENTS, |
| 448 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE | 448 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE |
| 449 }; | 449 }; |
| 450 | 450 |
| 451 enum class ClearRecordedSlots { kYes, kNo }; | 451 enum class ClearRecordedSlots { kYes, kNo }; |
| 452 | 452 |
| 453 enum class ClearBlackArea { kYes, kNo }; |
| 454 |
| 453 class Heap { | 455 class Heap { |
| 454 public: | 456 public: |
| 455 // Declare all the root indices. This defines the root list order. | 457 // Declare all the root indices. This defines the root list order. |
| 456 enum RootListIndex { | 458 enum RootListIndex { |
| 457 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, | 459 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
| 458 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) | 460 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) |
| 459 #undef ROOT_INDEX_DECLARATION | 461 #undef ROOT_INDEX_DECLARATION |
| 460 | 462 |
| 461 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, | 463 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, |
| 462 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) | 464 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 // FreeSpace objects have a null map after deserialization. Update the map. | 668 // FreeSpace objects have a null map after deserialization. Update the map. |
| 667 void RepairFreeListsAfterDeserialization(); | 669 void RepairFreeListsAfterDeserialization(); |
| 668 | 670 |
| 669 // Move len elements within a given array from src_index index to dst_index | 671 // Move len elements within a given array from src_index index to dst_index |
| 670 // index. | 672 // index. |
| 671 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); | 673 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); |
| 672 | 674 |
| 673 // Initialize a filler object to keep the ability to iterate over the heap | 675 // Initialize a filler object to keep the ability to iterate over the heap |
| 674 // when introducing gaps within pages. If slots could have been recorded in | 676 // when introducing gaps within pages. If slots could have been recorded in |
| 675 // the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise, | 677 // the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise, |
| 676 // pass ClearRecordedSlots::kNo. | 678 // pass ClearRecordedSlots::kNo. If the filler was created in a black area |
| 677 void CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode); | 679 // we may want to clear the corresponding mark bits with ClearBlackArea::kYes, |
| 680 // which is the default. ClearBlackArea::kNo does not clear the mark bits. |
| 681 void CreateFillerObjectAt( |
| 682 Address addr, int size, ClearRecordedSlots mode, |
| 683 ClearBlackArea black_area_mode = ClearBlackArea::kYes); |
| 678 | 684 |
| 679 bool CanMoveObjectStart(HeapObject* object); | 685 bool CanMoveObjectStart(HeapObject* object); |
| 680 | 686 |
| 681 // Maintain consistency of live bytes during incremental marking. | 687 // Maintain consistency of live bytes during incremental marking. |
| 682 void AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode); | 688 void AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode); |
| 683 | 689 |
| 684 // Trim the given array from the left. Note that this relocates the object | 690 // Trim the given array from the left. Note that this relocates the object |
| 685 // start and hence is only valid if there is only a single reference to it. | 691 // start and hence is only valid if there is only a single reference to it. |
| 686 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); | 692 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); |
| 687 | 693 |
| (...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 friend class LargeObjectSpace; | 2717 friend class LargeObjectSpace; |
| 2712 friend class NewSpace; | 2718 friend class NewSpace; |
| 2713 friend class PagedSpace; | 2719 friend class PagedSpace; |
| 2714 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2720 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2715 }; | 2721 }; |
| 2716 | 2722 |
| 2717 } // namespace internal | 2723 } // namespace internal |
| 2718 } // namespace v8 | 2724 } // namespace v8 |
| 2719 | 2725 |
| 2720 #endif // V8_HEAP_HEAP_H_ | 2726 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |