From e0cbbd2d8b545f0d47a4a747fc3239ac5d9f62d1 Mon Sep 17 00:00:00 2001 From: "titzer@chromium.org" Date: Thu, 6 Nov 2014 14:57:54 +0000 Subject: [PATCH] [turbofan] Allocate a small amount of slack space to graph builder environments. R=mstarzinger@chromium.org BUG= Review URL: https://codereview.chromium.org/709463003 Cr-Commit-Position: refs/heads/master@{#25200} git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25200 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/graph-builder.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/graph-builder.cc b/src/compiler/graph-builder.cc index 2ca0688..65ce345 100644 --- a/src/compiler/graph-builder.cc +++ b/src/compiler/graph-builder.cc @@ -125,7 +125,11 @@ StructuredGraphBuilder::Environment::Environment(const Environment& copy) : builder_(copy.builder()), control_dependency_(copy.control_dependency_), effect_dependency_(copy.effect_dependency_), - values_(copy.values_) {} + values_(copy.zone()) { + const size_t kStackEstimate = 7; // optimum from experimentation! + values_.reserve(copy.values_.size() + kStackEstimate); + values_.insert(values_.begin(), copy.values_.begin(), copy.values_.end()); +} void StructuredGraphBuilder::Environment::Merge(Environment* other) { -- 2.7.4