Commit 04bcca84 authored by jochen@chromium.org's avatar jochen@chromium.org

Read object pointer atomically while updating slots

BUG=425003
R=ulan@chromium.org
LOG=n

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b1d4bf41
......@@ -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));
}
......
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