| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 | 631 |
| 632 enum SweepingParallelism { | 632 enum SweepingParallelism { |
| 633 SWEEP_SEQUENTIALLY, | 633 SWEEP_SEQUENTIALLY, |
| 634 SWEEP_IN_PARALLEL | 634 SWEEP_IN_PARALLEL |
| 635 }; | 635 }; |
| 636 | 636 |
| 637 #ifdef VERIFY_HEAP | 637 #ifdef VERIFY_HEAP |
| 638 void VerifyMarkbitsAreClean(); | 638 void VerifyMarkbitsAreClean(); |
| 639 static void VerifyMarkbitsAreClean(PagedSpace* space); | 639 static void VerifyMarkbitsAreClean(PagedSpace* space); |
| 640 static void VerifyMarkbitsAreClean(NewSpace* space); | 640 static void VerifyMarkbitsAreClean(NewSpace* space); |
| 641 void VerifyWeakEmbeddedObjectsInOptimizedCode(); | 641 void VerifyWeakEmbeddedObjectsInCode(); |
| 642 void VerifyOmittedMapChecks(); | 642 void VerifyOmittedMapChecks(); |
| 643 #endif | 643 #endif |
| 644 | 644 |
| 645 // Sweep a single page from the given space conservatively. | 645 // Sweep a single page from the given space conservatively. |
| 646 // Return a number of reclaimed bytes. | 646 // Return a number of reclaimed bytes. |
| 647 template<SweepingParallelism type> | 647 template<SweepingParallelism type> |
| 648 static intptr_t SweepConservatively(PagedSpace* space, | 648 static intptr_t SweepConservatively(PagedSpace* space, |
| 649 FreeList* free_list, | 649 FreeList* free_list, |
| 650 Page* p); | 650 Page* p); |
| 651 | 651 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 // heap object. | 892 // heap object. |
| 893 static bool IsUnmarkedHeapObject(Object** p); | 893 static bool IsUnmarkedHeapObject(Object** p); |
| 894 static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p); | 894 static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p); |
| 895 | 895 |
| 896 // Map transitions from a live map to a dead map must be killed. | 896 // Map transitions from a live map to a dead map must be killed. |
| 897 // We replace them with a null descriptor, with the same key. | 897 // We replace them with a null descriptor, with the same key. |
| 898 void ClearNonLiveReferences(); | 898 void ClearNonLiveReferences(); |
| 899 void ClearNonLivePrototypeTransitions(Map* map); | 899 void ClearNonLivePrototypeTransitions(Map* map); |
| 900 void ClearNonLiveMapTransitions(Map* map, MarkBit map_mark); | 900 void ClearNonLiveMapTransitions(Map* map, MarkBit map_mark); |
| 901 | 901 |
| 902 void ClearAndDeoptimizeDependentCode(DependentCode* dependent_code); | 902 void ClearDependentCode(DependentCode* dependent_code); |
| 903 void ClearDependentICList(Object* head); |
| 903 void ClearNonLiveDependentCode(DependentCode* dependent_code); | 904 void ClearNonLiveDependentCode(DependentCode* dependent_code); |
| 905 int ClearNonLiveDependentCodeInGroup(DependentCode* dependent_code, int group, |
| 906 int start, int end, int new_start); |
| 904 | 907 |
| 905 // Marking detaches initial maps from SharedFunctionInfo objects | 908 // Marking detaches initial maps from SharedFunctionInfo objects |
| 906 // to make this reference weak. We need to reattach initial maps | 909 // to make this reference weak. We need to reattach initial maps |
| 907 // back after collection. This is either done during | 910 // back after collection. This is either done during |
| 908 // ClearNonLiveTransitions pass or by calling this function. | 911 // ClearNonLiveTransitions pass or by calling this function. |
| 909 void ReattachInitialMaps(); | 912 void ReattachInitialMaps(); |
| 910 | 913 |
| 911 // Mark all values associated with reachable keys in weak collections | 914 // Mark all values associated with reachable keys in weak collections |
| 912 // encountered so far. This might push new object or even new weak maps onto | 915 // encountered so far. This might push new object or even new weak maps onto |
| 913 // the marking stack. | 916 // the marking stack. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 private: | 1038 private: |
| 1036 MarkCompactCollector* collector_; | 1039 MarkCompactCollector* collector_; |
| 1037 }; | 1040 }; |
| 1038 | 1041 |
| 1039 | 1042 |
| 1040 const char* AllocationSpaceName(AllocationSpace space); | 1043 const char* AllocationSpaceName(AllocationSpace space); |
| 1041 | 1044 |
| 1042 } } // namespace v8::internal | 1045 } } // namespace v8::internal |
| 1043 | 1046 |
| 1044 #endif // V8_MARK_COMPACT_H_ | 1047 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |