Index: src/heap/mark-compact.cc |
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
index f53fb6c177c675e4e74c685f9633d011398220f6..7e674abf658586d5ced76a76027921e2d3721b0e 100644 |
--- a/src/heap/mark-compact.cc |
+++ b/src/heap/mark-compact.cc |
@@ -2924,7 +2924,8 @@ class PointersUpdatingVisitor : public ObjectVisitor { |
} |
static inline void UpdateSlot(Heap* heap, Object** slot) { |
- Object* obj = *slot; |
+ Object* obj = reinterpret_cast<Object*>( |
+ base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot))); |
if (!obj->IsHeapObject()) return; |
@@ -2935,7 +2936,10 @@ class PointersUpdatingVisitor : public ObjectVisitor { |
DCHECK(heap->InFromSpace(heap_obj) || |
MarkCompactCollector::IsOnEvacuationCandidate(heap_obj)); |
HeapObject* target = map_word.ToForwardingAddress(); |
- *slot = target; |
+ base::NoBarrier_CompareAndSwap( |
+ reinterpret_cast<base::AtomicWord*>(slot), |
+ reinterpret_cast<base::AtomicWord>(obj), |
+ reinterpret_cast<base::AtomicWord>(target)); |
DCHECK(!heap->InFromSpace(target) && |
!MarkCompactCollector::IsOnEvacuationCandidate(target)); |
} |