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