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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 623 |
624 bool UsingEmbedderHeapTracer() { return embedder_heap_tracer(); } | 624 bool UsingEmbedderHeapTracer() { return embedder_heap_tracer(); } |
625 | 625 |
626 void TracePossibleWrapper(JSObject* js_object); | 626 void TracePossibleWrapper(JSObject* js_object); |
627 | 627 |
628 void RegisterExternallyReferencedObject(Object** object); | 628 void RegisterExternallyReferencedObject(Object** object); |
629 | 629 |
630 private: | 630 private: |
631 class EvacuateNewSpaceVisitor; | 631 class EvacuateNewSpaceVisitor; |
632 class EvacuateOldSpaceVisitor; | 632 class EvacuateOldSpaceVisitor; |
633 class EvacuateRecordOnlyVisitor; | |
634 class EvacuateVisitorBase; | 633 class EvacuateVisitorBase; |
635 class HeapObjectVisitor; | 634 class HeapObjectVisitor; |
636 | 635 |
637 typedef std::vector<Page*> SweepingList; | 636 typedef std::vector<Page*> SweepingList; |
638 | 637 |
639 explicit MarkCompactCollector(Heap* heap); | 638 explicit MarkCompactCollector(Heap* heap); |
640 | 639 |
641 bool WillBeDeoptimized(Code* code); | 640 bool WillBeDeoptimized(Code* code); |
642 void ClearInvalidRememberedSetSlots(); | 641 void ClearInvalidRememberedSetSlots(); |
643 | 642 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 827 |
829 // Iterates through all live objects on a page using marking information. | 828 // Iterates through all live objects on a page using marking information. |
830 // Returns whether all objects have successfully been visited. | 829 // Returns whether all objects have successfully been visited. |
831 bool VisitLiveObjects(MemoryChunk* page, HeapObjectVisitor* visitor, | 830 bool VisitLiveObjects(MemoryChunk* page, HeapObjectVisitor* visitor, |
832 IterationMode mode); | 831 IterationMode mode); |
833 | 832 |
834 void VisitLiveObjectsBody(Page* page, ObjectVisitor* visitor); | 833 void VisitLiveObjectsBody(Page* page, ObjectVisitor* visitor); |
835 | 834 |
836 void RecomputeLiveBytes(MemoryChunk* page); | 835 void RecomputeLiveBytes(MemoryChunk* page); |
837 | 836 |
| 837 void SweepAbortedPages(); |
| 838 |
838 void ReleaseEvacuationCandidates(); | 839 void ReleaseEvacuationCandidates(); |
839 | 840 |
840 // Starts sweeping of a space by contributing on the main thread and setting | 841 // Starts sweeping of a space by contributing on the main thread and setting |
841 // up other pages for sweeping. | 842 // up other pages for sweeping. |
842 void StartSweepSpace(PagedSpace* space); | 843 void StartSweepSpace(PagedSpace* space); |
843 | 844 |
844 #ifdef DEBUG | 845 #ifdef DEBUG |
845 friend class MarkObjectVisitor; | 846 friend class MarkObjectVisitor; |
846 static void VisitObject(HeapObject* obj); | 847 static void VisitObject(HeapObject* obj); |
847 | 848 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 private: | 893 private: |
893 MarkCompactCollector* collector_; | 894 MarkCompactCollector* collector_; |
894 }; | 895 }; |
895 | 896 |
896 | 897 |
897 const char* AllocationSpaceName(AllocationSpace space); | 898 const char* AllocationSpaceName(AllocationSpace space); |
898 } // namespace internal | 899 } // namespace internal |
899 } // namespace v8 | 900 } // namespace v8 |
900 | 901 |
901 #endif // V8_HEAP_MARK_COMPACT_H_ | 902 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |