Commit d003c2ad authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Use ObjectMarking in TransferMark.

BUG=chromium:694255

Review-Url: https://codereview.chromium.org/2723853006
Cr-Commit-Position: refs/heads/master@{#43553}
parent 12ce15c3
......@@ -185,26 +185,19 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
static void TransferMark(Heap* heap, HeapObject* from, HeapObject* to);
// Returns true if the color transfer requires live bytes updating.
INLINE(static bool TransferColor(HeapObject* from, HeapObject* to,
INLINE(static void TransferColor(HeapObject* from, HeapObject* to,
int size)) {
MarkBit from_mark_bit = ObjectMarking::MarkBitFrom(from);
MarkBit to_mark_bit = ObjectMarking::MarkBitFrom(to);
if (Marking::IsBlack(to_mark_bit)) {
if (ObjectMarking::IsBlack(to)) {
DCHECK(to->GetHeap()->incremental_marking()->black_allocation());
return false;
return;
}
DCHECK(Marking::IsWhite(to_mark_bit));
if (from_mark_bit.Get()) {
to_mark_bit.Set();
if (from_mark_bit.Next().Get()) {
to_mark_bit.Next().Set();
return true;
}
DCHECK(ObjectMarking::IsWhite(to));
if (ObjectMarking::IsGrey(from)) {
ObjectMarking::WhiteToGrey(to);
} else if (ObjectMarking::IsBlack(from)) {
ObjectMarking::WhiteToBlack(to);
}
return false;
}
void IterateBlackObject(HeapObject* object);
......
......@@ -147,9 +147,7 @@ class ScavengingVisitor : public StaticVisitorBase {
}
if (marks_handling == TRANSFER_MARKS) {
if (IncrementalMarking::TransferColor(source, target, size)) {
MemoryChunk::IncrementLiveBytes(target, size);
}
IncrementalMarking::TransferColor(source, target, size);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment