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

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

Issue 1988623002: Ensure black and gray objects are kept around by scavenger (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup Created 4 years, 7 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.cc ('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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 static ObjectColor Color(MarkBit mark_bit) { 151 static ObjectColor Color(MarkBit mark_bit) {
152 if (IsBlack(mark_bit)) return BLACK_OBJECT; 152 if (IsBlack(mark_bit)) return BLACK_OBJECT;
153 if (IsWhite(mark_bit)) return WHITE_OBJECT; 153 if (IsWhite(mark_bit)) return WHITE_OBJECT;
154 if (IsGrey(mark_bit)) return GREY_OBJECT; 154 if (IsGrey(mark_bit)) return GREY_OBJECT;
155 UNREACHABLE(); 155 UNREACHABLE();
156 return IMPOSSIBLE_COLOR; 156 return IMPOSSIBLE_COLOR;
157 } 157 }
158 #endif 158 #endif
159 159
160 // Returns true if the transferred color is black. 160 // Returns true if the transferred color is black. Clears the color of the
161 // from object.
161 INLINE(static bool TransferColor(HeapObject* from, HeapObject* to)) { 162 INLINE(static bool TransferColor(HeapObject* from, HeapObject* to)) {
162 if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE)) 163 MarkBit from_mark_bit = MarkBitFrom(from);
164 if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE)) {
165 if (!Marking::IsWhite(from_mark_bit)) {
166 Marking::MarkWhite(from_mark_bit);
167 }
163 return true; 168 return true;
164 MarkBit from_mark_bit = MarkBitFrom(from); 169 }
165 MarkBit to_mark_bit = MarkBitFrom(to); 170 MarkBit to_mark_bit = MarkBitFrom(to);
166 DCHECK(Marking::IsWhite(to_mark_bit)); 171 DCHECK(Marking::IsWhite(to_mark_bit));
167 if (from_mark_bit.Get()) { 172 if (from_mark_bit.Get()) {
168 to_mark_bit.Set(); 173 to_mark_bit.Set();
174 from_mark_bit.Clear();
169 if (from_mark_bit.Next().Get()) { 175 if (from_mark_bit.Next().Get()) {
170 to_mark_bit.Next().Set(); 176 to_mark_bit.Next().Set();
177 from_mark_bit.Next().Clear();
171 return true; 178 return true;
172 } 179 }
173 } 180 }
174 return false; 181 return false;
175 } 182 }
176 183
177 private: 184 private:
178 DISALLOW_IMPLICIT_CONSTRUCTORS(Marking); 185 DISALLOW_IMPLICIT_CONSTRUCTORS(Marking);
179 }; 186 };
180 187
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 private: 899 private:
893 MarkCompactCollector* collector_; 900 MarkCompactCollector* collector_;
894 }; 901 };
895 902
896 903
897 const char* AllocationSpaceName(AllocationSpace space); 904 const char* AllocationSpaceName(AllocationSpace space);
898 } // namespace internal 905 } // namespace internal
899 } // namespace v8 906 } // namespace v8
900 907
901 #endif // V8_HEAP_MARK_COMPACT_H_ 908 #endif // V8_HEAP_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698