Version 1.3.3

Fix issue 417: incorrect %t placeholder expansion.

Add .gitignore file similar to Chromium's one.

Fix SConstruct file to build with new logging code for Android.

API: added function to find instance of template in prototype
chain.  Inlined Object::IsInstanceOf.

Land change to notify valgrind when we modify code on x86.

Add api call to determine whether a string can be externalized.

Add a write() command to d8.


git-svn-id: http://v8.googlecode.com/svn/trunk@2669 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/spaces.cc b/src/spaces.cc
index 4f8119f..6283bba 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -963,13 +963,13 @@
 }
 
 
-bool NewSpace::Double() {
-  ASSERT(capacity_ <= maximum_capacity_ / 2);
+bool NewSpace::Grow() {
+  ASSERT(capacity_ < maximum_capacity_);
   // TODO(1240712): Failure to double the from space can result in
   // semispaces of different sizes.  In the event of that failure, the
   // to space doubling should be rolled back before returning false.
-  if (!to_space_.Double() || !from_space_.Double()) return false;
-  capacity_ *= 2;
+  if (!to_space_.Grow() || !from_space_.Grow()) return false;
+  capacity_ = to_space_.Capacity() + from_space_.Capacity();
   allocation_info_.limit = to_space_.high();
   ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
   return true;
@@ -1074,11 +1074,16 @@
 }
 
 
-bool SemiSpace::Double() {
-  if (!MemoryAllocator::CommitBlock(high(), capacity_, executable())) {
+bool SemiSpace::Grow() {
+  // Commit 50% extra space but only up to maximum capacity.
+  int extra = capacity_/2;
+  if (capacity_ + extra > maximum_capacity_) {
+    extra = maximum_capacity_ - capacity_;
+  }
+  if (!MemoryAllocator::CommitBlock(high(), extra, executable())) {
     return false;
   }
-  capacity_ *= 2;
+  capacity_ += extra;
   return true;
 }