Chromium Code Reviews| Index: src/heap/mark-compact.cc |
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
| index 0c9eeff0041d3c92988d407e162bb50d81718468..231f0c4c52abf95b7702b862d15bb1c05366d6fb 100644 |
| --- a/src/heap/mark-compact.cc |
| +++ b/src/heap/mark-compact.cc |
| @@ -3008,19 +3008,15 @@ void PointersUpdatingVisitor::CheckLayoutDescriptorAndDie(Heap* heap, |
| static void UpdatePointer(HeapObject** address, HeapObject* object) { |
| - Address new_addr = Memory::Address_at(object->address()); |
| - |
| - // The new space sweep will overwrite the map word of dead objects |
| - // with NULL. In this case we do not need to transfer this entry to |
| - // the store buffer which we are rebuilding. |
| - // We perform the pointer update with a no barrier compare-and-swap. The |
| - // compare and swap may fail in the case where the pointer update tries to |
| - // update garbage memory which was concurrently accessed by the sweeper. |
| - if (new_addr != NULL) { |
| - base::NoBarrier_CompareAndSwap( |
| - reinterpret_cast<base::AtomicWord*>(address), |
| - reinterpret_cast<base::AtomicWord>(object), |
| - reinterpret_cast<base::AtomicWord>(HeapObject::FromAddress(new_addr))); |
| + MapWord map_word = object->map_word(); |
| + // The store buffer can still contain stale pointers in dead large objects. |
| + // Ignore these pointers here. |
|
Hannes Payer (out of office)
2015/03/09 20:39:59
Note that we could already filter out these pointe
|
| + DCHECK(map_word.IsForwardingAddress() || |
| + object->GetHeap()->lo_space()->FindPage( |
| + reinterpret_cast<Address>(address)) != NULL); |
| + if (map_word.IsForwardingAddress()) { |
| + // Update the corresponding slot. |
| + *address = map_word.ToForwardingAddress(); |
| } |
| } |
| @@ -3650,8 +3646,7 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { |
| GCTracer::Scope::MC_UPDATE_OLD_TO_NEW_POINTERS); |
| StoreBufferRebuildScope scope(heap_, heap_->store_buffer(), |
| &Heap::ScavengeStoreBufferCallback); |
| - heap_->store_buffer()->IteratePointersToNewSpaceAndClearMaps( |
| - &UpdatePointer); |
| + heap_->store_buffer()->IteratePointersToNewSpace(&UpdatePointer); |
| } |
| { |