Chromium Code Reviews| 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 | 630 |
| 631 enum SweepingParallelism { | 631 enum SweepingParallelism { |
| 632 SWEEP_SEQUENTIALLY, | 632 SWEEP_SEQUENTIALLY, |
| 633 SWEEP_IN_PARALLEL | 633 SWEEP_IN_PARALLEL |
| 634 }; | 634 }; |
| 635 | 635 |
| 636 #ifdef VERIFY_HEAP | 636 #ifdef VERIFY_HEAP |
| 637 void VerifyMarkbitsAreClean(); | 637 void VerifyMarkbitsAreClean(); |
| 638 static void VerifyMarkbitsAreClean(PagedSpace* space); | 638 static void VerifyMarkbitsAreClean(PagedSpace* space); |
| 639 static void VerifyMarkbitsAreClean(NewSpace* space); | 639 static void VerifyMarkbitsAreClean(NewSpace* space); |
| 640 void VerifyWeakEmbeddedMapsInOptimizedCode(); | 640 void VerifyWeakEmbeddedObjectsInOptimizedCode(); |
| 641 void VerifyOmittedMapChecks(); | 641 void VerifyOmittedMapChecks(); |
| 642 #endif | 642 #endif |
| 643 | 643 |
| 644 // Sweep a single page from the given space conservatively. | 644 // Sweep a single page from the given space conservatively. |
| 645 // Return a number of reclaimed bytes. | 645 // Return a number of reclaimed bytes. |
| 646 template<SweepingParallelism type> | 646 template<SweepingParallelism type> |
| 647 static intptr_t SweepConservatively(PagedSpace* space, | 647 static intptr_t SweepConservatively(PagedSpace* space, |
| 648 FreeList* free_list, | 648 FreeList* free_list, |
| 649 Page* p); | 649 Page* p); |
| 650 | 650 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 835 // This is for non-incremental marking only. | 835 // This is for non-incremental marking only. |
| 836 INLINE(void SetMark(HeapObject* obj, MarkBit mark_bit)); | 836 INLINE(void SetMark(HeapObject* obj, MarkBit mark_bit)); |
| 837 | 837 |
| 838 // Mark the heap roots and all objects reachable from them. | 838 // Mark the heap roots and all objects reachable from them. |
| 839 void MarkRoots(RootMarkingVisitor* visitor); | 839 void MarkRoots(RootMarkingVisitor* visitor); |
| 840 | 840 |
| 841 // Mark the string table specially. References to internalized strings from | 841 // Mark the string table specially. References to internalized strings from |
| 842 // the string table are weak. | 842 // the string table are weak. |
| 843 void MarkStringTable(RootMarkingVisitor* visitor); | 843 void MarkStringTable(RootMarkingVisitor* visitor); |
| 844 | 844 |
| 845 // Mark the global table from weak objects to dependent code without | |
|
Hannes Payer (out of office)
2013/10/01 13:13:50
Mark the global table which maps weak objects to d
ulan
2013/10/01 14:50:29
Done.
| |
| 846 // marking its contents. | |
| 847 void MarkWeakObjectToCode(RootMarkingVisitor* visitor); | |
| 848 | |
| 845 // Mark objects in implicit references groups if their parent object | 849 // Mark objects in implicit references groups if their parent object |
| 846 // is marked. | 850 // is marked. |
| 847 void MarkImplicitRefGroups(); | 851 void MarkImplicitRefGroups(); |
| 848 | 852 |
| 849 // Mark objects reachable (transitively) from objects in the marking stack | 853 // Mark objects reachable (transitively) from objects in the marking stack |
| 850 // or overflowed in the heap. | 854 // or overflowed in the heap. |
| 851 void ProcessMarkingDeque(); | 855 void ProcessMarkingDeque(); |
| 852 | 856 |
| 853 // Mark objects reachable (transitively) from objects in the marking stack | 857 // Mark objects reachable (transitively) from objects in the marking stack |
| 854 // or overflowed in the heap. This respects references only considered in | 858 // or overflowed in the heap. This respects references only considered in |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 882 // heap object. | 886 // heap object. |
| 883 static bool IsUnmarkedHeapObject(Object** p); | 887 static bool IsUnmarkedHeapObject(Object** p); |
| 884 static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p); | 888 static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p); |
| 885 | 889 |
| 886 // Map transitions from a live map to a dead map must be killed. | 890 // Map transitions from a live map to a dead map must be killed. |
| 887 // We replace them with a null descriptor, with the same key. | 891 // We replace them with a null descriptor, with the same key. |
| 888 void ClearNonLiveReferences(); | 892 void ClearNonLiveReferences(); |
| 889 void ClearNonLivePrototypeTransitions(Map* map); | 893 void ClearNonLivePrototypeTransitions(Map* map); |
| 890 void ClearNonLiveMapTransitions(Map* map, MarkBit map_mark); | 894 void ClearNonLiveMapTransitions(Map* map, MarkBit map_mark); |
| 891 | 895 |
| 892 void ClearAndDeoptimizeDependentCode(Map* map); | 896 void ClearAndDeoptimizeDependentCode(DependentCode* dependent_code); |
| 893 void ClearNonLiveDependentCode(DependentCode* dependent_code); | 897 void ClearNonLiveDependentCode(DependentCode* dependent_code); |
| 894 | 898 |
| 895 // Marking detaches initial maps from SharedFunctionInfo objects | 899 // Marking detaches initial maps from SharedFunctionInfo objects |
| 896 // to make this reference weak. We need to reattach initial maps | 900 // to make this reference weak. We need to reattach initial maps |
| 897 // back after collection. This is either done during | 901 // back after collection. This is either done during |
| 898 // ClearNonLiveTransitions pass or by calling this function. | 902 // ClearNonLiveTransitions pass or by calling this function. |
| 899 void ReattachInitialMaps(); | 903 void ReattachInitialMaps(); |
| 900 | 904 |
| 901 // Mark all values associated with reachable keys in weak collections | 905 // Mark all values associated with reachable keys in weak collections |
| 902 // encountered so far. This might push new object or even new weak maps onto | 906 // encountered so far. This might push new object or even new weak maps onto |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1016 private: | 1020 private: |
| 1017 MarkCompactCollector* collector_; | 1021 MarkCompactCollector* collector_; |
| 1018 }; | 1022 }; |
| 1019 | 1023 |
| 1020 | 1024 |
| 1021 const char* AllocationSpaceName(AllocationSpace space); | 1025 const char* AllocationSpaceName(AllocationSpace space); |
| 1022 | 1026 |
| 1023 } } // namespace v8::internal | 1027 } } // namespace v8::internal |
| 1024 | 1028 |
| 1025 #endif // V8_MARK_COMPACT_H_ | 1029 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |