Use a slot that is located on a heap page when removing invalid entries from the SlotsBuffer.

BUG=chromium:470801
LOG=Y

Review URL: https://codereview.chromium.org/1020853022

Cr-Commit-Position: refs/heads/master@{#27467}
This commit is contained in:
ishell 2015-03-26 02:00:16 -07:00 committed by Commit bot
parent f13d04d28c
commit 2f3a42f9a1

View File

@ -4558,14 +4558,14 @@ bool SlotsBuffer::AddTo(SlotsBufferAllocator* allocator,
}
static Object* g_smi_slot = NULL;
void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) {
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;
// 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<Address>(kRemovedEntry))->NeverEvacuate());
while (buffer != NULL) {
SlotsBuffer::ObjectSlot* slots = buffer->slots_;
@ -4593,8 +4593,6 @@ 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_;