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

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

Issue 1128683006: Don't UnshiftGrey any black objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/incremental-marking.cc ('K') | « src/heap/incremental-marking.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.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index 322965decdd4e6d57a403f152c85ab8a07c26c16..e8f5c63fe3925a9dcbe3197cf5f31af52b332845 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -244,6 +244,7 @@ class MarkingDeque {
INLINE(void UnshiftGrey(HeapObject* object)) {
DCHECK(object->IsHeapObject());
+ DCHECK(Marking::IsGrey(Marking::MarkBitFrom(object)));
if (IsFull()) {
SetOverflowed();
} else {
@@ -252,6 +253,19 @@ class MarkingDeque {
}
}
+ INLINE(void UnshiftBlack(HeapObject* object)) {
+ DCHECK(object->IsHeapObject());
+ DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object)));
+ if (IsFull()) {
+ Marking::BlackToGrey(object);
+ MemoryChunk::IncrementLiveBytesFromGC(object->address(), -object->Size());
+ SetOverflowed();
+ } else {
+ bottom_ = ((bottom_ - 1) & mask_);
+ array_[bottom_] = object;
+ }
+ }
+
HeapObject** array() { return array_; }
int bottom() { return bottom_; }
int top() { return top_; }
« src/heap/incremental-marking.cc ('K') | « src/heap/incremental-marking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698