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.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 4d8154e6a0..a5d82a8ccc 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -325,26 +325,25 @@ bool CodeGenerator::GoesToNextBlock(HBasicBlock* current, HBasicBlock* next) con return current->GetBlockId() + 1 == next->GetBlockId(); } -CodeGenerator* CodeGenerator::Create(ArenaAllocator* allocator, - HGraph* graph, +CodeGenerator* CodeGenerator::Create(HGraph* graph, InstructionSet instruction_set, const InstructionSetFeatures& isa_features) { switch (instruction_set) { case kArm: case kThumb2: { - return new (allocator) arm::CodeGeneratorARM(graph, + return new arm::CodeGeneratorARM(graph, isa_features.AsArmInstructionSetFeatures()); } case kArm64: { - return new (allocator) arm64::CodeGeneratorARM64(graph); + return new arm64::CodeGeneratorARM64(graph); } case kMips: return nullptr; case kX86: { - return new (allocator) x86::CodeGeneratorX86(graph); + return new x86::CodeGeneratorX86(graph); } case kX86_64: { - return new (allocator) x86_64::CodeGeneratorX86_64(graph); + return new x86_64::CodeGeneratorX86_64(graph); } default: return nullptr; -- cgit v1.2.3-59-g8ed1b