Commit fdc163bb authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Make from-space initially uncommitted for another 1Mbyte

improvement in boot time memory usage.
Review URL: http://codereview.chromium.org/9242008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 516f08af
...@@ -1026,14 +1026,13 @@ bool NewSpace::SetUp(int reserved_semispace_capacity, ...@@ -1026,14 +1026,13 @@ bool NewSpace::SetUp(int reserved_semispace_capacity,
2 * heap()->ReservedSemiSpaceSize()); 2 * heap()->ReservedSemiSpaceSize());
ASSERT(IsAddressAligned(chunk_base_, 2 * reserved_semispace_capacity, 0)); ASSERT(IsAddressAligned(chunk_base_, 2 * reserved_semispace_capacity, 0));
if (!to_space_.SetUp(chunk_base_, to_space_.SetUp(chunk_base_,
initial_semispace_capacity, initial_semispace_capacity,
maximum_semispace_capacity)) { maximum_semispace_capacity);
return false; from_space_.SetUp(chunk_base_ + reserved_semispace_capacity,
} initial_semispace_capacity,
if (!from_space_.SetUp(chunk_base_ + reserved_semispace_capacity, maximum_semispace_capacity);
initial_semispace_capacity, if (!to_space_.Commit()) {
maximum_semispace_capacity)) {
return false; return false;
} }
...@@ -1266,7 +1265,7 @@ void NewSpace::Verify() { ...@@ -1266,7 +1265,7 @@ void NewSpace::Verify() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// SemiSpace implementation // SemiSpace implementation
bool SemiSpace::SetUp(Address start, void SemiSpace::SetUp(Address start,
int initial_capacity, int initial_capacity,
int maximum_capacity) { int maximum_capacity) {
// Creates a space in the young generation. The constructor does not // Creates a space in the young generation. The constructor does not
...@@ -1285,8 +1284,6 @@ bool SemiSpace::SetUp(Address start, ...@@ -1285,8 +1284,6 @@ bool SemiSpace::SetUp(Address start,
object_mask_ = address_mask_ | kHeapObjectTagMask; object_mask_ = address_mask_ | kHeapObjectTagMask;
object_expected_ = reinterpret_cast<uintptr_t>(start) | kHeapObjectTag; object_expected_ = reinterpret_cast<uintptr_t>(start) | kHeapObjectTag;
age_mark_ = start_; age_mark_ = start_;
return Commit();
} }
......
...@@ -1839,8 +1839,9 @@ class SemiSpace : public Space { ...@@ -1839,8 +1839,9 @@ class SemiSpace : public Space {
anchor_(this), anchor_(this),
current_page_(NULL) { } current_page_(NULL) { }
// Sets up the semispace using the given chunk. // Sets up the semispace using the given chunk. After this, call Commit()
bool SetUp(Address start, int initial_capacity, int maximum_capacity); // to make the semispace usable.
void SetUp(Address start, int initial_capacity, int maximum_capacity);
// Tear down the space. Heap memory was not allocated by the space, so it // Tear down the space. Heap memory was not allocated by the space, so it
// is not deallocated here. // is not deallocated here.
......
...@@ -534,15 +534,15 @@ TEST(BootUpMemoryUse) { ...@@ -534,15 +534,15 @@ TEST(BootUpMemoryUse) {
intptr_t booted_memory = MemoryInUse(); intptr_t booted_memory = MemoryInUse();
if (sizeof(initial_memory) == 8) { if (sizeof(initial_memory) == 8) {
if (v8::internal::Snapshot::IsEnabled()) { if (v8::internal::Snapshot::IsEnabled()) {
CHECK_LE(booted_memory - initial_memory, 4700 * 1024); // 4640. CHECK_LE(booted_memory - initial_memory, 3700 * 1024); // 3640.
} else { } else {
CHECK_LE(booted_memory - initial_memory, 4300 * 1024); // 4276. CHECK_LE(booted_memory - initial_memory, 3300 * 1024); // 3276.
} }
} else { } else {
if (v8::internal::Snapshot::IsEnabled()) { if (v8::internal::Snapshot::IsEnabled()) {
CHECK_LE(booted_memory - initial_memory, 3300 * 1024); // 3276. CHECK_LE(booted_memory - initial_memory, 2300 * 1024); // 2276.
} else { } else {
CHECK_LE(booted_memory - initial_memory, 3500 * 1024); // 3416 CHECK_LE(booted_memory - initial_memory, 2500 * 1024); // 2416
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment