diff options
author | Vladimir Marko <vmarko@google.com> | 2017-10-09 12:58:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-09 12:58:04 +0000 |
commit | 0967cd94860178a5809a9678d005b18c20c24707 (patch) | |
tree | f9e0c97fc7efbdbd8236b1f280227f1c9457d089 /compiler/optimizing/codegen_test_utils.h | |
parent | 464f8cd7385a9958c3171e2feaa93c726043bbf8 (diff) | |
parent | e764d2e50c544c2cb98ee61a15d613161ac6bd17 (diff) |
Merge "Use ScopedArenaAllocator for register allocation."
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
-rw-r--r-- | compiler/optimizing/codegen_test_utils.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index 5f4593ff0e..bcbcc12349 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->GetAllocator(), 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); |