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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 SlotsBuffer* evacuation_slots_buffer); | 711 SlotsBuffer* evacuation_slots_buffer); |
712 | 712 |
713 void EvacuatePages(CompactionSpaceCollection* compaction_spaces, | 713 void EvacuatePages(CompactionSpaceCollection* compaction_spaces, |
714 SlotsBuffer** evacuation_slots_buffer); | 714 SlotsBuffer** evacuation_slots_buffer); |
715 | 715 |
716 void EvacuatePagesInParallel(); | 716 void EvacuatePagesInParallel(); |
717 | 717 |
718 // The number of parallel compaction tasks, including the main thread. | 718 // The number of parallel compaction tasks, including the main thread. |
719 int NumberOfParallelCompactionTasks(); | 719 int NumberOfParallelCompactionTasks(); |
720 | 720 |
721 void WaitUntilCompactionCompleted(); | |
722 | |
723 void EvacuateNewSpaceAndCandidates(); | 721 void EvacuateNewSpaceAndCandidates(); |
724 | 722 |
725 void VisitLiveObjects(Page* page, ObjectVisitor* visitor); | 723 void VisitLiveObjects(Page* page, ObjectVisitor* visitor); |
726 | 724 |
727 void SweepAbortedPages(); | 725 void SweepAbortedPages(); |
728 | 726 |
729 void ReleaseEvacuationCandidates(); | 727 void ReleaseEvacuationCandidates(); |
730 | 728 |
731 // Moves the pages of the evacuation_candidates_ list to the end of their | 729 // Moves the pages of the evacuation_candidates_ list to the end of their |
732 // corresponding space pages list. | 730 // corresponding space pages list. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 788 |
791 // True if parallel compaction is currently in progress. | 789 // True if parallel compaction is currently in progress. |
792 bool compaction_in_progress_; | 790 bool compaction_in_progress_; |
793 | 791 |
794 // Semaphore used to synchronize sweeper tasks. | 792 // Semaphore used to synchronize sweeper tasks. |
795 base::Semaphore pending_sweeper_tasks_semaphore_; | 793 base::Semaphore pending_sweeper_tasks_semaphore_; |
796 | 794 |
797 // Semaphore used to synchronize compaction tasks. | 795 // Semaphore used to synchronize compaction tasks. |
798 base::Semaphore pending_compaction_tasks_semaphore_; | 796 base::Semaphore pending_compaction_tasks_semaphore_; |
799 | 797 |
800 // Number of active compaction tasks (including main thread). | |
801 intptr_t concurrent_compaction_tasks_active_; | |
802 | |
803 friend class Heap; | 798 friend class Heap; |
804 }; | 799 }; |
805 | 800 |
806 | 801 |
807 class MarkBitCellIterator BASE_EMBEDDED { | 802 class MarkBitCellIterator BASE_EMBEDDED { |
808 public: | 803 public: |
809 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { | 804 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { |
810 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( | 805 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
811 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); | 806 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); |
812 cell_base_ = chunk_->area_start(); | 807 cell_base_ = chunk_->area_start(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 private: | 852 private: |
858 MarkCompactCollector* collector_; | 853 MarkCompactCollector* collector_; |
859 }; | 854 }; |
860 | 855 |
861 | 856 |
862 const char* AllocationSpaceName(AllocationSpace space); | 857 const char* AllocationSpaceName(AllocationSpace space); |
863 } // namespace internal | 858 } // namespace internal |
864 } // namespace v8 | 859 } // namespace v8 |
865 | 860 |
866 #endif // V8_HEAP_MARK_COMPACT_H_ | 861 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |