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

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: Rebased. 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
« no previous file with comments | « 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..2d2feb29e5b169828569497bf7213460da0e0ab3 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -23,13 +23,29 @@ void MarkCompactCollector::SetFlags(int flags) {
}
+void MarkCompactCollector::PushBlack(HeapObject* obj) {
+ if (marking_deque_.PushBlack(obj)) {
+ MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
+ } else {
+ Marking::BlackToGrey(obj);
+ }
+}
+
+
+void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
+ if (!marking_deque_.UnshiftBlack(obj)) {
+ MemoryChunk::IncrementLiveBytesFromGC(obj, -obj->Size());
+ 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);
}
}
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698