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

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

Issue 2644523002: [heap] Provide ObjectMarking with marking transitions (Closed)
Patch Set: Created 3 years, 11 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
Index: src/heap/mark-compact-inl.h
diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h
index 1973753b0c3ae9ed0234b68b7d663135da155add..2c5d1eddaa80a85da6170305aa5193ded82562e2 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -14,11 +14,8 @@ namespace internal {
void MarkCompactCollector::PushBlack(HeapObject* obj) {
DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj)));
Hannes Payer (out of office) 2017/01/18 14:43:35 That would also short cut the double accessors: Ob
Michael Lippautz 2017/01/18 15:58:07 Done.
- if (marking_deque()->Push(obj)) {
- MemoryChunk::IncrementLiveBytes(obj, obj->Size());
- } else {
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
- Marking::BlackToGrey(mark_bit);
+ if (!marking_deque()->Push(obj)) {
+ ObjectMarking::BlackToGrey(obj);
}
}
@@ -26,9 +23,7 @@ void MarkCompactCollector::PushBlack(HeapObject* obj) {
void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj)));
if (!marking_deque()->Unshift(obj)) {
- MemoryChunk::IncrementLiveBytes(obj, -obj->Size());
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
- Marking::BlackToGrey(mark_bit);
+ ObjectMarking::BlackToGrey(obj);
}
}
@@ -36,18 +31,16 @@ void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit);
if (Marking::IsWhite(mark_bit)) {
- Marking::WhiteToBlack(mark_bit);
- DCHECK(obj->GetIsolate()->heap()->Contains(obj));
+ ObjectMarking::WhiteToBlack(obj);
PushBlack(obj);
}
}
void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
- DCHECK(Marking::IsWhite(mark_bit));
+ DCHECK(Marking::IsWhite(ObjectMarking::MarkBitFrom(obj)));
DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit);
- Marking::WhiteToBlack(mark_bit);
- MemoryChunk::IncrementLiveBytes(obj, obj->Size());
+ ObjectMarking::WhiteToBlack(obj);
}

Powered by Google App Engine
This is Rietveld 408576698