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

Unified Diff: src/heap/mark-compact-inl.h

Issue 1040443002: MarkBit cleanup: They have to be accessed through Marking accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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.cc ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact-inl.h
diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h
index 757b6c347a04ae3b51356c155dd4985a79a2f27b..fe32df01485a934df955ebbbd455c82ee77b8d8b 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -28,10 +28,9 @@ void MarkCompactCollector::SetFlags(int flags) {
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
DCHECK(Marking::MarkBitFrom(obj) == mark_bit);
- if (!mark_bit.Get()) {
- mark_bit.Set();
+ if (Marking::IsWhite(mark_bit)) {
+ Marking::WhiteToBlack(mark_bit);
MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size());
- DCHECK(IsMarked(obj));
DCHECK(obj->GetIsolate()->heap()->Contains(obj));
marking_deque_.PushBlack(obj);
}
@@ -39,9 +38,9 @@ void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
- DCHECK(!mark_bit.Get());
+ DCHECK(Marking::IsWhite(mark_bit));
DCHECK(Marking::MarkBitFrom(obj) == mark_bit);
- mark_bit.Set();
+ Marking::WhiteToBlack(mark_bit);
MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size());
}
@@ -49,7 +48,7 @@ void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
bool MarkCompactCollector::IsMarked(Object* obj) {
DCHECK(obj->IsHeapObject());
HeapObject* heap_object = HeapObject::cast(obj);
- return Marking::MarkBitFrom(heap_object).Get();
+ return Marking::IsBlackOrGrey(Marking::MarkBitFrom(heap_object));
}
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698