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

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

Issue 1294093003: [heap] Unify MarkingDeque push and unshift operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-includes-heap-2
Patch Set: Fix test case. 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.h ('k') | test/cctest/test-mark-compact.cc » ('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 2d2feb29e5b169828569497bf7213460da0e0ab3..b5f58462dad24bd1d1400ec7eafd366cd05e2ad8 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -24,7 +24,8 @@ void MarkCompactCollector::SetFlags(int flags) {
void MarkCompactCollector::PushBlack(HeapObject* obj) {
- if (marking_deque_.PushBlack(obj)) {
+ DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
+ if (marking_deque_.Push(obj)) {
MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
} else {
Marking::BlackToGrey(obj);
@@ -33,7 +34,8 @@ void MarkCompactCollector::PushBlack(HeapObject* obj) {
void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
- if (!marking_deque_.UnshiftBlack(obj)) {
+ DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
+ if (!marking_deque_.Unshift(obj)) {
MemoryChunk::IncrementLiveBytesFromGC(obj, -obj->Size());
Marking::BlackToGrey(obj);
}
« no previous file with comments | « src/heap/mark-compact.h ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698