Revision: 6598
Author: [email protected]
Date: Thu Feb  3 00:45:38 2011
Log: Heap profiler: fix removed DOM wrappers reporting.

Aggregated snapshots: don't report unreachable objects.
Full snapshots: restore forcing GC prior to taking a snapshot.

I played with the repro page provided for the bug and found that GC
must be performed prior to taking a snapshot even if we only report
reachable objects. GC allows weak handles to finalize.  Now heap
profiler produces aligned results for the repro page in both modes.

BUG=crbug/70434
TEST=none

Review URL: http://codereview.chromium.org/6410030
http://code.google.com/p/v8/source/detail?r=6598

Modified:
 /branches/bleeding_edge/src/heap-profiler.cc

=======================================
--- /branches/bleeding_edge/src/heap-profiler.cc        Tue Dec 21 02:49:40 2010
+++ /branches/bleeding_edge/src/heap-profiler.cc        Thu Feb  3 00:45:38 2011
@@ -373,6 +373,7 @@
   bool generation_completed = true;
   switch (s_type) {
     case HeapSnapshot::kFull: {
+      Heap::CollectAllGarbage(true);
       HeapSnapshotGenerator generator(result, control);
       generation_completed = generator.GenerateSnapshot();
       break;
@@ -808,7 +809,7 @@


 void AggregatedHeapSnapshotGenerator::GenerateSnapshot() {
-  HeapIterator iterator(HeapIterator::kFilterFreeListNodes);
+  HeapIterator iterator(HeapIterator::kFilterUnreachable);
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
     CollectStats(obj);
     agg_snapshot_->js_cons_profile()->CollectStats(obj);

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

Reply via email to