Commit fdff4b07 authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Use CAS to update old to new slots in Scavenger.

BUG=chromium:676635

Review-Url: https://codereview.chromium.org/2628853002
Cr-Commit-Position: refs/heads/master@{#42227}
parent 3e362c75
......@@ -185,8 +185,12 @@ class ScavengingVisitor : public StaticVisitorBase {
if (allocation.To(&target)) {
MigrateObject(heap, object, target, object_size);
// Update slot to new target.
*slot = target;
// Update slot to new target using CAS. A concurrent sweeper thread my
// filter the slot concurrently.
HeapObject* old = *slot;
base::Release_CompareAndSwap(reinterpret_cast<base::AtomicWord*>(slot),
reinterpret_cast<base::AtomicWord>(old),
reinterpret_cast<base::AtomicWord>(target));
if (object_contents == POINTER_OBJECT) {
heap->promotion_queue()->insert(
......
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