| 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 #include "src/heap/store-buffer.h" | 10 #include "src/heap/store-buffer.h" |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 | 834 |
| 835 // True if concurrent or parallel sweeping is currently in progress. | 835 // True if concurrent or parallel sweeping is currently in progress. |
| 836 bool sweeping_in_progress_; | 836 bool sweeping_in_progress_; |
| 837 | 837 |
| 838 // Semaphore used to synchronize sweeper tasks. | 838 // Semaphore used to synchronize sweeper tasks. |
| 839 base::Semaphore pending_sweeper_tasks_semaphore_; | 839 base::Semaphore pending_sweeper_tasks_semaphore_; |
| 840 | 840 |
| 841 // Semaphore used to synchronize compaction tasks. | 841 // Semaphore used to synchronize compaction tasks. |
| 842 base::Semaphore pending_compaction_tasks_semaphore_; | 842 base::Semaphore pending_compaction_tasks_semaphore_; |
| 843 | 843 |
| 844 base::Semaphore page_parallel_job_semaphore_; |
| 845 |
| 844 bool black_allocation_; | 846 bool black_allocation_; |
| 845 | 847 |
| 846 friend class Heap; | 848 friend class Heap; |
| 847 friend class StoreBuffer; | 849 friend class StoreBuffer; |
| 848 }; | 850 }; |
| 849 | 851 |
| 850 | 852 |
| 851 class EvacuationScope BASE_EMBEDDED { | 853 class EvacuationScope BASE_EMBEDDED { |
| 852 public: | 854 public: |
| 853 explicit EvacuationScope(MarkCompactCollector* collector) | 855 explicit EvacuationScope(MarkCompactCollector* collector) |
| 854 : collector_(collector) { | 856 : collector_(collector) { |
| 855 collector_->set_evacuation(true); | 857 collector_->set_evacuation(true); |
| 856 } | 858 } |
| 857 | 859 |
| 858 ~EvacuationScope() { collector_->set_evacuation(false); } | 860 ~EvacuationScope() { collector_->set_evacuation(false); } |
| 859 | 861 |
| 860 private: | 862 private: |
| 861 MarkCompactCollector* collector_; | 863 MarkCompactCollector* collector_; |
| 862 }; | 864 }; |
| 863 | 865 |
| 864 | 866 |
| 865 const char* AllocationSpaceName(AllocationSpace space); | 867 const char* AllocationSpaceName(AllocationSpace space); |
| 866 } // namespace internal | 868 } // namespace internal |
| 867 } // namespace v8 | 869 } // namespace v8 |
| 868 | 870 |
| 869 #endif // V8_HEAP_MARK_COMPACT_H_ | 871 #endif // V8_HEAP_MARK_COMPACT_H_ |
| OLD | NEW |