Author: [email protected]
Date: Tue May 26 02:17:50 2009
New Revision: 2054

Modified:
    branches/bleeding_edge/src/hashmap.cc
    branches/bleeding_edge/src/spaces.cc

Log:
Never use the freelists when always compacting.
Review URL: http://codereview.chromium.org/113825

Modified: branches/bleeding_edge/src/hashmap.cc
==============================================================================
--- branches/bleeding_edge/src/hashmap.cc       (original)
+++ branches/bleeding_edge/src/hashmap.cc       Tue May 26 02:17:50 2009
@@ -87,7 +87,7 @@

  void HashMap::Remove(void* key, uint32_t hash) {
    // Lookup the entry for the key to remove.
-  Entry *p = Probe(key, hash);
+  Entry* p = Probe(key, hash);
    if (p->key == NULL) {
      // Key not found nothing to remove.
      return;

Modified: branches/bleeding_edge/src/spaces.cc
==============================================================================
--- branches/bleeding_edge/src/spaces.cc        (original)
+++ branches/bleeding_edge/src/spaces.cc        Tue May 26 02:17:50 2009
@@ -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;

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to