From 7421c7f5989b6e6df98e47eeb3d499c3b9511cbe Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Mon, 23 Mar 2015 10:30:38 -0700 Subject: [PATCH] Remove dangerous constructor from CompilationInfoWithZone. This removes the stub-based constructor from CompilationInfoWithZone as this class is more than a pure convenience class and only by chance doesn't have an effect in the destructor. R=titzer@chromium.org Review URL: https://codereview.chromium.org/1026513004 Cr-Commit-Position: refs/heads/master@{#27376} --- src/code-stubs-hydrogen.cc | 11 ++++++----- src/compiler.h | 2 -- test/cctest/compiler/test-instruction.cc | 8 +------- test/cctest/compiler/test-linkage.cc | 5 +++-- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc index 599e3c6412..8168aac4b8 100644 --- a/src/code-stubs-hydrogen.cc +++ b/src/code-stubs-hydrogen.cc @@ -35,7 +35,7 @@ static LChunk* OptimizeGraph(HGraph* graph) { class CodeStubGraphBuilderBase : public HGraphBuilder { public: - explicit CodeStubGraphBuilderBase(CompilationInfoWithZone* info) + explicit CodeStubGraphBuilderBase(CompilationInfo* info) : HGraphBuilder(info), arguments_length_(NULL), info_(info), @@ -107,7 +107,7 @@ class CodeStubGraphBuilderBase : public HGraphBuilder { SmartArrayPointer parameters_; HValue* arguments_length_; - CompilationInfoWithZone* info_; + CompilationInfo* info_; CodeStubDescriptor descriptor_; HContext* context_; }; @@ -190,7 +190,7 @@ bool CodeStubGraphBuilderBase::BuildGraph() { template class CodeStubGraphBuilder: public CodeStubGraphBuilderBase { public: - explicit CodeStubGraphBuilder(CompilationInfoWithZone* info) + explicit CodeStubGraphBuilder(CompilationInfo* info) : CodeStubGraphBuilderBase(info) {} protected: @@ -272,7 +272,8 @@ static Handle DoGenerateCode(Stub* stub) { if (FLAG_profile_hydrogen_code_stub_compilation) { timer.Start(); } - CompilationInfoWithZone info(stub, isolate); + Zone zone; + CompilationInfo info(stub, isolate, &zone); CodeStubGraphBuilder builder(&info); LChunk* chunk = OptimizeGraph(builder.CreateGraph()); Handle code = chunk->Codegen(); @@ -1711,7 +1712,7 @@ template <> class CodeStubGraphBuilder : public CodeStubGraphBuilderBase { public: - explicit CodeStubGraphBuilder(CompilationInfoWithZone* info) + explicit CodeStubGraphBuilder(CompilationInfo* info) : CodeStubGraphBuilderBase(info) {} protected: diff --git a/src/compiler.h b/src/compiler.h index 4ff7d96f6c..37c1184004 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -494,8 +494,6 @@ class CompilationInfoWithZone: public CompilationInfo { public: explicit CompilationInfoWithZone(Handle