diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-01-09 14:53:50 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-01-12 08:49:25 +0000 |
commit | 12df9ebf72255544b0147c81b1dca6644a29764e (patch) | |
tree | 93a47865d0c93922cfc036fba1f2490b64549912 /compiler/optimizing/code_generator.cc | |
parent | 4270e74152d8a7cd979ab5a92fe2a8f84adb8a42 (diff) | |
download | art-12df9ebf72255544b0147c81b1dca6644a29764e.tar.gz art-12df9ebf72255544b0147c81b1dca6644a29764e.tar.bz2 art-12df9ebf72255544b0147c81b1dca6644a29764e.zip |
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 11 |
1 files changed, 5 insertions, 6 deletions
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; |