| 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..648bf4673c5bade4d14a3c8bf88610d91f51b150 100644
|
| --- a/src/heap/mark-compact-inl.h
|
| +++ b/src/heap/mark-compact-inl.h
|
| @@ -13,48 +13,38 @@ namespace v8 {
|
| namespace internal {
|
|
|
| void MarkCompactCollector::PushBlack(HeapObject* obj) {
|
| - DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj)));
|
| - if (marking_deque()->Push(obj)) {
|
| - MemoryChunk::IncrementLiveBytes(obj, obj->Size());
|
| - } else {
|
| - MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
|
| - Marking::BlackToGrey(mark_bit);
|
| + DCHECK(ObjectMarking::IsBlack(obj));
|
| + if (!marking_deque()->Push(obj)) {
|
| + ObjectMarking::BlackToGrey(obj);
|
| }
|
| }
|
|
|
|
|
| void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
|
| - DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj)));
|
| + DCHECK(ObjectMarking::IsBlack(obj));
|
| if (!marking_deque()->Unshift(obj)) {
|
| - MemoryChunk::IncrementLiveBytes(obj, -obj->Size());
|
| - MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
|
| - Marking::BlackToGrey(mark_bit);
|
| + ObjectMarking::BlackToGrey(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));
|
| + if (ObjectMarking::IsWhite(obj)) {
|
| + ObjectMarking::WhiteToBlack(obj);
|
| PushBlack(obj);
|
| }
|
| }
|
|
|
| -
|
| -void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
|
| - DCHECK(Marking::IsWhite(mark_bit));
|
| - DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit);
|
| - Marking::WhiteToBlack(mark_bit);
|
| - MemoryChunk::IncrementLiveBytes(obj, obj->Size());
|
| +void MarkCompactCollector::SetMark(HeapObject* obj) {
|
| + DCHECK(ObjectMarking::IsWhite(obj));
|
| + ObjectMarking::WhiteToBlack(obj);
|
| }
|
|
|
|
|
| bool MarkCompactCollector::IsMarked(Object* obj) {
|
| DCHECK(obj->IsHeapObject());
|
| - HeapObject* heap_object = HeapObject::cast(obj);
|
| - return Marking::IsBlackOrGrey(ObjectMarking::MarkBitFrom(heap_object));
|
| + return ObjectMarking::IsBlackOrGrey(HeapObject::cast(obj));
|
| }
|
|
|
|
|
| @@ -64,7 +54,7 @@ void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot,
|
| Page* source_page = Page::FromAddress(reinterpret_cast<Address>(object));
|
| if (target_page->IsEvacuationCandidate() &&
|
| !ShouldSkipEvacuationSlotRecording(object)) {
|
| - DCHECK(Marking::IsBlackOrGrey(ObjectMarking::MarkBitFrom(object)));
|
| + DCHECK(IsMarked(object));
|
| RememberedSet<OLD_TO_OLD>::Insert(source_page,
|
| reinterpret_cast<Address>(slot));
|
| }
|
|
|