Reviewers: Søren Gjesse,

Description:
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

Please review this at http://codereview.chromium.org/6410030/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/heap-profiler.cc


Index: src/heap-profiler.cc
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
index dfda7c6fec5a8e3b546b1d1e487b3993b104a23f..732d2f4102dd47d4728dbbc72dc568d4e429aa59 100644
--- a/src/heap-profiler.cc
+++ b/src/heap-profiler.cc
@@ -373,6 +373,7 @@ HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name,
   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::CollectStats(HeapObject* obj) {


 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