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

Unified Diff: src/mark-compact.h

Issue 7247002: Estimate a (close) upper bound on the size of black-marked objects on each page. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 6 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/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:

Powered by Google App Engine
This is Rietveld 408576698