Revision: 10415
Author: [email protected]
Date: Tue Jan 17 04:09:11 2012
Log: Make from-space initially uncommitted for another 1Mbyte
improvement in boot time memory usage.
Review URL: http://codereview.chromium.org/9242008
http://code.google.com/p/v8/source/detail?r=10415
Modified:
/branches/bleeding_edge/src/spaces.cc
/branches/bleeding_edge/src/spaces.h
/branches/bleeding_edge/test/cctest/test-mark-compact.cc
=======================================
--- /branches/bleeding_edge/src/spaces.cc Tue Jan 17 03:38:25 2012
+++ /branches/bleeding_edge/src/spaces.cc Tue Jan 17 04:09:11 2012
@@ -1026,16 +1026,15 @@
2 * heap()->ReservedSemiSpaceSize());
ASSERT(IsAddressAligned(chunk_base_, 2 * reserved_semispace_capacity,
0));
- if (!to_space_.SetUp(chunk_base_,
- initial_semispace_capacity,
- maximum_semispace_capacity)) {
+ to_space_.SetUp(chunk_base_,
+ initial_semispace_capacity,
+ maximum_semispace_capacity);
+ from_space_.SetUp(chunk_base_ + reserved_semispace_capacity,
+ initial_semispace_capacity,
+ maximum_semispace_capacity);
+ if (!to_space_.Commit()) {
return false;
}
- if (!from_space_.SetUp(chunk_base_ + reserved_semispace_capacity,
- initial_semispace_capacity,
- maximum_semispace_capacity)) {
- return false;
- }
start_ = chunk_base_;
address_mask_ = ~(2 * reserved_semispace_capacity - 1);
@@ -1266,7 +1265,7 @@
//
-----------------------------------------------------------------------------
// SemiSpace implementation
-bool SemiSpace::SetUp(Address start,
+void SemiSpace::SetUp(Address start,
int initial_capacity,
int maximum_capacity) {
// Creates a space in the young generation. The constructor does not
@@ -1285,8 +1284,6 @@
object_mask_ = address_mask_ | kHeapObjectTagMask;
object_expected_ = reinterpret_cast<uintptr_t>(start) | kHeapObjectTag;
age_mark_ = start_;
-
- return Commit();
}
=======================================
--- /branches/bleeding_edge/src/spaces.h Tue Jan 17 03:38:25 2012
+++ /branches/bleeding_edge/src/spaces.h Tue Jan 17 04:09:11 2012
@@ -1839,8 +1839,9 @@
anchor_(this),
current_page_(NULL) { }
- // Sets up the semispace using the given chunk.
- bool SetUp(Address start, int initial_capacity, int maximum_capacity);
+ // Sets up the semispace using the given chunk. After this, call
Commit()
+ // 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
// is not deallocated here.
=======================================
--- /branches/bleeding_edge/test/cctest/test-mark-compact.cc Tue Jan 17
03:38:25 2012
+++ /branches/bleeding_edge/test/cctest/test-mark-compact.cc Tue Jan 17
04:09:11 2012
@@ -534,15 +534,15 @@
intptr_t booted_memory = MemoryInUse();
if (sizeof(initial_memory) == 8) {
if (v8::internal::Snapshot::IsEnabled()) {
- CHECK_LE(booted_memory - initial_memory, 4700 * 1024); // 4640.
+ CHECK_LE(booted_memory - initial_memory, 3700 * 1024); // 3640.
} else {
- CHECK_LE(booted_memory - initial_memory, 4300 * 1024); // 4276.
+ CHECK_LE(booted_memory - initial_memory, 3300 * 1024); // 3276.
}
} else {
if (v8::internal::Snapshot::IsEnabled()) {
- CHECK_LE(booted_memory - initial_memory, 3300 * 1024); // 3276.
+ CHECK_LE(booted_memory - initial_memory, 2300 * 1024); // 2276.
} else {
- CHECK_LE(booted_memory - initial_memory, 3500 * 1024); // 3416
+ CHECK_LE(booted_memory - initial_memory, 2500 * 1024); // 2416
}
}
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev