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

Unified Diff: src/heap/mark-compact.h

Issue 1040443002: MarkBit cleanup: They have to be accessed through Marking accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index c6800993c00fabd5ac963a62e51b4d80a90ec28b..2bd53df773d49e3a3f74f96480c0c1eb9a6114e7 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -50,7 +50,10 @@ class Marking {
// White markbits: 00 - this is required by the mark bit clearer.
static const char* kWhiteBitPattern;
- INLINE(static bool IsWhite(MarkBit mark_bit)) { return !mark_bit.Get(); }
+ INLINE(static bool IsWhite(MarkBit mark_bit)) {
+ DCHECK(!IsImpossible(mark_bit));
+ return !mark_bit.Get();
+ }
// Grey markbits: 11
static const char* kGreyBitPattern;
@@ -58,19 +61,51 @@ class Marking {
return mark_bit.Get() && mark_bit.Next().Get();
}
+ // IsBlackOrGrey assumes that the first bit is set for black or grey
+ // objects.
+ INLINE(static bool IsBlackOrGrey(MarkBit mark_bit)) { return mark_bit.Get(); }
+
INLINE(static void MarkBlack(MarkBit mark_bit)) {
mark_bit.Set();
mark_bit.Next().Clear();
}
- INLINE(static void BlackToGrey(MarkBit markbit)) { markbit.Next().Set(); }
+ INLINE(static void MarkWhite(MarkBit mark_bit)) {
+ mark_bit.Clear();
+ mark_bit.Next().Clear();
+ }
+
+ INLINE(static void BlackToWhite(MarkBit markbit)) {
+ DCHECK(IsBlack(markbit));
+ markbit.Clear();
+ }
+
+ INLINE(static void GreyToWhite(MarkBit markbit)) {
+ DCHECK(IsGrey(markbit));
+ markbit.Clear();
+ markbit.Next().Clear();
+ }
+
+ INLINE(static void BlackToGrey(MarkBit markbit)) {
+ DCHECK(IsBlack(markbit));
+ markbit.Next().Set();
+ }
INLINE(static void WhiteToGrey(MarkBit markbit)) {
+ DCHECK(IsWhite(markbit));
markbit.Set();
markbit.Next().Set();
}
- INLINE(static void GreyToBlack(MarkBit markbit)) { markbit.Next().Clear(); }
+ INLINE(static void WhiteToBlack(MarkBit markbit)) {
+ DCHECK(IsWhite(markbit));
+ markbit.Set();
+ }
+
+ INLINE(static void GreyToBlack(MarkBit markbit)) {
+ DCHECK(IsGrey(markbit));
+ markbit.Next().Clear();
+ }
INLINE(static void BlackToGrey(HeapObject* obj)) {
BlackToGrey(MarkBitFrom(obj));
@@ -81,6 +116,10 @@ class Marking {
markbit.Next().Set();
}
+ static void SetAllMarkBitsInRange(MarkBit start, MarkBit end);
+ static void ClearAllMarkBitsOfCellsContainedInRange(MarkBit start,
+ MarkBit end);
+
void TransferMark(Address old_start, Address new_start);
#ifdef DEBUG
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698