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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 INLINE(static void MarkWhite(MarkBit mark_bit)) { | 76 INLINE(static void MarkWhite(MarkBit mark_bit)) { |
77 mark_bit.Clear(); | 77 mark_bit.Clear(); |
78 mark_bit.Next().Clear(); | 78 mark_bit.Next().Clear(); |
79 } | 79 } |
80 | 80 |
81 INLINE(static void BlackToWhite(MarkBit markbit)) { | 81 INLINE(static void BlackToWhite(MarkBit markbit)) { |
82 DCHECK(IsBlack(markbit)); | 82 DCHECK(IsBlack(markbit)); |
83 markbit.Clear(); | 83 markbit.Clear(); |
84 } | 84 } |
85 | 85 |
| 86 INLINE(static void GreyToWhite(MarkBit markbit)) { |
| 87 DCHECK(IsGrey(markbit)); |
| 88 markbit.Clear(); |
| 89 markbit.Next().Clear(); |
| 90 } |
| 91 |
86 INLINE(static void BlackToGrey(MarkBit markbit)) { | 92 INLINE(static void BlackToGrey(MarkBit markbit)) { |
87 DCHECK(IsBlack(markbit)); | 93 DCHECK(IsBlack(markbit)); |
88 markbit.Next().Set(); | 94 markbit.Next().Set(); |
89 } | 95 } |
90 | 96 |
91 INLINE(static void WhiteToGrey(MarkBit markbit)) { | 97 INLINE(static void WhiteToGrey(MarkBit markbit)) { |
92 DCHECK(IsWhite(markbit)); | 98 DCHECK(IsWhite(markbit)); |
93 markbit.Set(); | 99 markbit.Set(); |
94 markbit.Next().Set(); | 100 markbit.Next().Set(); |
95 } | 101 } |
(...skipping 10 matching lines...) Expand all Loading... |
106 | 112 |
107 INLINE(static void BlackToGrey(HeapObject* obj)) { | 113 INLINE(static void BlackToGrey(HeapObject* obj)) { |
108 BlackToGrey(MarkBitFrom(obj)); | 114 BlackToGrey(MarkBitFrom(obj)); |
109 } | 115 } |
110 | 116 |
111 INLINE(static void AnyToGrey(MarkBit markbit)) { | 117 INLINE(static void AnyToGrey(MarkBit markbit)) { |
112 markbit.Set(); | 118 markbit.Set(); |
113 markbit.Next().Set(); | 119 markbit.Next().Set(); |
114 } | 120 } |
115 | 121 |
| 122 static void TransferMark(Heap* heap, Address old_start, Address new_start); |
| 123 |
116 #ifdef DEBUG | 124 #ifdef DEBUG |
117 enum ObjectColor { | 125 enum ObjectColor { |
118 BLACK_OBJECT, | 126 BLACK_OBJECT, |
119 WHITE_OBJECT, | 127 WHITE_OBJECT, |
120 GREY_OBJECT, | 128 GREY_OBJECT, |
121 IMPOSSIBLE_COLOR | 129 IMPOSSIBLE_COLOR |
122 }; | 130 }; |
123 | 131 |
124 static const char* ColorName(ObjectColor color) { | 132 static const char* ColorName(ObjectColor color) { |
125 switch (color) { | 133 switch (color) { |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 private: | 866 private: |
859 MarkCompactCollector* collector_; | 867 MarkCompactCollector* collector_; |
860 }; | 868 }; |
861 | 869 |
862 | 870 |
863 const char* AllocationSpaceName(AllocationSpace space); | 871 const char* AllocationSpaceName(AllocationSpace space); |
864 } // namespace internal | 872 } // namespace internal |
865 } // namespace v8 | 873 } // namespace v8 |
866 | 874 |
867 #endif // V8_HEAP_MARK_COMPACT_H_ | 875 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |