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_MARK_COMPACT_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_H_ |
6 #define V8_HEAP_MARK_COMPACT_H_ | 6 #define V8_HEAP_MARK_COMPACT_H_ |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 | 10 |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 // then the whole given space is swept. It returns the size of the maximum | 684 // then the whole given space is swept. It returns the size of the maximum |
685 // continuous freed memory chunk. | 685 // continuous freed memory chunk. |
686 int SweepInParallel(PagedSpace* space, int required_freed_bytes); | 686 int SweepInParallel(PagedSpace* space, int required_freed_bytes); |
687 | 687 |
688 // Sweeps a given page concurrently to the sweeper threads. It returns the | 688 // Sweeps a given page concurrently to the sweeper threads. It returns the |
689 // size of the maximum continuous freed memory chunk. | 689 // size of the maximum continuous freed memory chunk. |
690 int SweepInParallel(Page* page, PagedSpace* space); | 690 int SweepInParallel(Page* page, PagedSpace* space); |
691 | 691 |
692 void EnsureSweepingCompleted(); | 692 void EnsureSweepingCompleted(); |
693 | 693 |
694 void EnsureSweepingCompleted(Page* page, PagedSpace* space); | |
695 | |
696 // If sweeper threads are not active this method will return true. If | 694 // If sweeper threads are not active this method will return true. If |
697 // this is a latency issue we should be smarter here. Otherwise, it will | 695 // this is a latency issue we should be smarter here. Otherwise, it will |
698 // return true if the sweeper threads are done processing the pages. | 696 // return true if the sweeper threads are done processing the pages. |
699 bool IsSweepingCompleted(); | 697 bool IsSweepingCompleted(); |
700 | 698 |
701 void RefillFreeList(PagedSpace* space); | 699 void RefillFreeList(PagedSpace* space); |
702 | 700 |
703 // Checks if sweeping is in progress right now on any space. | 701 // Checks if sweeping is in progress right now on any space. |
704 bool sweeping_in_progress() { return sweeping_in_progress_; } | 702 bool sweeping_in_progress() { return sweeping_in_progress_; } |
705 | 703 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 Heap* heap_; | 960 Heap* heap_; |
963 base::VirtualMemory* marking_deque_memory_; | 961 base::VirtualMemory* marking_deque_memory_; |
964 size_t marking_deque_memory_committed_; | 962 size_t marking_deque_memory_committed_; |
965 MarkingDeque marking_deque_; | 963 MarkingDeque marking_deque_; |
966 CodeFlusher* code_flusher_; | 964 CodeFlusher* code_flusher_; |
967 bool have_code_to_deoptimize_; | 965 bool have_code_to_deoptimize_; |
968 | 966 |
969 List<Page*> evacuation_candidates_; | 967 List<Page*> evacuation_candidates_; |
970 | 968 |
971 base::SmartPointer<FreeList> free_list_old_space_; | 969 base::SmartPointer<FreeList> free_list_old_space_; |
972 base::SmartPointer<FreeList> free_list_code_space_; | |
973 | 970 |
974 friend class Heap; | 971 friend class Heap; |
975 }; | 972 }; |
976 | 973 |
977 | 974 |
978 class MarkBitCellIterator BASE_EMBEDDED { | 975 class MarkBitCellIterator BASE_EMBEDDED { |
979 public: | 976 public: |
980 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { | 977 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { |
981 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( | 978 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
982 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); | 979 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 private: | 1025 private: |
1029 MarkCompactCollector* collector_; | 1026 MarkCompactCollector* collector_; |
1030 }; | 1027 }; |
1031 | 1028 |
1032 | 1029 |
1033 const char* AllocationSpaceName(AllocationSpace space); | 1030 const char* AllocationSpaceName(AllocationSpace space); |
1034 } | 1031 } |
1035 } // namespace v8::internal | 1032 } // namespace v8::internal |
1036 | 1033 |
1037 #endif // V8_HEAP_MARK_COMPACT_H_ | 1034 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |