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

Unified Diff: src/heap/mark-compact.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/incremental-marking-inl.h ('k') | src/heap/mark-compact-inl.h » ('j') | 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 443c5efb33006a9e5ba080419de5f7f57697987c..6b9708e095d44227590fc3bd894e6eeeb6c434c0 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -205,9 +205,9 @@ class MarkingDeque {
void SetOverflowed() { overflowed_ = true; }
- // Push the (marked) object on the marking stack if there is room, otherwise
- // mark the deque as overflowed and wait for a rescan of the heap.
- INLINE(bool PushBlack(HeapObject* object)) {
+ // Push the object on the marking stack if there is room, otherwise mark the
+ // deque as overflowed and wait for a rescan of the heap.
+ INLINE(bool Push(HeapObject* object)) {
DCHECK(object->IsHeapObject());
if (IsFull()) {
SetOverflowed();
@@ -219,16 +219,6 @@ class MarkingDeque {
}
}
- INLINE(void PushGrey(HeapObject* object)) {
- DCHECK(object->IsHeapObject());
- if (IsFull()) {
- SetOverflowed();
- } else {
- array_[top_] = object;
- top_ = ((top_ + 1) & mask_);
- }
- }
-
INLINE(HeapObject* Pop()) {
DCHECK(!IsEmpty());
top_ = ((top_ - 1) & mask_);
@@ -237,19 +227,10 @@ class MarkingDeque {
return object;
}
- INLINE(void UnshiftGrey(HeapObject* object)) {
- DCHECK(object->IsHeapObject());
- if (IsFull()) {
- SetOverflowed();
- } else {
- bottom_ = ((bottom_ - 1) & mask_);
- array_[bottom_] = object;
- }
- }
-
- INLINE(bool UnshiftBlack(HeapObject* object)) {
+ // Unshift the object into the marking stack if there is room, otherwise mark
+ // the deque as overflowed and wait for a rescan of the heap.
+ INLINE(bool Unshift(HeapObject* object)) {
DCHECK(object->IsHeapObject());
- DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object)));
if (IsFull()) {
SetOverflowed();
return false;
« no previous file with comments | « src/heap/incremental-marking-inl.h ('k') | src/heap/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698