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 template <RememberedSetType type> |
| 331 void UpdatePointersInParallel(Heap* heap, base::Semaphore* semaphore, |
| 332 const MarkCompactCollectorBase* collector); |
| 333 |
| 334 int NumberOfParallelCompactionTasks(int pages); |
| 335 int NumberOfPointerUpdateTasks(int pages); |
| 336 |
330 Heap* heap_; | 337 Heap* heap_; |
331 }; | 338 }; |
332 | 339 |
333 // Collector for young-generation only. | 340 // Collector for young-generation only. |
334 class MinorMarkCompactCollector final : public MarkCompactCollectorBase { | 341 class MinorMarkCompactCollector final : public MarkCompactCollectorBase { |
335 public: | 342 public: |
336 explicit MinorMarkCompactCollector(Heap* heap) | 343 explicit MinorMarkCompactCollector(Heap* heap) |
337 : MarkCompactCollectorBase(heap), | 344 : MarkCompactCollectorBase(heap), |
338 marking_deque_(heap), | 345 marking_deque_(heap), |
339 page_parallel_job_semaphore_(0) {} | 346 page_parallel_job_semaphore_(0) {} |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 ~EvacuationScope() { collector_->set_evacuation(false); } | 761 ~EvacuationScope() { collector_->set_evacuation(false); } |
755 | 762 |
756 private: | 763 private: |
757 MarkCompactCollector* collector_; | 764 MarkCompactCollector* collector_; |
758 }; | 765 }; |
759 | 766 |
760 } // namespace internal | 767 } // namespace internal |
761 } // namespace v8 | 768 } // namespace v8 |
762 | 769 |
763 #endif // V8_HEAP_MARK_COMPACT_H_ | 770 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |