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

Side by Side Diff: src/heap/marking.h

Issue 2720133005: [heap] Remove Marking::MarkBlack and some minor cleanups. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_MARKING_H 5 #ifndef V8_MARKING_H
6 #define V8_MARKING_H 6 #define V8_MARKING_H
7 7
8 #include "src/utils.h" 8 #include "src/utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Grey markbits: 10 291 // Grey markbits: 10
292 static const char* kGreyBitPattern; 292 static const char* kGreyBitPattern;
293 INLINE(static bool IsGrey(MarkBit mark_bit)) { 293 INLINE(static bool IsGrey(MarkBit mark_bit)) {
294 return mark_bit.Get() && !mark_bit.Next().Get(); 294 return mark_bit.Get() && !mark_bit.Next().Get();
295 } 295 }
296 296
297 // IsBlackOrGrey assumes that the first bit is set for black or grey 297 // IsBlackOrGrey assumes that the first bit is set for black or grey
298 // objects. 298 // objects.
299 INLINE(static bool IsBlackOrGrey(MarkBit mark_bit)) { return mark_bit.Get(); } 299 INLINE(static bool IsBlackOrGrey(MarkBit mark_bit)) { return mark_bit.Get(); }
300 300
301 INLINE(static void MarkBlack(MarkBit mark_bit)) {
302 mark_bit.Set();
303 mark_bit.Next().Set();
304 }
305
306 INLINE(static void MarkWhite(MarkBit mark_bit)) {
307 mark_bit.Clear();
308 mark_bit.Next().Clear();
309 }
310
311 INLINE(static void BlackToWhite(MarkBit markbit)) { 301 INLINE(static void BlackToWhite(MarkBit markbit)) {
312 DCHECK(IsBlack(markbit)); 302 DCHECK(IsBlack(markbit));
313 markbit.Clear(); 303 markbit.Clear();
314 markbit.Next().Clear(); 304 markbit.Next().Clear();
315 } 305 }
316 306
317 INLINE(static void GreyToWhite(MarkBit markbit)) { 307 INLINE(static void GreyToWhite(MarkBit markbit)) {
318 DCHECK(IsGrey(markbit)); 308 DCHECK(IsGrey(markbit));
319 markbit.Clear(); 309 markbit.Clear();
320 markbit.Next().Clear(); 310 markbit.Next().Clear();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 366 }
377 367
378 private: 368 private:
379 DISALLOW_IMPLICIT_CONSTRUCTORS(Marking); 369 DISALLOW_IMPLICIT_CONSTRUCTORS(Marking);
380 }; 370 };
381 371
382 } // namespace internal 372 } // namespace internal
383 } // namespace v8 373 } // namespace v8
384 374
385 #endif // V8_MARKING_H_ 375 #endif // V8_MARKING_H_
OLDNEW
« src/heap/mark-compact.h ('K') | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698