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

Unified Diff: src/mark-compact.cc

Issue 8234002: New flag --stress-compaction (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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/v8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
===================================================================
--- src/mark-compact.cc (revision 9579)
+++ src/mark-compact.cc (working copy)
@@ -433,7 +433,15 @@
if (it.has_next()) it.next(); // Never compact the first page.
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 {
« no previous file with comments | « src/incremental-marking.cc ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698