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