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 #include "src/heap/store-buffer.h" | 10 #include "src/heap/store-buffer.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 case CODE_SPACE: | 570 case CODE_SPACE: |
571 return &swept_code_space_pages_; | 571 return &swept_code_space_pages_; |
572 case MAP_SPACE: | 572 case MAP_SPACE: |
573 return &swept_map_space_pages_; | 573 return &swept_map_space_pages_; |
574 default: | 574 default: |
575 UNREACHABLE(); | 575 UNREACHABLE(); |
576 } | 576 } |
577 return nullptr; | 577 return nullptr; |
578 } | 578 } |
579 | 579 |
| 580 std::vector<std::pair<Value*, Value*>>& wrappers_to_trace() { |
| 581 return wrappers_to_trace_; |
| 582 } |
| 583 |
580 private: | 584 private: |
581 class EvacuateNewSpaceVisitor; | 585 class EvacuateNewSpaceVisitor; |
582 class EvacuateOldSpaceVisitor; | 586 class EvacuateOldSpaceVisitor; |
583 class EvacuateVisitorBase; | 587 class EvacuateVisitorBase; |
584 class HeapObjectVisitor; | 588 class HeapObjectVisitor; |
585 class SweeperTask; | 589 class SweeperTask; |
586 | 590 |
587 typedef std::vector<Page*> SweepingList; | 591 typedef std::vector<Page*> SweepingList; |
588 | 592 |
589 explicit MarkCompactCollector(Heap* heap); | 593 explicit MarkCompactCollector(Heap* heap); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 void MarkStringTable(RootMarkingVisitor* visitor); | 675 void MarkStringTable(RootMarkingVisitor* visitor); |
672 | 676 |
673 // Mark objects reachable (transitively) from objects in the marking stack | 677 // Mark objects reachable (transitively) from objects in the marking stack |
674 // or overflowed in the heap. | 678 // or overflowed in the heap. |
675 void ProcessMarkingDeque(); | 679 void ProcessMarkingDeque(); |
676 | 680 |
677 // Mark objects reachable (transitively) from objects in the marking stack | 681 // Mark objects reachable (transitively) from objects in the marking stack |
678 // or overflowed in the heap. This respects references only considered in | 682 // or overflowed in the heap. This respects references only considered in |
679 // the final atomic marking pause including the following: | 683 // the final atomic marking pause including the following: |
680 // - Processing of objects reachable through Harmony WeakMaps. | 684 // - Processing of objects reachable through Harmony WeakMaps. |
681 // - Objects reachable due to host application logic like object groups | 685 // - Objects reachable due to host application logic like object groups, |
682 // or implicit references' groups. | 686 // implicit references' groups, or embedder heap tracing. |
683 void ProcessEphemeralMarking(ObjectVisitor* visitor, | 687 void ProcessEphemeralMarking(ObjectVisitor* visitor, |
684 bool only_process_harmony_weak_collections); | 688 bool only_process_harmony_weak_collections); |
685 | 689 |
686 // If the call-site of the top optimized code was not prepared for | 690 // If the call-site of the top optimized code was not prepared for |
687 // deoptimization, then treat the maps in the code as strong pointers, | 691 // deoptimization, then treat the maps in the code as strong pointers, |
688 // otherwise a map can die and deoptimize the code. | 692 // otherwise a map can die and deoptimize the code. |
689 void ProcessTopOptimizedFrame(ObjectVisitor* visitor); | 693 void ProcessTopOptimizedFrame(ObjectVisitor* visitor); |
690 | 694 |
691 // Collects a list of dependent code from maps embedded in optimize code. | 695 // Collects a list of dependent code from maps embedded in optimize code. |
692 DependentCode* DependentCodeListFromNonLiveMaps(); | 696 DependentCode* DependentCodeListFromNonLiveMaps(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 static void VisitObject(HeapObject* obj); | 810 static void VisitObject(HeapObject* obj); |
807 | 811 |
808 friend class UnmarkObjectVisitor; | 812 friend class UnmarkObjectVisitor; |
809 static void UnmarkObject(HeapObject* obj); | 813 static void UnmarkObject(HeapObject* obj); |
810 #endif | 814 #endif |
811 | 815 |
812 Heap* heap_; | 816 Heap* heap_; |
813 base::VirtualMemory* marking_deque_memory_; | 817 base::VirtualMemory* marking_deque_memory_; |
814 size_t marking_deque_memory_committed_; | 818 size_t marking_deque_memory_committed_; |
815 MarkingDeque marking_deque_; | 819 MarkingDeque marking_deque_; |
| 820 std::vector<std::pair<Value*, Value*>> wrappers_to_trace_; |
| 821 |
816 CodeFlusher* code_flusher_; | 822 CodeFlusher* code_flusher_; |
817 bool have_code_to_deoptimize_; | 823 bool have_code_to_deoptimize_; |
818 | 824 |
819 List<Page*> evacuation_candidates_; | 825 List<Page*> evacuation_candidates_; |
820 List<NewSpacePage*> newspace_evacuation_candidates_; | 826 List<NewSpacePage*> newspace_evacuation_candidates_; |
821 | 827 |
822 base::Mutex swept_pages_mutex_; | 828 base::Mutex swept_pages_mutex_; |
823 List<Page*> swept_old_space_pages_; | 829 List<Page*> swept_old_space_pages_; |
824 List<Page*> swept_code_space_pages_; | 830 List<Page*> swept_code_space_pages_; |
825 List<Page*> swept_map_space_pages_; | 831 List<Page*> swept_map_space_pages_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 private: | 866 private: |
861 MarkCompactCollector* collector_; | 867 MarkCompactCollector* collector_; |
862 }; | 868 }; |
863 | 869 |
864 | 870 |
865 const char* AllocationSpaceName(AllocationSpace space); | 871 const char* AllocationSpaceName(AllocationSpace space); |
866 } // namespace internal | 872 } // namespace internal |
867 } // namespace v8 | 873 } // namespace v8 |
868 | 874 |
869 #endif // V8_HEAP_MARK_COMPACT_H_ | 875 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |