Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: src/heap/mark-compact.h

Issue 2836583002: [heap] Allow concurrently transferring colors (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return Marking::IsBlackOrGrey<access_mode>(MarkBitFrom(obj, state)); 73 return Marking::IsBlackOrGrey<access_mode>(MarkBitFrom(obj, state));
74 } 74 }
75 75
76 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC> 76 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC>
77 V8_INLINE static bool BlackToGrey(HeapObject* obj, 77 V8_INLINE static bool BlackToGrey(HeapObject* obj,
78 const MarkingState& state) { 78 const MarkingState& state) {
79 DCHECK( 79 DCHECK(
80 (access_mode == MarkBit::ATOMIC || IsBlack<access_mode>(obj, state))); 80 (access_mode == MarkBit::ATOMIC || IsBlack<access_mode>(obj, state)));
81 MarkBit markbit = MarkBitFrom(obj, state); 81 MarkBit markbit = MarkBitFrom(obj, state);
82 if (!Marking::BlackToGrey<access_mode>(markbit)) return false; 82 if (!Marking::BlackToGrey<access_mode>(markbit)) return false;
83 state.IncrementLiveBytes(-obj->Size()); 83 state.IncrementLiveBytes<access_mode>(-obj->Size());
84 return true; 84 return true;
85 } 85 }
86 86
87 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC> 87 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC>
88 V8_INLINE static bool WhiteToGrey(HeapObject* obj, 88 V8_INLINE static bool WhiteToGrey(HeapObject* obj,
89 const MarkingState& state) { 89 const MarkingState& state) {
90 DCHECK( 90 DCHECK(
91 (access_mode == MarkBit::ATOMIC || IsWhite<access_mode>(obj, state))); 91 (access_mode == MarkBit::ATOMIC || IsWhite<access_mode>(obj, state)));
92 return Marking::WhiteToGrey<access_mode>(MarkBitFrom(obj, state)); 92 return Marking::WhiteToGrey<access_mode>(MarkBitFrom(obj, state));
93 } 93 }
94 94
95 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC> 95 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC>
96 V8_INLINE static bool WhiteToBlack(HeapObject* obj, 96 V8_INLINE static bool WhiteToBlack(HeapObject* obj,
97 const MarkingState& state) { 97 const MarkingState& state) {
98 DCHECK( 98 DCHECK(
99 (access_mode == MarkBit::ATOMIC || IsWhite<access_mode>(obj, state))); 99 (access_mode == MarkBit::ATOMIC || IsWhite<access_mode>(obj, state)));
100 if (!ObjectMarking::WhiteToGrey<access_mode>(obj, state)) return false; 100 if (!ObjectMarking::WhiteToGrey<access_mode>(obj, state)) return false;
101 return ObjectMarking::GreyToBlack<access_mode>(obj, state); 101 return ObjectMarking::GreyToBlack<access_mode>(obj, state);
102 } 102 }
103 103
104 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC> 104 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC>
105 V8_INLINE static bool GreyToBlack(HeapObject* obj, 105 V8_INLINE static bool GreyToBlack(HeapObject* obj,
106 const MarkingState& state) { 106 const MarkingState& state) {
107 DCHECK((access_mode == MarkBit::ATOMIC || IsGrey<access_mode>(obj, state))); 107 DCHECK((access_mode == MarkBit::ATOMIC || IsGrey<access_mode>(obj, state)));
108 MarkBit markbit = MarkBitFrom(obj, state); 108 MarkBit markbit = MarkBitFrom(obj, state);
109 if (!Marking::GreyToBlack<access_mode>(markbit)) return false; 109 if (!Marking::GreyToBlack<access_mode>(markbit)) return false;
110 state.IncrementLiveBytes(obj->Size()); 110 state.IncrementLiveBytes<access_mode>(obj->Size());
111 return true; 111 return true;
112 } 112 }
113 113
114 private: 114 private:
115 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectMarking); 115 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectMarking);
116 }; 116 };
117 117
118 // ---------------------------------------------------------------------------- 118 // ----------------------------------------------------------------------------
119 // Marking deque for tracing live objects. 119 // Marking deque for tracing live objects.
120 class MarkingDeque { 120 class MarkingDeque {
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 870
871 private: 871 private:
872 MarkCompactCollector* collector_; 872 MarkCompactCollector* collector_;
873 }; 873 };
874 874
875 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); 875 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space);
876 } // namespace internal 876 } // namespace internal
877 } // namespace v8 877 } // namespace v8
878 878
879 #endif // V8_HEAP_MARK_COMPACT_H_ 879 #endif // V8_HEAP_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698