Index: src/heap/mark-compact-inl.h |
diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h |
index 1973753b0c3ae9ed0234b68b7d663135da155add..2c5d1eddaa80a85da6170305aa5193ded82562e2 100644 |
--- a/src/heap/mark-compact-inl.h |
+++ b/src/heap/mark-compact-inl.h |
@@ -14,11 +14,8 @@ namespace internal { |
void MarkCompactCollector::PushBlack(HeapObject* obj) { |
DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj))); |
Hannes Payer (out of office)
2017/01/18 14:43:35
That would also short cut the double accessors: Ob
Michael Lippautz
2017/01/18 15:58:07
Done.
|
- if (marking_deque()->Push(obj)) { |
- MemoryChunk::IncrementLiveBytes(obj, obj->Size()); |
- } else { |
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj); |
- Marking::BlackToGrey(mark_bit); |
+ if (!marking_deque()->Push(obj)) { |
+ ObjectMarking::BlackToGrey(obj); |
} |
} |
@@ -26,9 +23,7 @@ void MarkCompactCollector::PushBlack(HeapObject* obj) { |
void MarkCompactCollector::UnshiftBlack(HeapObject* obj) { |
DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj))); |
if (!marking_deque()->Unshift(obj)) { |
- MemoryChunk::IncrementLiveBytes(obj, -obj->Size()); |
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj); |
- Marking::BlackToGrey(mark_bit); |
+ ObjectMarking::BlackToGrey(obj); |
} |
} |
@@ -36,18 +31,16 @@ void MarkCompactCollector::UnshiftBlack(HeapObject* obj) { |
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) { |
DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit); |
if (Marking::IsWhite(mark_bit)) { |
- Marking::WhiteToBlack(mark_bit); |
- DCHECK(obj->GetIsolate()->heap()->Contains(obj)); |
+ ObjectMarking::WhiteToBlack(obj); |
PushBlack(obj); |
} |
} |
void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) { |
- DCHECK(Marking::IsWhite(mark_bit)); |
+ DCHECK(Marking::IsWhite(ObjectMarking::MarkBitFrom(obj))); |
DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit); |
- Marking::WhiteToBlack(mark_bit); |
- MemoryChunk::IncrementLiveBytes(obj, obj->Size()); |
+ ObjectMarking::WhiteToBlack(obj); |
} |