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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 } | 813 } |
814 void remove_available_in_free_list(size_t available) { | 814 void remove_available_in_free_list(size_t available) { |
815 DCHECK_LE(available, area_size()); | 815 DCHECK_LE(available, area_size()); |
816 DCHECK_GE(available_in_free_list(), available); | 816 DCHECK_GE(available_in_free_list(), available); |
817 available_in_free_list_.Decrement(available); | 817 available_in_free_list_.Decrement(available); |
818 } | 818 } |
819 | 819 |
820 size_t ShrinkToHighWaterMark(); | 820 size_t ShrinkToHighWaterMark(); |
821 | 821 |
822 V8_EXPORT_PRIVATE void CreateBlackArea(Address start, Address end); | 822 V8_EXPORT_PRIVATE void CreateBlackArea(Address start, Address end); |
| 823 void DestroyBlackArea(Address start, Address end); |
823 | 824 |
824 #ifdef DEBUG | 825 #ifdef DEBUG |
825 void Print(); | 826 void Print(); |
826 #endif // DEBUG | 827 #endif // DEBUG |
827 | 828 |
828 private: | 829 private: |
829 enum InitializationMode { kFreeMemory, kDoNotFreeMemory }; | 830 enum InitializationMode { kFreeMemory, kDoNotFreeMemory }; |
830 | 831 |
831 template <InitializationMode mode = kFreeMemory> | 832 template <InitializationMode mode = kFreeMemory> |
832 static inline Page* Initialize(Heap* heap, MemoryChunk* chunk, | 833 static inline Page* Initialize(Heap* heap, MemoryChunk* chunk, |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); | 2070 MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); |
2070 allocation_info_.Reset(top, limit); | 2071 allocation_info_.Reset(top, limit); |
2071 } | 2072 } |
2072 | 2073 |
2073 void SetAllocationInfo(Address top, Address limit); | 2074 void SetAllocationInfo(Address top, Address limit); |
2074 | 2075 |
2075 // Empty space allocation info, returning unused area to free list. | 2076 // Empty space allocation info, returning unused area to free list. |
2076 void EmptyAllocationInfo(); | 2077 void EmptyAllocationInfo(); |
2077 | 2078 |
2078 void MarkAllocationInfoBlack(); | 2079 void MarkAllocationInfoBlack(); |
| 2080 void UnmarkAllocationInfo(); |
2079 | 2081 |
2080 void AccountAllocatedBytes(size_t bytes) { | 2082 void AccountAllocatedBytes(size_t bytes) { |
2081 accounting_stats_.AllocateBytes(bytes); | 2083 accounting_stats_.AllocateBytes(bytes); |
2082 } | 2084 } |
2083 | 2085 |
2084 void IncreaseCapacity(size_t bytes); | 2086 void IncreaseCapacity(size_t bytes); |
2085 | 2087 |
2086 // Releases an unused page and shrinks the space. | 2088 // Releases an unused page and shrinks the space. |
2087 void ReleasePage(Page* page); | 2089 void ReleasePage(Page* page); |
2088 | 2090 |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2953 PageIterator old_iterator_; | 2955 PageIterator old_iterator_; |
2954 PageIterator code_iterator_; | 2956 PageIterator code_iterator_; |
2955 PageIterator map_iterator_; | 2957 PageIterator map_iterator_; |
2956 LargePageIterator lo_iterator_; | 2958 LargePageIterator lo_iterator_; |
2957 }; | 2959 }; |
2958 | 2960 |
2959 } // namespace internal | 2961 } // namespace internal |
2960 } // namespace v8 | 2962 } // namespace v8 |
2961 | 2963 |
2962 #endif // V8_HEAP_SPACES_H_ | 2964 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |