Chromium Code Reviews| Index: src/mark-compact.cc |
| diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
| index 8d9ec0cdefaa5b8357c1210a218e5333c1b4d791..043bc559061664df7baa6d2fe0ea7b084027e471 100644 |
| --- a/src/mark-compact.cc |
| +++ b/src/mark-compact.cc |
| @@ -2822,6 +2822,19 @@ void MarkCompactCollector::ClearWeakCollections() { |
| } |
| +void MarkCompactCollector::RecordMigratedSlot(Object* value, Address slot) { |
| + if (heap_->InNewSpace(value)) { |
| + heap_->store_buffer()->Mark(slot); |
| + } else if (value->IsHeapObject() && IsOnEvacuationCandidate(value)) { |
| + SlotsBuffer::AddTo(&slots_buffer_allocator_, |
| + &migration_slots_buffer_, |
| + reinterpret_cast<Object**>(slot), |
| + SlotsBuffer::IGNORE_OVERFLOW); |
| + } |
| +} |
| + |
| + |
| + |
| // We scavange new space simultaneously with sweeping. This is done in two |
| // passes. |
| // |
| @@ -2858,13 +2871,10 @@ void MarkCompactCollector::MigrateObject(HeapObject* dst, |
| Memory::Object_at(dst_slot) = value; |
| - if (heap_->InNewSpace(value)) { |
| - heap_->store_buffer()->Mark(dst_slot); |
| - } else if (value->IsHeapObject() && IsOnEvacuationCandidate(value)) { |
| - SlotsBuffer::AddTo(&slots_buffer_allocator_, |
| - &migration_slots_buffer_, |
| - reinterpret_cast<Object**>(dst_slot), |
| - SlotsBuffer::IGNORE_OVERFLOW); |
| + // We special case ConstantPoolArrays below since they could contain |
|
Hannes Payer (out of office)
2014/06/04 07:25:04
contain contain => contain
rmcilroy
2014/06/04 10:19:26
Done.
|
| + // contain integers value entries which look like tagged pointers. |
| + if (!(compacting_ && dst->IsConstantPoolArray())) { |
|
Michael Starzinger
2014/06/03 22:57:11
OMG, this is a giant hack. Please leave a TODO(mst
Hannes Payer (out of office)
2014/06/04 07:25:04
The problem is that constant pools do not belong t
Hannes Payer (out of office)
2014/06/04 07:25:04
if (!(compacting_ && dst->IsConstantPoolArray()))
rmcilroy
2014/06/04 10:15:56
ConstantPoolArrays are pre-tenured, so they should
rmcilroy
2014/06/04 10:15:56
Done.
Hannes Payer (out of office)
2014/06/04 10:54:16
I was worried about creating store buffer entries
|
| + RecordMigratedSlot(value, dst_slot); |
| } |
| src_slot += kPointerSize; |
| @@ -2898,6 +2908,13 @@ void MarkCompactCollector::MigrateObject(HeapObject* dst, |
| SlotsBuffer::IGNORE_OVERFLOW); |
| } |
| } |
| + ConstantPoolArray::Iterator heap_iter(array, ConstantPoolArray::HEAP_PTR); |
| + while (!heap_iter.is_finished()) { |
| + Address heap_slot = |
| + dst_addr + array->OffsetOfElementAt(heap_iter.next_index()); |
| + Object* value = Memory::Object_at(heap_slot); |
| + RecordMigratedSlot(value, heap_slot); |
| + } |
| } |
| } else if (dest == CODE_SPACE) { |
| PROFILE(isolate(), CodeMoveEvent(src_addr, dst_addr)); |