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

Unified Diff: src/heap/mark-compact.cc

Issue 2492263002: [heap] Add atomics to mark bit operations. (Closed)
Patch Set: comment Created 3 years, 9 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 | « src/heap/mark-compact.h ('k') | src/heap/mark-compact-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index b64b2d24fc3d1a24baaa8314e291eeace6193adb..6a1a043d0cc76c1cab1162a2f6a2b032948c6979 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1087,9 +1087,11 @@ class StaticYoungGenerationMarkingVisitor
StackLimitCheck check(heap->isolate());
if (check.HasOverflowed()) return false;
- if (ObjectMarking::IsBlackOrGrey<MarkingMode::YOUNG_GENERATION>(object))
+ if (ObjectMarking::IsBlackOrGrey<MarkBit::NON_ATOMIC,
+ MarkingMode::YOUNG_GENERATION>(object))
return true;
- ObjectMarking::WhiteToBlack<MarkingMode::YOUNG_GENERATION>(object);
+ ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC,
+ MarkingMode::YOUNG_GENERATION>(object);
IterateBody(object->map(), object);
return true;
}
@@ -1368,11 +1370,11 @@ class RootMarkingVisitor : public ObjectVisitor {
!collector_->heap()->InNewSpace(object))
return;
- if (ObjectMarking::IsBlackOrGrey<mode>(object)) return;
+ if (ObjectMarking::IsBlackOrGrey<MarkBit::NON_ATOMIC, mode>(object)) return;
Map* map = object->map();
// Mark the object.
- ObjectMarking::WhiteToBlack<mode>(object);
+ ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC, mode>(object);
switch (mode) {
case MarkingMode::FULL: {
@@ -1987,7 +1989,7 @@ void MarkCompactCollector::EmptyMarkingDeque() {
DCHECK(!object->IsFiller());
DCHECK(object->IsHeapObject());
DCHECK(heap()->Contains(object));
- DCHECK(!ObjectMarking::IsWhite<mode>(object));
+ DCHECK(!(ObjectMarking::IsWhite<MarkBit::NON_ATOMIC, mode>(object)));
Map* map = object->map();
switch (mode) {
@@ -1996,7 +1998,7 @@ void MarkCompactCollector::EmptyMarkingDeque() {
MarkCompactMarkingVisitor::IterateBody(map, object);
} break;
case MarkingMode::YOUNG_GENERATION: {
- DCHECK(ObjectMarking::IsBlack<mode>(object));
+ DCHECK((ObjectMarking::IsBlack<MarkBit::NON_ATOMIC, mode>(object)));
StaticYoungGenerationMarkingVisitor::IterateBody(map, object);
} break;
}
@@ -2254,11 +2256,13 @@ SlotCallbackResult MarkCompactCollector::CheckAndMarkObject(
// has to be in ToSpace.
DCHECK(heap->InToSpace(object));
HeapObject* heap_object = reinterpret_cast<HeapObject*>(object);
- if (ObjectMarking::IsBlackOrGrey<MarkingMode::YOUNG_GENERATION>(
+ if (ObjectMarking::IsBlackOrGrey<MarkBit::NON_ATOMIC,
+ MarkingMode::YOUNG_GENERATION>(
heap_object)) {
return KEEP_SLOT;
}
- ObjectMarking::WhiteToBlack<MarkingMode::YOUNG_GENERATION>(heap_object);
+ ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC,
+ MarkingMode::YOUNG_GENERATION>(heap_object);
StaticYoungGenerationMarkingVisitor::IterateBody(heap_object->map(),
heap_object);
return KEEP_SLOT;
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698