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

Unified Diff: src/incremental-marking-inl.h

Issue 6928010: Make the marking stack into a deque (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 8 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
Index: src/incremental-marking-inl.h
===================================================================
--- src/incremental-marking-inl.h (revision 7781)
+++ src/incremental-marking-inl.h (working copy)
@@ -40,7 +40,7 @@
if (IsWhite(value_bit)) {
MarkBit obj_bit = heap_->marking()->MarkBitFrom(obj);
if (IsBlack(obj_bit)) {
- BlackToGreyAndPush(obj, obj_bit);
+ BlackToGreyAndUnshift(obj, obj_bit);
RestartIfNotMarking();
}
}
@@ -63,14 +63,15 @@
if (!IsStopped()) {
MarkBit obj_bit = heap_->marking()->MarkBitFrom(obj);
if (IsBlack(obj_bit)) {
- BlackToGreyAndPush(obj, obj_bit);
+ BlackToGreyAndUnshift(obj, obj_bit);
RestartIfNotMarking();
}
}
}
-void IncrementalMarking::BlackToGreyAndPush(HeapObject* obj, MarkBit mark_bit) {
+void IncrementalMarking::BlackToGreyAndUnshift(HeapObject* obj,
+ MarkBit mark_bit) {
ASSERT(heap_->marking()->MarkBitFrom(obj) == mark_bit);
ASSERT(obj->Size() >= 2*kPointerSize);
ASSERT(!IsStopped());
@@ -78,15 +79,15 @@
mark_bit.Next().Set();
ASSERT(IsGrey(mark_bit));
- marking_stack_.Push(obj);
- ASSERT(!marking_stack_.overflowed());
+ marking_deque_.Unshift(obj);
+ ASSERT(!marking_deque_.overflowed());
}
void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) {
WhiteToGrey(obj, mark_bit);
- marking_stack_.Push(obj);
- ASSERT(!marking_stack_.overflowed());
+ marking_deque_.Push(obj);
+ ASSERT(!marking_deque_.overflowed());
}
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact.h » ('j') | src/mark-compact.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698