From 74654d309816211964c7bac528a6c263aa54a475 Mon Sep 17 00:00:00 2001 From: hpayer Date: Wed, 6 May 2015 07:35:02 -0700 Subject: [PATCH] Revert of New insertion write barrier. (patchset #3 id:200001 of https://codereview.chromium.org/1073953006/) Reason for revert: Various performance regressions. Original issue's description: > New insertion write barrier. > > BUG= > > Committed: https://crrev.com/6e9e2c08292b553602c74b16b8ccff4e4ccac003 > Cr-Commit-Position: refs/heads/master@{#28199} TBR=ulan@chromium.org,erikcorry@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.chromium.org/1131583002 Cr-Commit-Position: refs/heads/master@{#28265} --- src/heap/incremental-marking-inl.h | 20 ++++++++++++++++++-- src/heap/spaces.h | 7 +++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/heap/incremental-marking-inl.h b/src/heap/incremental-marking-inl.h index b9cfe1d..42b3dcb 100644 --- a/src/heap/incremental-marking-inl.h +++ b/src/heap/incremental-marking-inl.h @@ -16,8 +16,24 @@ bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object** slot, HeapObject* value_heap_obj = HeapObject::cast(value); MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj); if (Marking::IsWhite(value_bit)) { - WhiteToGreyAndPush(value_heap_obj, value_bit); - RestartIfNotMarking(); + MarkBit obj_bit = Marking::MarkBitFrom(obj); + if (Marking::IsBlack(obj_bit)) { + MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); + if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { + if (chunk->IsLeftOfProgressBar(slot)) { + WhiteToGreyAndPush(value_heap_obj, value_bit); + RestartIfNotMarking(); + } else { + return false; + } + } else { + BlackToGreyAndUnshift(obj, obj_bit); + RestartIfNotMarking(); + return false; + } + } else { + return false; + } } if (!is_compacting_) return false; MarkBit obj_bit = Marking::MarkBitFrom(obj); diff --git a/src/heap/spaces.h b/src/heap/spaces.h index de8e4b0..494d05c 100644 --- a/src/heap/spaces.h +++ b/src/heap/spaces.h @@ -508,6 +508,13 @@ class MemoryChunk { } } + bool IsLeftOfProgressBar(Object** slot) { + Address slot_address = reinterpret_cast
(slot); + DCHECK(slot_address > this->address()); + return (slot_address - (this->address() + kObjectStartOffset)) < + progress_bar(); + } + static void IncrementLiveBytesFromGC(Address address, int by) { MemoryChunk::FromAddress(address)->IncrementLiveBytes(by); } -- 2.7.4