Commit 116a47f8 authored by ulan's avatar ulan Committed by Commit bot

Reland r24737 "Read object pointer atomically while updating slots"

Crashes were fixed by r24914.

BUG=chromium:427746
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#25330}
parent 219b974f
......@@ -2882,7 +2882,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;
......@@ -2893,7 +2894,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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment