| Index: src/heap/mark-compact.cc
|
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
|
| index 7e02afa3c9ebe65c982d8dffed41b3819e5574f5..b548f8e2c3ffa164a4f2bc7e4ea3e2c5434f76c0 100644
|
| --- a/src/heap/mark-compact.cc
|
| +++ b/src/heap/mark-compact.cc
|
| @@ -2827,30 +2827,6 @@ void MarkCompactCollector::MigrateObject(HeapObject* dst, HeapObject* src,
|
| SlotsBuffer::CODE_ENTRY_SLOT, code_entry_slot,
|
| SlotsBuffer::IGNORE_OVERFLOW);
|
| }
|
| - } else if (dst->IsConstantPoolArray()) {
|
| - // We special case ConstantPoolArrays since they could contain integers
|
| - // value entries which look like tagged pointers.
|
| - // TODO(mstarzinger): restructure this code to avoid this special-casing.
|
| - ConstantPoolArray* array = ConstantPoolArray::cast(dst);
|
| - ConstantPoolArray::Iterator code_iter(array, ConstantPoolArray::CODE_PTR);
|
| - while (!code_iter.is_finished()) {
|
| - Address code_entry_slot =
|
| - dst_addr + array->OffsetOfElementAt(code_iter.next_index());
|
| - Address code_entry = Memory::Address_at(code_entry_slot);
|
| -
|
| - if (Page::FromAddress(code_entry)->IsEvacuationCandidate()) {
|
| - SlotsBuffer::AddTo(&slots_buffer_allocator_, &migration_slots_buffer_,
|
| - SlotsBuffer::CODE_ENTRY_SLOT, code_entry_slot,
|
| - 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));
|
| @@ -3467,6 +3443,10 @@ static inline void UpdateSlot(Isolate* isolate, ObjectVisitor* v,
|
| rinfo.Visit(isolate, v);
|
| break;
|
| }
|
| + case SlotsBuffer::OBJECT_SLOT: {
|
| + v->VisitPointer(reinterpret_cast<Object**>(addr));
|
| + break;
|
| + }
|
| default:
|
| UNREACHABLE();
|
| break;
|
| @@ -4636,9 +4616,20 @@ void MarkCompactCollector::RecordRelocSlot(RelocInfo* rinfo, Object* target) {
|
| if (target_page->IsEvacuationCandidate() &&
|
| (rinfo->host() == NULL ||
|
| !ShouldSkipEvacuationSlotRecording(rinfo->host()))) {
|
| + Address addr = rinfo->pc();
|
| + SlotsBuffer::SlotType slot_type = SlotTypeForRMode(rmode);
|
| + if (rinfo->IsInConstantPool()) {
|
| + addr = rinfo->constant_pool_entry_address();
|
| + if (RelocInfo::IsCodeTarget(rmode)) {
|
| + slot_type = SlotsBuffer::CODE_ENTRY_SLOT;
|
| + } else {
|
| + DCHECK(RelocInfo::IsEmbeddedObject(rmode));
|
| + slot_type = SlotsBuffer::OBJECT_SLOT;
|
| + }
|
| + }
|
| bool success = SlotsBuffer::AddTo(
|
| &slots_buffer_allocator_, target_page->slots_buffer_address(),
|
| - SlotTypeForRMode(rmode), rinfo->pc(), SlotsBuffer::FAIL_ON_OVERFLOW);
|
| + slot_type, addr, SlotsBuffer::FAIL_ON_OVERFLOW);
|
| if (!success) {
|
| EvictPopularEvacuationCandidate(target_page);
|
| }
|
|
|