| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to); | 345 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to); |
| 346 | 346 |
| 347 enum ArrayStorageAllocationMode { | 347 enum ArrayStorageAllocationMode { |
| 348 DONT_INITIALIZE_ARRAY_ELEMENTS, | 348 DONT_INITIALIZE_ARRAY_ELEMENTS, |
| 349 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE | 349 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE |
| 350 }; | 350 }; |
| 351 | 351 |
| 352 enum class ClearRecordedSlots { kYes, kNo }; | 352 enum class ClearRecordedSlots { kYes, kNo }; |
| 353 | 353 |
| 354 enum class ClearBlackArea { kYes, kNo }; | |
| 355 | |
| 356 enum class GarbageCollectionReason { | 354 enum class GarbageCollectionReason { |
| 357 kUnknown = 0, | 355 kUnknown = 0, |
| 358 kAllocationFailure = 1, | 356 kAllocationFailure = 1, |
| 359 kAllocationLimit = 2, | 357 kAllocationLimit = 2, |
| 360 kContextDisposal = 3, | 358 kContextDisposal = 3, |
| 361 kCountersExtension = 4, | 359 kCountersExtension = 4, |
| 362 kDebugger = 5, | 360 kDebugger = 5, |
| 363 kDeserializer = 6, | 361 kDeserializer = 6, |
| 364 kExternalMemoryPressure = 7, | 362 kExternalMemoryPressure = 7, |
| 365 kFinalizeMarkingViaStackGuard = 8, | 363 kFinalizeMarkingViaStackGuard = 8, |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 // FreeSpace objects have a null map after deserialization. Update the map. | 730 // FreeSpace objects have a null map after deserialization. Update the map. |
| 733 void RepairFreeListsAfterDeserialization(); | 731 void RepairFreeListsAfterDeserialization(); |
| 734 | 732 |
| 735 // Move len elements within a given array from src_index index to dst_index | 733 // Move len elements within a given array from src_index index to dst_index |
| 736 // index. | 734 // index. |
| 737 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); | 735 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); |
| 738 | 736 |
| 739 // Initialize a filler object to keep the ability to iterate over the heap | 737 // Initialize a filler object to keep the ability to iterate over the heap |
| 740 // when introducing gaps within pages. If slots could have been recorded in | 738 // when introducing gaps within pages. If slots could have been recorded in |
| 741 // the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise, | 739 // the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise, |
| 742 // pass ClearRecordedSlots::kNo. If the filler was created in a black area | 740 // pass ClearRecordedSlots::kNo. |
| 743 // we may want to clear the corresponding mark bits with ClearBlackArea::kYes, | 741 void CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode); |
| 744 // which is the default. ClearBlackArea::kNo does not clear the mark bits. | |
| 745 void CreateFillerObjectAt( | |
| 746 Address addr, int size, ClearRecordedSlots mode, | |
| 747 ClearBlackArea black_area_mode = ClearBlackArea::kYes); | |
| 748 | 742 |
| 749 bool CanMoveObjectStart(HeapObject* object); | 743 bool CanMoveObjectStart(HeapObject* object); |
| 750 | 744 |
| 751 // Maintain consistency of live bytes during incremental marking. | 745 // Maintain consistency of live bytes during incremental marking. |
| 752 void AdjustLiveBytes(HeapObject* object, int by); | 746 void AdjustLiveBytes(HeapObject* object, int by); |
| 753 | 747 |
| 754 // Trim the given array from the left. Note that this relocates the object | 748 // Trim the given array from the left. Note that this relocates the object |
| 755 // start and hence is only valid if there is only a single reference to it. | 749 // start and hence is only valid if there is only a single reference to it. |
| 756 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); | 750 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); |
| 757 | 751 |
| (...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 friend class LargeObjectSpace; | 2660 friend class LargeObjectSpace; |
| 2667 friend class NewSpace; | 2661 friend class NewSpace; |
| 2668 friend class PagedSpace; | 2662 friend class PagedSpace; |
| 2669 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2663 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2670 }; | 2664 }; |
| 2671 | 2665 |
| 2672 } // namespace internal | 2666 } // namespace internal |
| 2673 } // namespace v8 | 2667 } // namespace v8 |
| 2674 | 2668 |
| 2675 #endif // V8_HEAP_HEAP_H_ | 2669 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |