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

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

Issue 1293773002: [heap] Simplify MarkingDeque implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar work. Created 5 years, 4 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
« src/heap/mark-compact.h ('K') | « src/heap/mark-compact.cc ('k') | no next file » | 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 d38e31e55602c14a874814ca5605facc46b61e43..015440bc40f222e314a11de2973cb23e981db854 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -23,13 +23,21 @@ void MarkCompactCollector::SetFlags(int flags) {
}
+void MarkCompactCollector::PushBlack(HeapObject* obj) {
Michael Lippautz 2015/08/14 12:44:36 Suggestion: We could return the status of the oper
Michael Starzinger 2015/08/14 13:23:13 Acknowledged. Would you be fine with doing this as
Michael Lippautz 2015/08/14 13:26:46 Sure.
+ if (marking_deque_.PushBlack(obj)) {
+ MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
+ } else {
+ Marking::BlackToGrey(obj);
+ }
+}
+
+
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
DCHECK(Marking::MarkBitFrom(obj) == mark_bit);
if (Marking::IsWhite(mark_bit)) {
Marking::WhiteToBlack(mark_bit);
- MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
DCHECK(obj->GetIsolate()->heap()->Contains(obj));
- marking_deque_.PushBlack(obj);
+ PushBlack(obj);
}
}
« src/heap/mark-compact.h ('K') | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698