Revision: 17259
Author:   [email protected]
Date:     Fri Oct 18 08:11:36 2013 UTC
Log: Revert "HeapProfiler: for the test purposes we would like to trace object movements."

Compilation failed on Win64.

This reverts commit 6909faccca68c04b7ec4537538e6e7a0cc1650b8.

BUG=none
TBR=yurys

Review URL: https://codereview.chromium.org/28573002
http://code.google.com/p/v8/source/detail?r=17259

Modified:
 /branches/bleeding_edge/src/builtins.cc
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/heap-snapshot-generator.cc

=======================================
--- /branches/bleeding_edge/src/builtins.cc     Fri Oct 18 07:43:50 2013 UTC
+++ /branches/bleeding_edge/src/builtins.cc     Fri Oct 18 08:11:36 2013 UTC
@@ -273,15 +273,14 @@
MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta);
   }

-  FixedArrayBase* new_elms = FixedArrayBase::cast(HeapObject::FromAddress(
-      elms->address() + size_delta));
   HeapProfiler* profiler = heap->isolate()->heap_profiler();
   if (profiler->is_profiling()) {
     profiler->ObjectMoveEvent(elms->address(),
-                              new_elms->address(),
-                              new_elms->Size());
+                              elms->address() + size_delta,
+                              elms->Size());
   }
-  return new_elms;
+  return FixedArrayBase::cast(HeapObject::FromAddress(
+      elms->address() + to_trim * entry_size));
 }


=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Fri Oct 18 07:43:50 2013 UTC +++ /branches/bleeding_edge/src/flag-definitions.h Fri Oct 18 08:11:36 2013 UTC
@@ -541,12 +541,6 @@
 DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
 #endif

-
-// heap-snapshot-generator.cc
-DEFINE_bool(heap_profiler_trace_objects, false,
-            "Dump heap object allocations/movements/size_updates")
-
-
 // v8.cc
 DEFINE_bool(use_idle_notification, true,
             "Use idle notification to reduce memory footprint.")
=======================================
--- /branches/bleeding_edge/src/heap-snapshot-generator.cc Fri Oct 18 07:43:50 2013 UTC +++ /branches/bleeding_edge/src/heap-snapshot-generator.cc Fri Oct 18 08:11:36 2013 UTC
@@ -431,13 +431,6 @@
     // Size of an object can change during its life, so to keep information
// about the object in entries_ consistent, we have to adjust size when the
     // object is migrated.
-    if (FLAG_heap_profiler_trace_objects) {
-      PrintF("Move object from %p to %p old size %6d new size %6d\n",
-             from,
-             to,
-             entries_.at(from_entry_info_index).size,
-             object_size);
-    }
     entries_.at(from_entry_info_index).size = object_size;
     to_entry->value = from_value;
   }
@@ -445,12 +438,6 @@


 void HeapObjectsMap::NewObject(Address addr, int size) {
-  if (FLAG_heap_profiler_trace_objects) {
-    PrintF("New object         : %p %6d. Next address is %p\n",
-           addr,
-           size,
-           addr + size);
-  }
   ASSERT(addr != NULL);
   FindOrAddEntry(addr, size, false);
 }
@@ -483,12 +470,6 @@
         static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
     EntryInfo& entry_info = entries_.at(entry_index);
     entry_info.accessed = accessed;
-    if (FLAG_heap_profiler_trace_objects) {
-      PrintF("Update object size : %p with old size %d and new size %d\n",
-             addr,
-             entry_info.size,
-             size);
-    }
     entry_info.size = size;
     return entry_info.id;
   }
@@ -507,10 +488,6 @@


 void HeapObjectsMap::UpdateHeapObjectsMap() {
-  if (FLAG_heap_profiler_trace_objects) {
- PrintF("Begin HeapObjectsMap::UpdateHeapObjectsMap. map has %d entries.\n",
-           entries_map_.occupancy());
-  }
   heap_->CollectAllGarbage(Heap::kMakeHeapIterableMask,
                           "HeapSnapshotsCollection::UpdateHeapObjectsMap");
   HeapIterator iterator(heap_);
@@ -518,68 +495,12 @@
        obj != NULL;
        obj = iterator.next()) {
     FindOrAddEntry(obj->address(), obj->Size());
-    if (FLAG_heap_profiler_trace_objects) {
-      PrintF("Update object      : %p %6d. Next address is %p\n",
-             obj->address(),
-             obj->Size(),
-             obj->address() + obj->Size());
-    }
   }
   RemoveDeadEntries();
-  if (FLAG_heap_profiler_trace_objects) {
- PrintF("End HeapObjectsMap::UpdateHeapObjectsMap. map has %d entries.\n",
-           entries_map_.occupancy());
-  }
 }


-namespace {
-
-
-struct HeapObjectInfo {
-  HeapObjectInfo(HeapObject* obj, size_t expected_size)
-    : obj(obj),
-      expected_size(expected_size) {
-  }
-
-  HeapObject* obj;
-  int expected_size;
-
-  bool IsValid() const { return expected_size == obj->Size(); }
-
-  void Print() const {
-    if (expected_size == 0) {
-      PrintF("Untracked object   : %p %6d. Next address is %p\n",
-             obj->address(),
-             obj->Size(),
-             obj->address() + obj->Size());
-    } else if (obj->Size() != expected_size) {
-      PrintF("Wrong size %6d: %p %6d. Next address is %p\n",
-             expected_size,
-             obj->address(),
-             obj->Size(),
-             obj->address() + obj->Size());
-    } else {
-      PrintF("Good object      : %p %6d. Next address is %p\n",
-             obj->address(),
-             expected_size,
-             obj->address() + obj->Size());
-    }
-  }
-};
-
-
-static int comparator(const HeapObjectInfo* a, const HeapObjectInfo* b) {
-  return a->obj - b->obj;
-}
-
-
-}  // namespace
-
-
 int HeapObjectsMap::FindUntrackedObjects() {
-  List<HeapObjectInfo> heap_objects(1000);
-
   HeapIterator iterator(heap_);
   int untracked = 0;
   for (HeapObject* obj = iterator.next();
@@ -588,56 +509,14 @@
     HashMap::Entry* entry = entries_map_.Lookup(
       obj->address(), ComputePointerHash(obj->address()), false);
     if (entry == NULL) {
-      ++untracked;
-      if (FLAG_heap_profiler_trace_objects) {
-        heap_objects.Add(HeapObjectInfo(obj, 0));
-      }
+      untracked++;
     } else {
       int entry_index = static_cast<int>(
           reinterpret_cast<intptr_t>(entry->value));
       EntryInfo& entry_info = entries_.at(entry_index);
-      if (FLAG_heap_profiler_trace_objects) {
-        heap_objects.Add(HeapObjectInfo(obj,
-                         static_cast<int>(entry_info.size)));
-        if (obj->Size() != static_cast<int>(entry_info.size))
-          ++untracked;
-      } else {
-        CHECK_EQ(obj->Size(), static_cast<int>(entry_info.size));
-      }
+      CHECK_EQ(obj->Size(), static_cast<int>(entry_info.size));
     }
   }
-  if (FLAG_heap_profiler_trace_objects) {
- PrintF("\nBegin HeapObjectsMap::FindUntrackedObjects. %d entries in map.\n",
-           entries_map_.occupancy());
-    heap_objects.Sort(comparator);
-    int last_printed_object = -1;
-    bool print_next_object = false;
-    for (int i = 0; i < heap_objects.length(); ++i) {
-      const HeapObjectInfo& object_info = heap_objects[i];
-      if (!object_info.IsValid()) {
-        ++untracked;
-        if (last_printed_object != i - 1) {
-          if (i > 0) {
- PrintF("%d objects were skipped\n", i - 1 - last_printed_object);
-            heap_objects[i - 1].Print();
-          }
-        }
-        object_info.Print();
-        last_printed_object = i;
-        print_next_object = true;
-      } else if (print_next_object) {
-        object_info.Print();
-        print_next_object = false;
-        last_printed_object = i;
-      }
-    }
-    if (last_printed_object < heap_objects.length() - 1) {
-      PrintF("Last %d objects were skipped\n",
-             heap_objects.length() - 1 - last_printed_object);
-    }
- PrintF("End HeapObjectsMap::FindUntrackedObjects. %d entries in map.\n\n",
-           entries_map_.occupancy());
-  }
   return untracked;
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to