Chromium Code Reviews| Index: src/mark-compact.h |
| diff --git a/src/mark-compact.h b/src/mark-compact.h |
| index 21a381055118886f041c31af9258ab1291d443bf..04599cc22dc2ae483d8b608cc8a36d31f886621c 100644 |
| --- a/src/mark-compact.h |
| +++ b/src/mark-compact.h |
| @@ -119,7 +119,8 @@ class Marking { |
| BlackToGrey(MarkBitFrom(obj)); |
| } |
| - void TransferMark(Address old_start, Address new_start); |
| + // Returns true if the new_start is marked black. |
|
Erik Corry
2011/06/24 09:46:17
Returns true if the object whose mark is transferr
Lasse Reichstein
2011/06/24 11:09:08
Done.
|
| + bool TransferMark(Address old_start, Address new_start); |
| #ifdef DEBUG |
| enum ObjectColor { |
| @@ -152,13 +153,22 @@ class Marking { |
| } |
| #endif |
|
Erik Corry
2011/06/24 09:46:17
// Returns true if the object whose color was tran
Lasse Reichstein
2011/06/24 11:09:08
Fixed.
|
| - INLINE(static void TransferColor(HeapObject* from, |
| + INLINE(static bool TransferColor(HeapObject* from, |
| HeapObject* to)) { |
| MarkBit from_mark_bit = MarkBitFrom(from); |
| MarkBit to_mark_bit = MarkBitFrom(to); |
| - if (from_mark_bit.Get()) to_mark_bit.Set(); |
| - if (from_mark_bit.Next().Get()) to_mark_bit.Next().Set(); |
| + bool is_black = false; |
| + if (from_mark_bit.Get()) { |
| + to_mark_bit.Set(); |
| + is_black = true; // Looks black so far. |
| + } |
| + if (from_mark_bit.Next().Get()) { |
| + to_mark_bit.Next().Set(); |
| + is_black = false; // Was actually gray. |
| + } |
| ASSERT(Color(from) == Color(to)); |
| + ASSERT(is_black == (Color(to) == BLACK_OBJECT)); |
| + return is_black; |
| } |
| private: |