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

Unified Diff: src/spaces.h

Issue 7834018: Support compaction for code space pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: port changes from ia32 to arm & x64 Created 9 years, 3 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/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 376bd4bfae3acfebf7a7e08dddc5fa81f140ccd2..b2c57fc27e2dda16ea362303d181175da8084f61 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1461,12 +1461,20 @@ class PagedSpace : public Space {
intptr_t sizes[4];
free_list_.CountFreeListItems(p, sizes);
- intptr_t ratio =
- (sizes[0] * 5 + sizes[1]) * 100 / Page::kObjectAreaSize;
+ intptr_t ratio;
+ intptr_t ratio_threshold;
+ if (identity() == CODE_SPACE) {
+ ratio = (sizes[1] * 10 + sizes[2] * 2) * 100 / Page::kObjectAreaSize;
+ ratio_threshold = 10;
+ } else {
+ ratio = (sizes[0] * 5 + sizes[1]) * 100 / Page::kObjectAreaSize;
+ ratio_threshold = 15;
+ }
if (FLAG_trace_fragmentation) {
- PrintF("%p: %d (%.2f%%) %d (%.2f%%) %d (%.2f%%) %d (%.2f%%) %s\n",
+ PrintF("%p [%d]: %d (%.2f%%) %d (%.2f%%) %d (%.2f%%) %d (%.2f%%) %s\n",
reinterpret_cast<void*>(p),
+ identity(),
static_cast<int>(sizes[0]),
static_cast<double>(sizes[0] * 100) / Page::kObjectAreaSize,
static_cast<int>(sizes[1]),
@@ -1475,10 +1483,10 @@ class PagedSpace : public Space {
static_cast<double>(sizes[2] * 100) / Page::kObjectAreaSize,
static_cast<int>(sizes[3]),
static_cast<double>(sizes[3] * 100) / Page::kObjectAreaSize,
- (ratio > 15) ? "[fragmented]" : "");
+ (ratio > ratio_threshold) ? "[fragmented]" : "");
}
- return ratio > 15;
+ return ratio > ratio_threshold;
}
void EvictEvacuationCandidatesFromFreeLists();
« src/mark-compact.cc ('K') | « src/objects-inl.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698