From d23a9f7a3e509bd405e1e4b0b851e463a4a736c2 Mon Sep 17 00:00:00 2001 From: ishell Date: Thu, 26 Mar 2015 23:34:30 -0700 Subject: [PATCH] Revert of Use a slot that is located on a heap page when removing invalid entries from the SlotsBuffer. (patchset #1 id:1 of https://codereview.chromium.org/1020853022/) Reason for revert: Reverting risky GC changes that block v8 roll. Original issue's description: > Use a slot that is located on a heap page when removing invalid entries from the SlotsBuffer. > > BUG=chromium:470801 > LOG=Y > > Committed: https://crrev.com/2f3a42f9a1d66ffc9d260d9700ff831c3aa1cd41 > Cr-Commit-Position: refs/heads/master@{#27467} TBR=hpayer@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:470801 Review URL: https://codereview.chromium.org/1033163002 Cr-Commit-Position: refs/heads/master@{#27490} --- src/heap/mark-compact.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index ca35d4a..eb35c1f 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -4570,14 +4570,14 @@ bool SlotsBuffer::AddTo(SlotsBufferAllocator* allocator, } +static Object* g_smi_slot = NULL; + + void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) { - // Remove entries by replacing them with an old-space slot containing a smi - // that is located in an unmovable page. - const ObjectSlot kRemovedEntry = - HeapObject::RawField(heap->empty_fixed_array(), - FixedArrayBase::kLengthOffset); - DCHECK(Page::FromAddress( - reinterpret_cast
(kRemovedEntry))->NeverEvacuate()); + DCHECK_EQ(Smi::FromInt(0), g_smi_slot); + + // Remove entries by replacing them with a dummy slot containing a smi. + const ObjectSlot kRemovedEntry = &g_smi_slot; while (buffer != NULL) { SlotsBuffer::ObjectSlot* slots = buffer->slots_; @@ -4605,6 +4605,8 @@ void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) { void SlotsBuffer::VerifySlots(Heap* heap, SlotsBuffer* buffer) { + DCHECK_EQ(Smi::FromInt(0), g_smi_slot); + while (buffer != NULL) { SlotsBuffer::ObjectSlot* slots = buffer->slots_; intptr_t slots_count = buffer->idx_; -- 2.7.4