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 <deque> | 8 #include <deque> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 template <class Evacuator, class Collector> | 320 template <class Evacuator, class Collector> |
321 void CreateAndExecuteEvacuationTasks( | 321 void CreateAndExecuteEvacuationTasks( |
322 Collector* collector, PageParallelJob<EvacuationJobTraits>* job, | 322 Collector* collector, PageParallelJob<EvacuationJobTraits>* job, |
323 RecordMigratedSlotVisitor* record_visitor, | 323 RecordMigratedSlotVisitor* record_visitor, |
324 MigrationObserver* migration_observer, const intptr_t live_bytes, | 324 MigrationObserver* migration_observer, const intptr_t live_bytes, |
325 const int& abandoned_pages); | 325 const int& abandoned_pages); |
326 | 326 |
327 // Returns whether this page should be moved according to heuristics. | 327 // Returns whether this page should be moved according to heuristics. |
328 bool ShouldMovePage(Page* p, intptr_t live_bytes); | 328 bool ShouldMovePage(Page* p, intptr_t live_bytes); |
329 | 329 |
| 330 int NumberOfParallelCompactionTasks(int pages); |
| 331 int NumberOfPointerUpdateTasks(int pages); |
| 332 |
330 Heap* heap_; | 333 Heap* heap_; |
331 }; | 334 }; |
332 | 335 |
333 // Collector for young-generation only. | 336 // Collector for young-generation only. |
334 class MinorMarkCompactCollector final : public MarkCompactCollectorBase { | 337 class MinorMarkCompactCollector final : public MarkCompactCollectorBase { |
335 public: | 338 public: |
336 explicit MinorMarkCompactCollector(Heap* heap) | 339 explicit MinorMarkCompactCollector(Heap* heap) |
337 : MarkCompactCollectorBase(heap), | 340 : MarkCompactCollectorBase(heap), |
338 marking_deque_(heap), | 341 marking_deque_(heap), |
339 page_parallel_job_semaphore_(0) {} | 342 page_parallel_job_semaphore_(0) {} |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 ~EvacuationScope() { collector_->set_evacuation(false); } | 757 ~EvacuationScope() { collector_->set_evacuation(false); } |
755 | 758 |
756 private: | 759 private: |
757 MarkCompactCollector* collector_; | 760 MarkCompactCollector* collector_; |
758 }; | 761 }; |
759 | 762 |
760 } // namespace internal | 763 } // namespace internal |
761 } // namespace v8 | 764 } // namespace v8 |
762 | 765 |
763 #endif // V8_HEAP_MARK_COMPACT_H_ | 766 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |