Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Unified Diff: src/heap/concurrent-marking.cc

Issue 2872443003: [heap] Make object field write atomic if concurrent marking is enabled. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/concurrent-marking.cc
diff --git a/src/heap/concurrent-marking.cc b/src/heap/concurrent-marking.cc
index 2e91ae368f958edec45f6577b2fdfa2fc5d0c1c8..85cee07943148993287d1535fc4b9ec113efa53a 100644
--- a/src/heap/concurrent-marking.cc
+++ b/src/heap/concurrent-marking.cc
@@ -37,8 +37,10 @@ class ConcurrentMarkingVisitor final
void VisitPointers(HeapObject* host, Object** start, Object** end) override {
for (Object** p = start; p < end; p++) {
- if (!(*p)->IsHeapObject()) continue;
- MarkObject(HeapObject::cast(*p));
+ Object* object = reinterpret_cast<Object*>(
+ base::NoBarrier_Load(reinterpret_cast<const base::AtomicWord*>(p)));
+ if (!object->IsHeapObject()) continue;
+ MarkObject(HeapObject::cast(object));
}
}
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698