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

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: Address review comments. Make compile on x64. 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
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.h
diff --git a/src/mark-compact.h b/src/mark-compact.h
index 21a381055118886f041c31af9258ab1291d443bf..d9b9f1a4f4b6cba288e8c038d525dd883a60fe7b 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 the object whose mark is transferred is marked black.
+ bool TransferMark(Address old_start, Address new_start);
#ifdef DEBUG
enum ObjectColor {
@@ -152,13 +153,23 @@ class Marking {
}
#endif
- INLINE(static void TransferColor(HeapObject* from,
+ // Returns true if the transferred color is black.
+ 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:
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698