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 "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 | 10 |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 bool evacuation() const { return evacuation_; } | 648 bool evacuation() const { return evacuation_; } |
649 | 649 |
650 // Mark the global table which maps weak objects to dependent code without | 650 // Mark the global table which maps weak objects to dependent code without |
651 // marking its contents. | 651 // marking its contents. |
652 void MarkWeakObjectToCodeTable(); | 652 void MarkWeakObjectToCodeTable(); |
653 | 653 |
654 // Special case for processing weak references in a full collection. We need | 654 // Special case for processing weak references in a full collection. We need |
655 // to artificially keep AllocationSites alive for a time. | 655 // to artificially keep AllocationSites alive for a time. |
656 void MarkAllocationSite(AllocationSite* site); | 656 void MarkAllocationSite(AllocationSite* site); |
657 | 657 |
| 658 MarkingDeque* marking_deque() { return &marking_deque_; } |
| 659 |
| 660 void EnsureMarkingDequeIsCommittedAndInitialize(); |
| 661 |
| 662 void InitializeMarkingDeque(); |
| 663 |
| 664 void UncommitMarkingDeque(); |
| 665 |
658 private: | 666 private: |
659 class SweeperTask; | 667 class SweeperTask; |
660 | 668 |
661 explicit MarkCompactCollector(Heap* heap); | 669 explicit MarkCompactCollector(Heap* heap); |
662 ~MarkCompactCollector(); | 670 ~MarkCompactCollector(); |
663 | 671 |
664 bool MarkInvalidatedCode(); | 672 bool MarkInvalidatedCode(); |
665 bool WillBeDeoptimized(Code* code); | 673 bool WillBeDeoptimized(Code* code); |
666 void RemoveDeadInvalidatedCode(); | 674 void RemoveDeadInvalidatedCode(); |
667 void ProcessInvalidatedCode(ObjectVisitor* visitor); | 675 void ProcessInvalidatedCode(ObjectVisitor* visitor); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 876 |
869 #ifdef DEBUG | 877 #ifdef DEBUG |
870 friend class MarkObjectVisitor; | 878 friend class MarkObjectVisitor; |
871 static void VisitObject(HeapObject* obj); | 879 static void VisitObject(HeapObject* obj); |
872 | 880 |
873 friend class UnmarkObjectVisitor; | 881 friend class UnmarkObjectVisitor; |
874 static void UnmarkObject(HeapObject* obj); | 882 static void UnmarkObject(HeapObject* obj); |
875 #endif | 883 #endif |
876 | 884 |
877 Heap* heap_; | 885 Heap* heap_; |
| 886 base::VirtualMemory* marking_deque_memory_; |
| 887 bool marking_deque_memory_committed_; |
878 MarkingDeque marking_deque_; | 888 MarkingDeque marking_deque_; |
879 CodeFlusher* code_flusher_; | 889 CodeFlusher* code_flusher_; |
880 bool have_code_to_deoptimize_; | 890 bool have_code_to_deoptimize_; |
881 | 891 |
882 List<Page*> evacuation_candidates_; | 892 List<Page*> evacuation_candidates_; |
883 List<Code*> invalidated_code_; | 893 List<Code*> invalidated_code_; |
884 | 894 |
885 SmartPointer<FreeList> free_list_old_data_space_; | 895 SmartPointer<FreeList> free_list_old_data_space_; |
886 SmartPointer<FreeList> free_list_old_pointer_space_; | 896 SmartPointer<FreeList> free_list_old_pointer_space_; |
887 | 897 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 private: | 952 private: |
943 MarkCompactCollector* collector_; | 953 MarkCompactCollector* collector_; |
944 }; | 954 }; |
945 | 955 |
946 | 956 |
947 const char* AllocationSpaceName(AllocationSpace space); | 957 const char* AllocationSpaceName(AllocationSpace space); |
948 } | 958 } |
949 } // namespace v8::internal | 959 } // namespace v8::internal |
950 | 960 |
951 #endif // V8_HEAP_MARK_COMPACT_H_ | 961 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |