Revision: 24737
Author: [email protected]
Date: Mon Oct 20 12:12:09 2014 UTC
Log: Read object pointer atomically while updating slots
BUG=425003
[email protected]
LOG=n
Review URL: https://codereview.chromium.org/663023002
https://code.google.com/p/v8/source/detail?r=24737
Modified:
/branches/bleeding_edge/src/heap/mark-compact.cc
=======================================
--- /branches/bleeding_edge/src/heap/mark-compact.cc Tue Oct 14 14:43:45
2014 UTC
+++ /branches/bleeding_edge/src/heap/mark-compact.cc Mon Oct 20 12:12:09
2014 UTC
@@ -2924,7 +2924,8 @@
}
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 @@
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));
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.