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