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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 private: | 323 private: |
324 inline Heap* heap() { return chunk_->heap(); } | 324 inline Heap* heap() { return chunk_->heap(); } |
325 | 325 |
326 MemoryChunk* chunk_; | 326 MemoryChunk* chunk_; |
327 MarkBitCellIterator it_; | 327 MarkBitCellIterator it_; |
328 Address cell_base_; | 328 Address cell_base_; |
329 MarkBit::CellType current_cell_; | 329 MarkBit::CellType current_cell_; |
330 }; | 330 }; |
331 | 331 |
| 332 enum PageEvacuationMode { NEW_TO_NEW, NEW_TO_OLD }; |
| 333 |
332 // ------------------------------------------------------------------------- | 334 // ------------------------------------------------------------------------- |
333 // Mark-Compact collector | 335 // Mark-Compact collector |
334 class MarkCompactCollector { | 336 class MarkCompactCollector { |
335 public: | 337 public: |
336 class Evacuator; | 338 class Evacuator; |
337 | 339 |
338 class Sweeper { | 340 class Sweeper { |
339 public: | 341 public: |
340 class SweeperTask; | 342 class SweeperTask; |
341 | 343 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 521 |
520 // Mark objects in implicit references groups if their parent object | 522 // Mark objects in implicit references groups if their parent object |
521 // is marked. | 523 // is marked. |
522 void MarkImplicitRefGroups(MarkObjectFunction mark_object); | 524 void MarkImplicitRefGroups(MarkObjectFunction mark_object); |
523 | 525 |
524 MarkingDeque* marking_deque() { return &marking_deque_; } | 526 MarkingDeque* marking_deque() { return &marking_deque_; } |
525 | 527 |
526 Sweeper& sweeper() { return sweeper_; } | 528 Sweeper& sweeper() { return sweeper_; } |
527 | 529 |
528 private: | 530 private: |
| 531 template <PageEvacuationMode mode> |
529 class EvacuateNewSpacePageVisitor; | 532 class EvacuateNewSpacePageVisitor; |
530 class EvacuateNewSpaceVisitor; | 533 class EvacuateNewSpaceVisitor; |
531 class EvacuateOldSpaceVisitor; | 534 class EvacuateOldSpaceVisitor; |
532 class EvacuateRecordOnlyVisitor; | 535 class EvacuateRecordOnlyVisitor; |
533 class EvacuateVisitorBase; | 536 class EvacuateVisitorBase; |
534 class HeapObjectVisitor; | 537 class HeapObjectVisitor; |
535 class ObjectStatsVisitor; | 538 class ObjectStatsVisitor; |
536 | 539 |
537 explicit MarkCompactCollector(Heap* heap); | 540 explicit MarkCompactCollector(Heap* heap); |
538 | 541 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 | 774 |
772 private: | 775 private: |
773 MarkCompactCollector* collector_; | 776 MarkCompactCollector* collector_; |
774 }; | 777 }; |
775 | 778 |
776 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); | 779 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); |
777 } // namespace internal | 780 } // namespace internal |
778 } // namespace v8 | 781 } // namespace v8 |
779 | 782 |
780 #endif // V8_HEAP_MARK_COMPACT_H_ | 783 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |