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
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6598
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
bool generation_completed = true;
switch (s_type) {
case HeapSnapshot::kFull: {
+ Heap::CollectAllGarbage(true);
HeapSnapshotGenerator generator(result, control);
generation_completed = generator.GenerateSnapshot();
break;
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);