diff --git a/runtime/vm/program_visitor.cc b/runtime/vm/program_visitor.cc index cb22ae706f3..af88a749626 100644 --- a/runtime/vm/program_visitor.cc +++ b/runtime/vm/program_visitor.cc @@ -926,16 +926,9 @@ void ProgramVisitor::DedupUnlinkedCalls(Thread* thread) { StackZone stack_zone(thread); DedupUnlinkedCallsVisitor visitor(thread->zone(), thread->isolate_group()); - // Note: in bare instructions mode we can still have object pools attached - // to code objects and these pools need to be deduplicated. - // We use these pools to carry information about references between code - // objects and other objects in the snapshots (these references are otherwise - // implicit and go through global object pool). This information is needed - // to produce more informative snapshot profile. - if (FLAG_write_v8_snapshot_profile_to != nullptr || - FLAG_trace_precompiler_to != nullptr) { - WalkProgram(thread->zone(), thread->isolate_group(), &visitor); - } + // Deduplicate local object pools as they are used to trace + // objects when writing snapshots. + WalkProgram(thread->zone(), thread->isolate_group(), &visitor); } void ProgramVisitor::PruneSubclasses(Thread* thread) {