r2080 - Version 1.2.6.

Added a histogram recording hit rates at different levels of the compilation cache.

Added stack overflow check for the RegExp analysis phase. Previously a very long regexp graph could overflow the stack with recursive calls.

Use a dynamic buffer when collecting log events in memory.

Added start/stop events to the profiler log.

Fixed infinite loop which could happen when setting a debug break while executing a RegExp compiled to native code.

Fixed handling of lastIndexOf called with negative index (issue 351).

Fixed irregular crash in profiler test (issue 358).

Fixed compilation issues with some versions of gcc.


git-svn-id: http://v8.googlecode.com/svn/trunk@2080 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/spaces.cc b/src/spaces.cc
index e61c6ad..72b028c 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1332,6 +1332,13 @@
   FreeListNode* node = FreeListNode::FromAddress(start);
   node->set_size(size_in_bytes);
 
+  // We don't use the freelists in compacting mode.  This makes it more like a
+  // GC that only has mark-sweep-compact and doesn't have a mark-sweep
+  // collector.
+  if (FLAG_always_compact) {
+    return size_in_bytes;
+  }
+
   // Early return to drop too-small blocks on the floor (one or two word
   // blocks cannot hold a map pointer, a size field, and a pointer to the
   // next block in the free list).
@@ -1363,6 +1370,7 @@
     if ((free_[index].head_node_ = node->next()) == NULL) RemoveSize(index);
     available_ -= size_in_bytes;
     *wasted_bytes = 0;
+    ASSERT(!FLAG_always_compact);  // We only use the freelists with mark-sweep.
     return node;
   }
   // Search the size list for the best fit.
@@ -1374,6 +1382,7 @@
     *wasted_bytes = 0;
     return Failure::RetryAfterGC(size_in_bytes, owner_);
   }
+  ASSERT(!FLAG_always_compact);  // We only use the freelists with mark-sweep.
   int rem = cur - index;
   int rem_bytes = rem << kPointerSizeLog2;
   FreeListNode* cur_node = FreeListNode::FromAddress(free_[cur].head_node_);
@@ -1454,6 +1463,7 @@
     Memory::Address_at(start + i) = kZapValue;
   }
 #endif
+  ASSERT(!FLAG_always_compact);  // We only use the freelists with mark-sweep.
   FreeListNode* node = FreeListNode::FromAddress(start);
   node->set_size(Map::kSize);
   node->set_next(head_);
@@ -1467,6 +1477,7 @@
     return Failure::RetryAfterGC(Map::kSize, owner_);
   }
 
+  ASSERT(!FLAG_always_compact);  // We only use the freelists with mark-sweep.
   FreeListNode* node = FreeListNode::FromAddress(head_);
   head_ = node->next();
   available_ -= Map::kSize;