OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 available_in_free_list_.Increment(available); | 800 available_in_free_list_.Increment(available); |
801 } | 801 } |
802 void remove_available_in_free_list(size_t available) { | 802 void remove_available_in_free_list(size_t available) { |
803 DCHECK_LE(available, area_size()); | 803 DCHECK_LE(available, area_size()); |
804 DCHECK_GE(available_in_free_list(), available); | 804 DCHECK_GE(available_in_free_list(), available); |
805 available_in_free_list_.Decrement(available); | 805 available_in_free_list_.Decrement(available); |
806 } | 806 } |
807 | 807 |
808 size_t ShrinkToHighWaterMark(); | 808 size_t ShrinkToHighWaterMark(); |
809 | 809 |
810 void CreateBlackArea(Address start, Address end); | 810 V8_EXPORT_PRIVATE void CreateBlackArea(Address start, Address end); |
811 | 811 |
812 #ifdef DEBUG | 812 #ifdef DEBUG |
813 void Print(); | 813 void Print(); |
814 #endif // DEBUG | 814 #endif // DEBUG |
815 | 815 |
816 private: | 816 private: |
817 enum InitializationMode { kFreeMemory, kDoNotFreeMemory }; | 817 enum InitializationMode { kFreeMemory, kDoNotFreeMemory }; |
818 | 818 |
819 template <InitializationMode mode = kFreeMemory> | 819 template <InitializationMode mode = kFreeMemory> |
820 static inline Page* Initialize(Heap* heap, MemoryChunk* chunk, | 820 static inline Page* Initialize(Heap* heap, MemoryChunk* chunk, |
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 ~PauseAllocationObserversScope(); | 2726 ~PauseAllocationObserversScope(); |
2727 | 2727 |
2728 private: | 2728 private: |
2729 Heap* heap_; | 2729 Heap* heap_; |
2730 DISALLOW_COPY_AND_ASSIGN(PauseAllocationObserversScope); | 2730 DISALLOW_COPY_AND_ASSIGN(PauseAllocationObserversScope); |
2731 }; | 2731 }; |
2732 | 2732 |
2733 // ----------------------------------------------------------------------------- | 2733 // ----------------------------------------------------------------------------- |
2734 // Compaction space that is used temporarily during compaction. | 2734 // Compaction space that is used temporarily during compaction. |
2735 | 2735 |
2736 class CompactionSpace : public PagedSpace { | 2736 class V8_EXPORT_PRIVATE CompactionSpace : public PagedSpace { |
2737 public: | 2737 public: |
2738 CompactionSpace(Heap* heap, AllocationSpace id, Executability executable) | 2738 CompactionSpace(Heap* heap, AllocationSpace id, Executability executable) |
2739 : PagedSpace(heap, id, executable) {} | 2739 : PagedSpace(heap, id, executable) {} |
2740 | 2740 |
2741 bool is_local() override { return true; } | 2741 bool is_local() override { return true; } |
2742 | 2742 |
2743 protected: | 2743 protected: |
2744 // The space is temporary and not included in any snapshots. | 2744 // The space is temporary and not included in any snapshots. |
2745 bool snapshotable() override { return false; } | 2745 bool snapshotable() override { return false; } |
2746 | 2746 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2959 PageIterator old_iterator_; | 2959 PageIterator old_iterator_; |
2960 PageIterator code_iterator_; | 2960 PageIterator code_iterator_; |
2961 PageIterator map_iterator_; | 2961 PageIterator map_iterator_; |
2962 LargePageIterator lo_iterator_; | 2962 LargePageIterator lo_iterator_; |
2963 }; | 2963 }; |
2964 | 2964 |
2965 } // namespace internal | 2965 } // namespace internal |
2966 } // namespace v8 | 2966 } // namespace v8 |
2967 | 2967 |
2968 #endif // V8_HEAP_SPACES_H_ | 2968 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |