}
}
- heap_->mark_compact_collector()->marking_deque()->UnshiftGrey(obj);
+ heap_->mark_compact_collector()->marking_deque()->Unshift(obj);
}
void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) {
Marking::WhiteToGrey(mark_bit);
- heap_->mark_compact_collector()->marking_deque()->PushGrey(obj);
+ heap_->mark_compact_collector()->marking_deque()->Push(obj);
}
}
} // namespace v8::internal
chunk->set_progress_bar(start_offset);
if (start_offset < object_size) {
if (Marking::IsGrey(Marking::MarkBitFrom(object))) {
- heap->mark_compact_collector()->marking_deque()->UnshiftGrey(object);
+ heap->mark_compact_collector()->marking_deque()->Unshift(object);
} else {
DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object)));
heap->mark_compact_collector()->UnshiftBlack(object);
void MarkCompactCollector::PushBlack(HeapObject* obj) {
- if (marking_deque_.PushBlack(obj)) {
+ DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
+ if (marking_deque_.Push(obj)) {
MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
} else {
Marking::BlackToGrey(obj);
void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
- if (!marking_deque_.UnshiftBlack(obj)) {
+ DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
+ if (!marking_deque_.Unshift(obj)) {
MemoryChunk::IncrementLiveBytesFromGC(obj, -obj->Size());
Marking::BlackToGrey(obj);
}
void SetOverflowed() { overflowed_ = true; }
- // Push the (marked) object on the marking stack if there is room, otherwise
- // mark the deque as overflowed and wait for a rescan of the heap.
- INLINE(bool PushBlack(HeapObject* object)) {
+ // Push the object on the marking stack if there is room, otherwise mark the
+ // deque as overflowed and wait for a rescan of the heap.
+ INLINE(bool Push(HeapObject* object)) {
DCHECK(object->IsHeapObject());
if (IsFull()) {
SetOverflowed();
}
}
- INLINE(void PushGrey(HeapObject* object)) {
- DCHECK(object->IsHeapObject());
- if (IsFull()) {
- SetOverflowed();
- } else {
- array_[top_] = object;
- top_ = ((top_ + 1) & mask_);
- }
- }
-
INLINE(HeapObject* Pop()) {
DCHECK(!IsEmpty());
top_ = ((top_ - 1) & mask_);
return object;
}
- INLINE(void UnshiftGrey(HeapObject* object)) {
- DCHECK(object->IsHeapObject());
- if (IsFull()) {
- SetOverflowed();
- } else {
- bottom_ = ((bottom_ - 1) & mask_);
- array_[bottom_] = object;
- }
- }
-
- INLINE(bool UnshiftBlack(HeapObject* object)) {
+ // Unshift the object into the marking stack if there is room, otherwise mark
+ // the deque as overflowed and wait for a rescan of the heap.
+ INLINE(bool Unshift(HeapObject* object)) {
DCHECK(object->IsHeapObject());
- DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object)));
if (IsFull()) {
SetOverflowed();
return false;
Address original_address = reinterpret_cast<Address>(&s);
Address current_address = original_address;
while (!s.IsFull()) {
- s.PushBlack(HeapObject::FromAddress(current_address));
+ s.Push(HeapObject::FromAddress(current_address));
current_address += kPointerSize;
}