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 <deque> | 8 #include <deque> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 V8_INLINE static bool IsGrey(HeapObject* obj) { | 66 V8_INLINE static bool IsGrey(HeapObject* obj) { |
67 return Marking::IsGrey(MarkBitFrom<mode>(obj)); | 67 return Marking::IsGrey(MarkBitFrom<mode>(obj)); |
68 } | 68 } |
69 | 69 |
70 template <MarkingMode mode = MarkingMode::FULL> | 70 template <MarkingMode mode = MarkingMode::FULL> |
71 V8_INLINE static bool IsBlackOrGrey(HeapObject* obj) { | 71 V8_INLINE static bool IsBlackOrGrey(HeapObject* obj) { |
72 return Marking::IsBlackOrGrey(MarkBitFrom<mode>(obj)); | 72 return Marking::IsBlackOrGrey(MarkBitFrom<mode>(obj)); |
73 } | 73 } |
74 | 74 |
75 template <MarkingMode mode = MarkingMode::FULL> | 75 template <MarkingMode mode = MarkingMode::FULL> |
76 V8_INLINE static void ClearMarkBit(HeapObject* obj) { | |
77 Marking::MarkWhite(MarkBitFrom<mode>(obj)); | |
78 } | |
79 | |
80 template <MarkingMode mode = MarkingMode::FULL> | |
81 V8_INLINE static void BlackToGrey(HeapObject* obj) { | 76 V8_INLINE static void BlackToGrey(HeapObject* obj) { |
82 DCHECK(IsBlack<mode>(obj)); | 77 DCHECK(IsBlack<mode>(obj)); |
83 MarkBit markbit = MarkBitFrom<mode>(obj); | 78 MarkBit markbit = MarkBitFrom<mode>(obj); |
84 Marking::BlackToGrey(markbit); | 79 Marking::BlackToGrey(markbit); |
85 MemoryChunk::IncrementLiveBytes<mode>(obj, -obj->Size()); | 80 MemoryChunk::IncrementLiveBytes<mode>(obj, -obj->Size()); |
86 } | 81 } |
87 | 82 |
88 template <MarkingMode mode = MarkingMode::FULL> | 83 template <MarkingMode mode = MarkingMode::FULL> |
89 V8_INLINE static void WhiteToGrey(HeapObject* obj) { | 84 V8_INLINE static void WhiteToGrey(HeapObject* obj) { |
90 DCHECK(IsWhite<mode>(obj)); | 85 DCHECK(IsWhite<mode>(obj)); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 830 |
836 private: | 831 private: |
837 MarkCompactCollector* collector_; | 832 MarkCompactCollector* collector_; |
838 }; | 833 }; |
839 | 834 |
840 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); | 835 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); |
841 } // namespace internal | 836 } // namespace internal |
842 } // namespace v8 | 837 } // namespace v8 |
843 | 838 |
844 #endif // V8_HEAP_MARK_COMPACT_H_ | 839 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |