Commit 6742d410 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Make heap snapshot generator GC consistent with other inspector GCs

This calls Heap::CollectAllAvailableGarbage() in the heap snapshot
generator.

Bug: chromium:1113467
Change-Id: Ia7f58893a36f11f80f1bffafcea0e73f5ec49901
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456687
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70829}
parent 1b9ecebb
......@@ -2089,14 +2089,7 @@ bool HeapSnapshotGenerator::GenerateSnapshot() {
base::Optional<HandleScope> handle_scope(base::in_place, isolate);
v8_heap_explorer_.CollectGlobalObjectsTags();
// TODO(1562) Profiler assumes that any object that is in the heap after
// full GC is reachable from the root when computing dominators.
// This is not true for weakly reachable objects.
// As a temporary solution we call GC twice.
heap_->PreciseCollectAllGarbage(Heap::kNoGCFlags,
GarbageCollectionReason::kHeapProfiler);
heap_->PreciseCollectAllGarbage(Heap::kNoGCFlags,
GarbageCollectionReason::kHeapProfiler);
heap_->CollectAllAvailableGarbage(GarbageCollectionReason::kHeapProfiler);
NullContextForSnapshotScope null_context_scope(isolate);
SafepointScope scope(heap_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment