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

Unified Diff: src/spaces.h

Issue 174219: Shrink new space on compacting collections. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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/heap.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
===================================================================
--- src/spaces.h (revision 2737)
+++ src/spaces.h (working copy)
@@ -1010,6 +1010,15 @@
// address range to grow).
bool Grow();
+ // Grow the semispace to the new capacity. The new capacity
+ // requested must be larger than the current capacity.
+ bool GrowTo(int new_capacity);
+
+ // Shrinks the semispace to the new capacity. The new capacity
+ // requested must be more than the amount of used memory in the
+ // semispace and less than the current capacity.
+ bool ShrinkTo(int new_capacity);
+
// Returns the start address of the space.
Address low() { return start_; }
// Returns one past the end address of the space.
@@ -1057,11 +1066,14 @@
// Returns the maximum capacity of the semi space.
int MaximumCapacity() { return maximum_capacity_; }
+ // Returns the initial capacity of the semi space.
+ int InitialCapacity() { return initial_capacity_; }
private:
// The current and maximum capacity of the space.
int capacity_;
int maximum_capacity_;
+ int initial_capacity_;
// The start address of the space.
Address start_;
@@ -1152,9 +1164,12 @@
void Flip();
// Grow the capacity of the semispaces. Assumes that they are not at
- // their maximum capacity. Returns a flag indicating success or failure.
- bool Grow();
+ // their maximum capacity.
+ void Grow();
+ // Shrink the capacity of the semispaces.
+ void Shrink();
+
// True if the address or object lies in the address range of either
// semispace (not necessarily below the allocation pointer).
bool Contains(Address a) {
@@ -1181,6 +1196,12 @@
return to_space_.MaximumCapacity();
}
+ // Returns the initial capacity of a semispace.
+ int InitialCapacity() {
+ ASSERT(to_space_.InitialCapacity() == from_space_.InitialCapacity());
+ return to_space_.InitialCapacity();
+ }
+
// Return the address of the allocation pointer in the active semispace.
Address top() { return allocation_info_.top; }
// Return the address of the first object in the active semispace.
« no previous file with comments | « src/heap.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698