diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2017-10-10 08:00:36 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-10-10 08:00:36 +0000 |
| commit | d4ea915d250490e4d79ba9ac040187742c995a7d (patch) | |
| tree | 461728ee4fcbbbfde067f110c2f669230deb33de /compiler/optimizing/codegen_test_utils.h | |
| parent | f923ea0b6f6867c29c961815462b9cb365cff563 (diff) | |
| parent | d124314f28aa35bc59c34081d8f48a8503af1c37 (diff) | |
Snap for 4386413 from d124314f28aa35bc59c34081d8f48a8503af1c37 to pi-release
Change-Id: Ie21195f60cf595c534b9f7add8bb27162316cdbb
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
| -rw-r--r-- | compiler/optimizing/codegen_test_utils.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index aa4f5da3f0d..bcbcc12349a 100644 --- a/compiler/optimizing/codegen_test_utils.h +++ b/compiler/optimizing/codegen_test_utils.h @@ -295,10 +295,15 @@ static void RunCodeNoCheck(CodeGenerator* codegen, const std::function<void(HGraph*)>& hook_before_codegen, bool has_result, Expected expected) { - SsaLivenessAnalysis liveness(graph, codegen); - PrepareForRegisterAllocation(graph).Run(); - liveness.Analyze(); - RegisterAllocator::Create(graph->GetArena(), codegen, liveness)->AllocateRegisters(); + { + ScopedArenaAllocator local_allocator(graph->GetArenaStack()); + SsaLivenessAnalysis liveness(graph, codegen, &local_allocator); + PrepareForRegisterAllocation(graph).Run(); + liveness.Analyze(); + std::unique_ptr<RegisterAllocator> register_allocator = + RegisterAllocator::Create(&local_allocator, codegen, liveness); + register_allocator->AllocateRegisters(); + } hook_before_codegen(graph); InternalCodeAllocator allocator; codegen->Compile(&allocator); @@ -331,7 +336,7 @@ static void RunCode(CodegenTargetConfig target_config, CodeGenerator* create_codegen_arm_vixl32(HGraph* graph, const CompilerOptions& compiler_options) { std::unique_ptr<const ArmInstructionSetFeatures> features_arm( ArmInstructionSetFeatures::FromCppDefines()); - return new (graph->GetArena()) + return new (graph->GetAllocator()) TestCodeGeneratorARMVIXL(graph, *features_arm.get(), compiler_options); } #endif @@ -340,7 +345,7 @@ CodeGenerator* create_codegen_arm_vixl32(HGraph* graph, const CompilerOptions& c CodeGenerator* create_codegen_arm64(HGraph* graph, const CompilerOptions& compiler_options) { std::unique_ptr<const Arm64InstructionSetFeatures> features_arm64( Arm64InstructionSetFeatures::FromCppDefines()); - return new (graph->GetArena()) + return new (graph->GetAllocator()) TestCodeGeneratorARM64(graph, *features_arm64.get(), compiler_options); } #endif @@ -349,7 +354,8 @@ CodeGenerator* create_codegen_arm64(HGraph* graph, const CompilerOptions& compil CodeGenerator* create_codegen_x86(HGraph* graph, const CompilerOptions& compiler_options) { std::unique_ptr<const X86InstructionSetFeatures> features_x86( X86InstructionSetFeatures::FromCppDefines()); - return new (graph->GetArena()) TestCodeGeneratorX86(graph, *features_x86.get(), compiler_options); + return new (graph->GetAllocator()) TestCodeGeneratorX86( + graph, *features_x86.get(), compiler_options); } #endif @@ -357,7 +363,7 @@ CodeGenerator* create_codegen_x86(HGraph* graph, const CompilerOptions& compiler CodeGenerator* create_codegen_x86_64(HGraph* graph, const CompilerOptions& compiler_options) { std::unique_ptr<const X86_64InstructionSetFeatures> features_x86_64( X86_64InstructionSetFeatures::FromCppDefines()); - return new (graph->GetArena()) + return new (graph->GetAllocator()) x86_64::CodeGeneratorX86_64(graph, *features_x86_64.get(), compiler_options); } #endif @@ -366,7 +372,7 @@ CodeGenerator* create_codegen_x86_64(HGraph* graph, const CompilerOptions& compi CodeGenerator* create_codegen_mips(HGraph* graph, const CompilerOptions& compiler_options) { std::unique_ptr<const MipsInstructionSetFeatures> features_mips( MipsInstructionSetFeatures::FromCppDefines()); - return new (graph->GetArena()) + return new (graph->GetAllocator()) mips::CodeGeneratorMIPS(graph, *features_mips.get(), compiler_options); } #endif @@ -375,7 +381,7 @@ CodeGenerator* create_codegen_mips(HGraph* graph, const CompilerOptions& compile CodeGenerator* create_codegen_mips64(HGraph* graph, const CompilerOptions& compiler_options) { std::unique_ptr<const Mips64InstructionSetFeatures> features_mips64( Mips64InstructionSetFeatures::FromCppDefines()); - return new (graph->GetArena()) + return new (graph->GetAllocator()) mips64::CodeGeneratorMIPS64(graph, *features_mips64.get(), compiler_options); } #endif |
