Revision: 3098
Author: [email protected]
Date: Tue Oct 20 16:25:05 2009
Log: applied patch
http://code.google.com/p/v8/source/detail?r=3098

Modified:
  /branches/bleeding_edge/src/heap-profiler.cc
  /branches/bleeding_edge/src/spaces-inl.h
  /branches/bleeding_edge/src/spaces.cc
  /branches/bleeding_edge/src/spaces.h

=======================================
--- /branches/bleeding_edge/src/heap-profiler.cc        Thu Oct 15 00:50:23 2009
+++ /branches/bleeding_edge/src/heap-profiler.cc        Tue Oct 20 16:25:05 2009
@@ -576,8 +576,10 @@
  void HeapProfiler::CollectStats(HeapObject* obj, HistogramInfo* info) {
    InstanceType type = obj->map()->instance_type();
    ASSERT(0 <= type && type <= LAST_TYPE);
-  info[type].increment_number(1);
-  info[type].increment_bytes(obj->Size());
+  if (!FreeListNode::IsFreeListNode(obj)) {
+    info[type].increment_number(1);
+    info[type].increment_bytes(obj->Size());
+  }
  }


=======================================
--- /branches/bleeding_edge/src/spaces-inl.h    Wed Aug  5 04:08:24 2009
+++ /branches/bleeding_edge/src/spaces-inl.h    Tue Oct 20 16:25:05 2009
@@ -359,6 +359,13 @@
  #endif
    return obj;
  }
+
+
+bool FreeListNode::IsFreeListNode(HeapObject* object) {
+  return object->map() == Heap::raw_unchecked_byte_array_map()
+      || object->map() == Heap::raw_unchecked_one_pointer_filler_map()
+      || object->map() == Heap::raw_unchecked_two_pointer_filler_map();
+}

  } }  // namespace v8::internal

=======================================
--- /branches/bleeding_edge/src/spaces.cc       Mon Oct  5 04:16:25 2009
+++ /branches/bleeding_edge/src/spaces.cc       Tue Oct 20 16:25:05 2009
@@ -1540,8 +1540,7 @@


  Address FreeListNode::next() {
-  ASSERT(map() == Heap::raw_unchecked_byte_array_map() ||
-         map() == Heap::raw_unchecked_two_pointer_filler_map());
+  ASSERT(IsFreeListNode(this));
    if (map() == Heap::raw_unchecked_byte_array_map()) {
      ASSERT(Size() >= kNextOffset + kPointerSize);
      return Memory::Address_at(address() + kNextOffset);
@@ -1552,8 +1551,7 @@


  void FreeListNode::set_next(Address next) {
-  ASSERT(map() == Heap::raw_unchecked_byte_array_map() ||
-         map() == Heap::raw_unchecked_two_pointer_filler_map());
+  ASSERT(IsFreeListNode(this));
    if (map() == Heap::raw_unchecked_byte_array_map()) {
      ASSERT(Size() >= kNextOffset + kPointerSize);
      Memory::Address_at(address() + kNextOffset) = next;
=======================================
--- /branches/bleeding_edge/src/spaces.h        Tue Oct 20 00:51:49 2009
+++ /branches/bleeding_edge/src/spaces.h        Tue Oct 20 16:25:05 2009
@@ -1434,6 +1434,8 @@
    static FreeListNode* FromAddress(Address address) {
      return  
reinterpret_cast<FreeListNode*>(HeapObject::FromAddress(address));
    }
+
+  static inline bool IsFreeListNode(HeapObject* object);

    // Set the size in bytes, which can be read with HeapObject::Size().   
This
    // function also writes a map to the first word of the block so that it

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

Reply via email to