| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 737 |
| 738 // Mark the global table which maps weak objects to dependent code without | 738 // Mark the global table which maps weak objects to dependent code without |
| 739 // marking its contents. | 739 // marking its contents. |
| 740 void MarkWeakObjectToCodeTable(); | 740 void MarkWeakObjectToCodeTable(); |
| 741 | 741 |
| 742 // Special case for processing weak references in a full collection. We need | 742 // Special case for processing weak references in a full collection. We need |
| 743 // to artifically keep AllocationSites alive for a time. | 743 // to artifically keep AllocationSites alive for a time. |
| 744 void MarkAllocationSite(AllocationSite* site); | 744 void MarkAllocationSite(AllocationSite* site); |
| 745 | 745 |
| 746 private: | 746 private: |
| 747 class SweeperTask; | |
| 748 | |
| 749 explicit MarkCompactCollector(Heap* heap); | 747 explicit MarkCompactCollector(Heap* heap); |
| 750 ~MarkCompactCollector(); | 748 ~MarkCompactCollector(); |
| 751 | 749 |
| 752 bool MarkInvalidatedCode(); | 750 bool MarkInvalidatedCode(); |
| 753 bool WillBeDeoptimized(Code* code); | 751 bool WillBeDeoptimized(Code* code); |
| 754 void RemoveDeadInvalidatedCode(); | 752 void RemoveDeadInvalidatedCode(); |
| 755 void ProcessInvalidatedCode(ObjectVisitor* visitor); | 753 void ProcessInvalidatedCode(ObjectVisitor* visitor); |
| 756 | 754 |
| 757 void UnlinkEvacuationCandidates(); | 755 void UnlinkEvacuationCandidates(); |
| 758 void ReleaseEvacuationCandidates(); | 756 void ReleaseEvacuationCandidates(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 786 | 784 |
| 787 // True if we are collecting slots to perform evacuation from evacuation | 785 // True if we are collecting slots to perform evacuation from evacuation |
| 788 // candidates. | 786 // candidates. |
| 789 bool compacting_; | 787 bool compacting_; |
| 790 | 788 |
| 791 bool was_marked_incrementally_; | 789 bool was_marked_incrementally_; |
| 792 | 790 |
| 793 // True if concurrent or parallel sweeping is currently in progress. | 791 // True if concurrent or parallel sweeping is currently in progress. |
| 794 bool sweeping_pending_; | 792 bool sweeping_pending_; |
| 795 | 793 |
| 796 Semaphore pending_sweeper_jobs_semaphore_; | |
| 797 | |
| 798 bool sequential_sweeping_; | 794 bool sequential_sweeping_; |
| 799 | 795 |
| 800 // A pointer to the current stack-allocated GC tracer object during a full | 796 // A pointer to the current stack-allocated GC tracer object during a full |
| 801 // collection (NULL before and after). | 797 // collection (NULL before and after). |
| 802 GCTracer* tracer_; | 798 GCTracer* tracer_; |
| 803 | 799 |
| 804 SlotsBufferAllocator slots_buffer_allocator_; | 800 SlotsBufferAllocator slots_buffer_allocator_; |
| 805 | 801 |
| 806 SlotsBuffer* migration_slots_buffer_; | 802 SlotsBuffer* migration_slots_buffer_; |
| 807 | 803 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 void EvacuateNewSpace(); | 933 void EvacuateNewSpace(); |
| 938 | 934 |
| 939 void EvacuateLiveObjectsFromPage(Page* p); | 935 void EvacuateLiveObjectsFromPage(Page* p); |
| 940 | 936 |
| 941 void EvacuatePages(); | 937 void EvacuatePages(); |
| 942 | 938 |
| 943 void EvacuateNewSpaceAndCandidates(); | 939 void EvacuateNewSpaceAndCandidates(); |
| 944 | 940 |
| 945 void SweepSpace(PagedSpace* space, SweeperType sweeper); | 941 void SweepSpace(PagedSpace* space, SweeperType sweeper); |
| 946 | 942 |
| 947 // Finalizes the parallel sweeping phase. Marks all the pages that were | |
| 948 // swept in parallel. | |
| 949 void ParallelSweepSpacesComplete(); | |
| 950 | |
| 951 void ParallelSweepSpaceComplete(PagedSpace* space); | |
| 952 | |
| 953 #ifdef DEBUG | 943 #ifdef DEBUG |
| 954 friend class MarkObjectVisitor; | 944 friend class MarkObjectVisitor; |
| 955 static void VisitObject(HeapObject* obj); | 945 static void VisitObject(HeapObject* obj); |
| 956 | 946 |
| 957 friend class UnmarkObjectVisitor; | 947 friend class UnmarkObjectVisitor; |
| 958 static void UnmarkObject(HeapObject* obj); | 948 static void UnmarkObject(HeapObject* obj); |
| 959 #endif | 949 #endif |
| 960 | 950 |
| 961 Heap* heap_; | 951 Heap* heap_; |
| 962 MarkingDeque marking_deque_; | 952 MarkingDeque marking_deque_; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 private: | 1022 private: |
| 1033 MarkCompactCollector* collector_; | 1023 MarkCompactCollector* collector_; |
| 1034 }; | 1024 }; |
| 1035 | 1025 |
| 1036 | 1026 |
| 1037 const char* AllocationSpaceName(AllocationSpace space); | 1027 const char* AllocationSpaceName(AllocationSpace space); |
| 1038 | 1028 |
| 1039 } } // namespace v8::internal | 1029 } } // namespace v8::internal |
| 1040 | 1030 |
| 1041 #endif // V8_MARK_COMPACT_H_ | 1031 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |