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

Unified Diff: src/spaces.h

Issue 7891010: Implement shrinking of paged spaces during sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Added tracing output. 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
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 428f873c61c398aa749e8e5f314001e862fd2f6d..6149334fe8cdccaeb29801818bde11d8f5c79d0a 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1235,6 +1235,15 @@ class AllocationStats BASE_EMBEDDED {
ASSERT(size_ >= 0);
}
+ // Shrink the space by removing available bytes. Since shrinking is done
+ // during sweeping, bytes have been marked as being in use (part of the size)
+ // and are hereby freed.
+ void ShrinkSpace(int size_in_bytes) {
+ capacity_ -= size_in_bytes;
+ size_ -= size_in_bytes;
+ ASSERT(size_ >= 0);
+ }
+
// Allocate from available bytes (available -> size).
void AllocateBytes(intptr_t size_in_bytes) {
size_ += size_in_bytes;
@@ -1484,8 +1493,6 @@ class PagedSpace : public Space {
return size_in_bytes - wasted;
}
- int FreeOrUnmapPage(Page* page, Address start, int size_in_bytes);
-
// Set space allocation info.
void SetTop(Address top, Address limit) {
ASSERT(top == limit ||
@@ -1502,8 +1509,11 @@ class PagedSpace : public Space {
accounting_stats_.ExpandSpace(size);
}
- // Releases half of unused pages.
- void Shrink();
+ // Releases an unused page and shrinks the space.
+ void ReleasePage(Page* page);
+
+ // Releases all of the unused pages.
+ void ReleaseAllUnusedPages();
// The dummy page that anchors the linked list of pages.
Page* anchor() { return &anchor_; }
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698