Index: src/heap/spaces.h |
diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
index e233b328511601a46e9a6815763997175cdd9aa1..1a9a9ee5a7f13c42abea4c257c7953ec7a0fc8c4 100644 |
--- a/src/heap/spaces.h |
+++ b/src/heap/spaces.h |
@@ -203,6 +203,8 @@ class Bitmap { |
static inline void Clear(MemoryChunk* chunk); |
+ static inline void SetAllBits(MemoryChunk* chunk); |
+ |
static void PrintWord(uint32_t word, uint32_t himask = 0) { |
for (uint32_t mask = 1; mask != 0; mask <<= 1) { |
if ((mask & himask) != 0) PrintF("["); |
@@ -314,6 +316,10 @@ class MemoryChunk { |
// to grey transition is performed in the value. |
HAS_PROGRESS_BAR, |
+ // A black page has all mark bits set to 1 (black). A black page currently |
+ // cannot be iterated because it is not swept. |
Michael Lippautz
2016/02/04 17:59:51
Add: Live bytes are also not updated on those page
Hannes Payer (out of office)
2016/02/06 08:50:16
Done.
|
+ BLACK_PAGE, |
+ |
// This flag is intended to be used for testing. Works only when both |
// FLAG_stress_compaction and FLAG_manual_evacuation_candidates_selection |
// are set. It forces the page to become an evacuation candidate at next |
@@ -573,6 +579,7 @@ class MemoryChunk { |
} |
void IncrementLiveBytes(int by) { |
+ if (IsFlagSet(BLACK_PAGE)) return; |
if (FLAG_gc_verbose) { |
printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", static_cast<void*>(this), |
live_byte_count_, ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by), |
@@ -585,10 +592,12 @@ class MemoryChunk { |
int LiveBytes() { |
DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_); |
+ DCHECK(!IsFlagSet(BLACK_PAGE) || live_byte_count_ == 0); |
return live_byte_count_; |
} |
void SetLiveBytes(int live_bytes) { |
+ if (IsFlagSet(BLACK_PAGE)) return; |
DCHECK_GE(live_bytes, 0); |
DCHECK_LE(static_cast<unsigned>(live_bytes), size_); |
live_byte_count_ = live_bytes; |
@@ -2181,6 +2190,7 @@ class PagedSpace : public Space { |
// Mutex guarding any concurrent access to the space. |
base::Mutex space_mutex_; |
+ friend class IncrementalMarking; |
friend class MarkCompactCollector; |
friend class PageIterator; |