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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 void UpdateSlots(SlotsBuffer* buffer); | 478 void UpdateSlots(SlotsBuffer* buffer); |
479 void UpdateSlotsRecordedIn(SlotsBuffer* buffer); | 479 void UpdateSlotsRecordedIn(SlotsBuffer* buffer); |
480 | 480 |
481 void InvalidateCode(Code* code); | 481 void InvalidateCode(Code* code); |
482 | 482 |
483 void ClearMarkbits(); | 483 void ClearMarkbits(); |
484 | 484 |
485 bool is_compacting() const { return compacting_; } | 485 bool is_compacting() const { return compacting_; } |
486 | 486 |
487 MarkingParity marking_parity() { return marking_parity_; } | |
488 | |
489 // Ensures that sweeping is finished. | 487 // Ensures that sweeping is finished. |
490 // | 488 // |
491 // Note: Can only be called safely from main thread. | 489 // Note: Can only be called safely from main thread. |
492 void EnsureSweepingCompleted(); | 490 void EnsureSweepingCompleted(); |
493 | 491 |
494 // Help out in sweeping the corresponding space and refill memory that has | 492 // Help out in sweeping the corresponding space and refill memory that has |
495 // been regained. | 493 // been regained. |
496 // | 494 // |
497 // Note: Thread-safe. | 495 // Note: Thread-safe. |
498 void SweepAndRefill(CompactionSpace* space); | 496 void SweepAndRefill(CompactionSpace* space); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 SWEEP_SPACES, | 737 SWEEP_SPACES, |
740 ENCODE_FORWARDING_ADDRESSES, | 738 ENCODE_FORWARDING_ADDRESSES, |
741 UPDATE_POINTERS, | 739 UPDATE_POINTERS, |
742 RELOCATE_OBJECTS | 740 RELOCATE_OBJECTS |
743 }; | 741 }; |
744 | 742 |
745 // The current stage of the collector. | 743 // The current stage of the collector. |
746 CollectorState state_; | 744 CollectorState state_; |
747 #endif | 745 #endif |
748 | 746 |
749 MarkingParity marking_parity_; | |
750 | |
751 bool was_marked_incrementally_; | 747 bool was_marked_incrementally_; |
752 | 748 |
753 bool evacuation_; | 749 bool evacuation_; |
754 | 750 |
755 // True if we are collecting slots to perform evacuation from evacuation | 751 // True if we are collecting slots to perform evacuation from evacuation |
756 // candidates. | 752 // candidates. |
757 bool compacting_; | 753 bool compacting_; |
758 | 754 |
759 bool black_allocation_; | 755 bool black_allocation_; |
760 | 756 |
(...skipping 24 matching lines...) Expand all Loading... |
785 | 781 |
786 private: | 782 private: |
787 MarkCompactCollector* collector_; | 783 MarkCompactCollector* collector_; |
788 }; | 784 }; |
789 | 785 |
790 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); | 786 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); |
791 } // namespace internal | 787 } // namespace internal |
792 } // namespace v8 | 788 } // namespace v8 |
793 | 789 |
794 #endif // V8_HEAP_MARK_COMPACT_H_ | 790 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |