diff --git a/src/compiler/load-elimination.cc b/src/compiler/load-elimination.cc index f9998723f3..8412abecec 100644 --- a/src/compiler/load-elimination.cc +++ b/src/compiler/load-elimination.cc @@ -1197,9 +1197,12 @@ LoadElimination::AbstractState const* LoadElimination::ComputeLoopState( ElementsTransition transition; Node* object; }; - ZoneVector element_transitions_(zone()); - ZoneQueue queue(zone()); - ZoneSet visited(zone()); + // Allocate zone data structures in a temporary zone with a lifetime limited + // to this function to avoid blowing up the size of the stage-global zone. + Zone temp_zone(zone()->allocator(), "Temporary scoped zone"); + ZoneVector element_transitions_(&temp_zone); + ZoneQueue queue(&temp_zone); + ZoneSet visited(&temp_zone); visited.insert(node); for (int i = 1; i < control->InputCount(); ++i) { queue.push(node->InputAt(i));