From 12df9ebf72255544b0147c81b1dca6644a29764e Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 9 Jan 2015 14:53:50 +0000 Subject: Move code around in OptimizingCompiler::Compile to reduce stack space. Also fix an (intentional) memory leak, by allocating the CodeGenerator on the heap instead of the arena: they construct an Assembler object that requires destruction. BUG:18787334 Change-Id: I8cf0667cb70ce5b14d4ac334bd4487a562635f1b --- compiler/optimizing/code_generator.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 4205ebebf9..bb0dda0170 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -77,16 +77,16 @@ class SlowPathCode : public ArenaObject { DISALLOW_COPY_AND_ASSIGN(SlowPathCode); }; -class CodeGenerator : public ArenaObject { +class CodeGenerator { public: // Compiles the graph to executable instructions. Returns whether the compilation // succeeded. void CompileBaseline(CodeAllocator* allocator, bool is_leaf = false); void CompileOptimized(CodeAllocator* allocator); - static CodeGenerator* Create(ArenaAllocator* allocator, - HGraph* graph, + static CodeGenerator* Create(HGraph* graph, InstructionSet instruction_set, const InstructionSetFeatures& isa_features); + virtual ~CodeGenerator() {} HGraph* GetGraph() const { return graph_; } @@ -212,7 +212,6 @@ class CodeGenerator : public ArenaObject { slow_paths_(graph->GetArena(), 8), is_leaf_(true), stack_map_stream_(graph->GetArena()) {} - ~CodeGenerator() {} // Register allocation logic. void AllocateRegistersLocally(HInstruction* instruction) const; -- cgit v1.2.3-59-g8ed1b