Index: src/mark-compact.cc |
=================================================================== |
--- src/mark-compact.cc (revision 9579) |
+++ src/mark-compact.cc (working copy) |
@@ -430,10 +430,18 @@ |
PageIterator it(space); |
int count = 0; |
- if (it.has_next()) it.next(); // Never compact the first page. |
+ if (it.has_next()) it.next(); // Never compact the first page.A |
Vyacheslav Egorov (Chromium)
2011/10/11 13:55:29
accidental edit
|
while (it.has_next()) { |
Page* p = it.next(); |
- if (space->IsFragmented(p)) { |
+ bool evacuate = false; |
+ if (FLAG_stress_compaction) { |
+ int counter = space->heap()->ms_count(); |
+ uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits; |
+ if ((counter & 1) == (page_number & 1)) evacuate = true; |
+ } else { |
+ if (space->IsFragmented(p)) evacuate = true; |
+ } |
+ if (evacuate) { |
AddEvacuationCandidate(p); |
count++; |
} else { |