Index: src/heap/incremental-marking.h |
diff --git a/src/heap/incremental-marking.h b/src/heap/incremental-marking.h |
index 5f5a1deae781467544cc5d2db744ba433028a4fb..7ecbf3581e1dc8b7b2d09cd7a01af2b05c69a9e7 100644 |
--- a/src/heap/incremental-marking.h |
+++ b/src/heap/incremental-marking.h |
@@ -9,6 +9,7 @@ |
#include "src/execution.h" |
#include "src/heap/heap.h" |
#include "src/heap/incremental-marking-job.h" |
+#include "src/heap/mark-compact.h" |
#include "src/heap/spaces.h" |
#include "src/objects.h" |
@@ -205,6 +206,25 @@ class IncrementalMarking { |
static void MarkObject(Heap* heap, HeapObject* object); |
+ static void TransferMark(Heap* heap, Address old_start, Address new_start); |
+ |
+ // Returns true if the transferred color is black. |
+ INLINE(static bool TransferColor(HeapObject* from, HeapObject* to)) { |
+ if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE)) |
+ return true; |
+ MarkBit from_mark_bit = ObjectMarking::MarkBitFrom(from); |
+ MarkBit to_mark_bit = ObjectMarking::MarkBitFrom(to); |
+ DCHECK(Marking::IsWhite(to_mark_bit)); |
+ if (from_mark_bit.Get()) { |
+ to_mark_bit.Set(); |
+ if (from_mark_bit.Next().Get()) { |
+ to_mark_bit.Next().Set(); |
+ return true; |
+ } |
+ } |
+ return false; |
+ } |
+ |
void IterateBlackObject(HeapObject* object); |
Heap* heap() const { return heap_; } |